Hey everyone,
I’m a bit sad. I’ve been working on my very WIP game and while my laptop had a decent CPU, it had no dedicated GPU. So I finally splashed a little (a lot) for my birthday and bought a new laptop with a latest-and-greatest Nvidia card, but to my surprise I was getting nearly the same performance as my older machine.
It just occurred to me today that the browser might not even be using my brand new GPU – I went to check the task manager (Windows 11) and indeed the integrated GPU is being used rather than the Nvidia one.
I was able to fix this following Setting the Preferred Graphics Processor to assign the dedicated GPU to my browser (Chrome).
But I feel like this isn’t something I can reasonably expect players of my game to do. I had some hope at first about the GPUPowerPreference option of WebGPU (the engine I’m using in Babylon) which allows to choose a “high-performance” (dedicated) or “low-power” (integrated) GPU. Unfortunately this is both behind a Chrome flag (#enable-webgpu-developer-features) and didn’t work when I tested it.
I guess I have a statement and a question:
- If you are using Windows and Chrome and haven’t ever done this, try selecting a dedicated GPU in Graphics settings for Chrome if you haven’t done so. It can make an insane performance difference, making at least the development environment less frustrating if slowness is an issue.
- Am I missing something that I can control from my app to get the more performant GPU used by default?
I do understand why the default configuration is to use low performance, as it’s fine for normal browsing use and doesn’t consume as much energy. But it’s sad for the web-based gaming community (at least on Chrome + Windows) if there isn’t a frictionless way for a game to request with minimal / no user interaction an ‘upgrade’ for a tab that needs the extra acceleration, if I haven’t missed something.
Happy to hear your thoughts!
EDIT:
Oh, a follow-up question:
I hope to eventually publish the game to steam, and was planning to just bundle Chromium into a simple installer. I guess I could then have the installer do Windows-level config stuff, like setting the GPU adapter for my chrome.exe target?
Apparently something like this is possible via the registry:
[HKEY_CURRENT_USER\Software\Microsoft\DirectX\UserGpuPreferences]
"C:\\Program Files\\MyGame\\MyGame.exe"="GpuPreference=2;"
Anyone ever done something like this before?