The International Simutrans Forum

 

Author Topic: How does integrated vs dedicated GPU affect Simutrans performance?  (Read 1149 times)

0 Members and 1 Guest are viewing this topic.

Offline Matthew

  • *
  • Posts: 547
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
I am considering buying or building a new or second-hand PC. For non-Simutrans purposes, the integrated graphics on recent Ryzen APUs (2400G, 3400G) meet my requirements.

However, the PC also needs to be able to run the Bridgewater-Brunel multiplayer games of Simutrans-Extended.  ::-\

The standard advice available on Internet fora is that using integrated graphics does not slow the CPU - except that it reduces the CPU's memory bandwidth, which of course is exactly where Simutrans bottlenecks. However, most of these advice threads are probably assuming that the iGPU is being used heavily, but Simutrans barely uses it all (in my cloud, VM, Sim-Ex uses about 1% of an RX480). One of the top programmers on Stack Overflow claims that the actual sending-stuff-to-the-monitor aspect uses a tiny amount of of RAM bandwidth, in which case iGPUs are probably fine.

I am aware that using the fastest dual-channel RAM affordable will maximize the memory bandwidth.

Does anyone have more thoughts on the relative performance of Simutrans using integrated vs dedicated graphics? If I buy a dedicated graphics card, then I'm not going to be buying the fastest RAM too....

If anyone has dedicated and integrated GPUs and lots of free time to donate, you could settle the question by generously comparing the performance of the Bridgewater-Brunel savegame on each one.  :question:


Offline Vladki

  • Devotee
  • *
  • Posts: 3705
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #1 on: November 27, 2020, 08:10:09 AM »
Although I don't have any data on this, I think that the difference between integrated and dedicated graphics will be negligible. Just buy the fastest ram that your cpu and motherboard can use.

Offline freddyhayward

  • Devotee
  • *
  • Posts: 645
  • Languages: EN
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #2 on: November 27, 2020, 08:15:13 AM »
I use a laptop with a dedicated GPU but that is almost always disabled because of its refusal to cooperate with linux. On the rare occasions i've used it with simutrans, it never made any noticeable difference.

Offline Freahk

  • Devotee
  • *
  • Posts: 1435
  • Languages: DE, EN
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #3 on: November 27, 2020, 08:48:07 AM »
I didn't make any detailled testing for now, but I would not expect a huge performance impact if any.
Usually I'm running simutrans on the intel HD GPU, but I'll test running the game on my dedicated GTX965M, which is notably faster and comes with its own graphics memory.
Simutrans is not pretty demanding to the GPU, so the pure performance of the GPU won't matter here.

What might matter is the memory bandwith, but the plain image sprites are processed by the CPU, thus need to be loaded thre anyways, so I don't expect any gain in using my dedicated GPU over the intel HD graphics.

I'll report on this later.

Offline Roboron

  • Devotee
  • *
  • Posts: 245
    • Las Gal├ícticas Aventuras de Komoyo Diga
  • Languages: ES, EN
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #4 on: November 27, 2020, 10:15:29 AM »
Simutrans doesn't make use of the GPU really, so it doesn't matter. A recent discussion aims to change this, but that's such a gargantuan task I don't see it happening anytime soon (if it does happen, which I also doub).

Your best bet is upgrading RAM & CPU ^.^

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10542
  • Languages: De,EN,JP
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #5 on: November 27, 2020, 02:00:22 PM »
Since Simutrans mainly wants memory bandwidth, filling at least two slots of DRAM is preferable. Still the display eats not much badwidth noawadays. Even with a 4k display, 60 fps are at most 2 GBytes/s (all nicely in linear memory at optimum access conditions). A 2012 Sandy Bridge CPU had a bandwidth of 60 GByte/s for linear access in burst mode (with fast enough DRAM), so less than 1/30 or less than 4 %. With a more common 2k display, it is 500 kB/s, and thus in the noise level.

Since a DDR3 channel (DDR3-1866) ca get 15 GB/s, you would need four channels  for 60 GB/s. So it depends on how many RAM channels you processor and mainboard uses.

Offline Freahk

  • Devotee
  • *
  • Posts: 1435
  • Languages: DE, EN
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #6 on: November 27, 2020, 03:38:34 PM »
As expected, apart from fan noise, I didn't notice any difference.
Subjectively, running the BB save offline on the nvidia GPU did not run more smoothly than running the same on the intel GPU.
Reported framerates have been roughly the same and running each of these for an hour at different times resulted in nearly the same ingame time (except from ~2 minutes)  after that meantioned real-world hour.

As expeced, dedicated vs integrated GPU doesn't matter pretty much in simutrans.

Edit: I'm a little confused about prissis mentioned numbers.
Sandy bridge offers a dual channel memory controller, which officially supports up to DDR3-1333, which is 2*10%u2154 GB/s
So which bandwith is 60 GB/s?

Just for curiosity, it doesn't affect the point pretty much anyways. 500 kB/s is still a small portion of this.
« Last Edit: November 27, 2020, 04:28:26 PM by Freahk »

Offline Matthew

  • *
  • Posts: 547
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #7 on: November 28, 2020, 07:18:28 AM »
Thank you to everyone for your helpful advice....

As expected, apart from fan noise, I didn't notice any difference.
Subjectively, running the BB save offline on the nvidia GPU did not run more smoothly than running the same on the intel GPU.
Reported framerates have been roughly the same and running each of these for an hour at different times resulted in nearly the same ingame time (except from ~2 minutes)  after that meantioned real-world hour.

As expeced, dedicated vs integrated GPU doesn't matter pretty much in simutrans.

.... especially Freahk, you are a star!  :thumbsup: :thumbsup: :thumbsup: :star: :star: :star: There is nothing like the scientific method for answering a question like this! It definitely takes some of the anxiety away knowing that my plans are not totally daft.

Based on this experimental evidence and everyone's advice, I have just ordered an integrated graphics 3400G.

I use a laptop with a dedicated GPU but that is almost always disabled because of its refusal to cooperate with linux.

I face the inverse problem. The graphics side of Ryzen APUs is not officially supported on Linux and despite many bug reports (to amdgpu, kernel, mesa, Ubuntu and other distros) very few people get them to work reliably out of the box. But I have been collecting kernel hacks and PPA addresses for two years and I hope one of these workarounds will do the job. I think it's a risk worth taking and in the end I can always buy Windows.

Since Simutrans mainly wants memory bandwidth, filling at least two slots of DRAM is preferable. .... So it depends on how many RAM channels you processor and mainboard uses.

I have ordered two sticks and the motherboard has slots for up to four. Although apparently Ryzen can only use four slots at much slower speeds, so hopefully the extra slots won't be needed for many years.

My build for anyone bored.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5689
  • Languages: EN, NO
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #8 on: November 28, 2020, 08:41:54 AM »
I face the inverse problem. The graphics side of Ryzen APUs is not officially supported on Linux and despite many bug reports (to amdgpu, kernel, mesa, Ubuntu and other distros) very few people get them to work reliably out of the box.
I had no problems getting mine to work, although I haven't been pushing it hard. There is some warning or error that appear in the logs, but I haven't noticed anything beyond that.

Offline Matthew

  • *
  • Posts: 547
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #9 on: November 28, 2020, 01:24:11 PM »
I had no problems getting mine to work, although I haven't been pushing it hard. There is some warning or error that appear in the logs, but I haven't noticed anything beyond that.

That's good to hear..... Though balanced by those bug reports. Do you watch YouTube on Chrome, Edge or Firefox-for-Windows? That seems to be the most common place the visual problems manifest for people. (IIRC Firefox for Linux didn't use hardware acceleration until recently, so was unaffected).

Offline Mishasama

  • *
  • Posts: 52
  • BE NICE
  • Languages: JA, ZH, EN
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #10 on: November 29, 2020, 03:13:48 PM »
Simutrans-Extended?
A dedicated GPU is your best choice.
The RAM is DDR4, and the GRAM is DDR5 or even DDR6X. That's not at the same level.

But on the other side, Simutrans is not so heavy duty for the modern CPU or GPU, but need a huge RAM size for a big map.
So maybe you should focus on the RAM size, not the RAM speed.

And I had tried to play with both iGPU (HD 530) and GPU (GTX 770), on the response time the GPU is absolutely faster than the iGPU.

My spec is 6700K with 32G DDR4 2400, GTX 770 with 2G DDR5.
The iGPU was set to used 1G RAM as dedicated GRAM. And both shared 15.5G RAM for the graphics.
« Last Edit: November 29, 2020, 03:27:25 PM by Mishasama »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10542
  • Languages: De,EN,JP
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #11 on: November 30, 2020, 04:52:37 AM »
Simutrans does not use GPU at the moment at all, and it sends the display to the GPU each time a new frame is updated. Hence the internal GPU could be even faster, since that copy would be not needed (if the driver is that clever). THus iGPU can have as little RAM as possible to just display (may 200 MB?)

The only reason why GPU could be faster, is that the memory bandwidth is slightly lower due to the display update also needing a tiny bit of bandwidth (less than 5%). Bu that speedup is gained even with a dedicated graphics card, even without and 3D accelleration. So the memory speed of you GPU does not matter.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5689
  • Languages: EN, NO
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #12 on: December 01, 2020, 06:15:29 PM »
That's good to hear..... Though balanced by those bug reports. Do you watch YouTube on Chrome, Edge or Firefox-for-Windows? That seems to be the most common place the visual problems manifest for people. (IIRC Firefox for Linux didn't use hardware acceleration until recently, so was unaffected).
I hardly use it for YouTube. It is meant for watching videos on my TV, either ripped from my DVD and BluRay collection, or streaming services (primarily the national broadcaster). However, my new cable box now can now stream from these things itself. Apart from that, it is just a server, primarily a file server, but also for other tinkering.

I recently upgraded from a Turin CPU because Firefox had trouble streaming HD videos, and transcoding HD videos.

Offline GeorgeWright

  • *
  • Posts: 1
    • Testogen Website
  • Languages: En
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #13 on: December 07, 2020, 02:06:34 PM »
I use a laptop with a dedicated GPU but that is almost always disabled because of its refusal to cooperate with linux. On the rare occasions i've used it with simutrans, it never made any noticeable difference.
This is not a problem buddy because sometimes it happens. I also use laptop in the Gpu but in my case it has made a difference. It depends on how you use.

Offline Freahk

  • Devotee
  • *
  • Posts: 1435
  • Languages: DE, EN
Re: How does integrated vs dedicated GPU affect Simutrans performance?
« Reply #14 on: December 07, 2020, 03:11:45 PM »
Well it might make a difference when the display is connected to the dedicated GPU.
In my setup, the internal display is connected to the iGPU, so the frame buffer needs to be copied back from the dedicated graphics to the iGPU.
According to intel_gpu_top, the memory bandwith used when running on the dedicated GPU was higher than the memory bandwith used when running on the iGPU directly. Lowest memory bandwith was reported when spawning simutrans to an xserver on a different machine over the network, causing a fair ~200 mbit/s of network traffic on my lan :P

Anyways, I'd not take these measurements too serious without more detailled research about that tool.
intel_gpu_top measures the intel GPU load as well as memory bandwith in use.
I did not dig deep enough to figure out the details, so might well be there's simply memory bandwith used elsewhere in the other cases.
I did not dig deep enough to figure out what exactly is measured there and what is not. Might well be the actual load to the memory chips is the same.

As noted before, in practice I did not experience any difference in my test setup (which did not include the remote xserver setup)