MV Force game.exe to use dedicated GPU

Hey! In my project (mv) I've added several plugins that increased the graphic demand of the game. The problem is that even though that happened, Windows 11 (laptop) still considers it low-demand program and runs it on iGPU and it never utilizes my RTX3070.
So I basically have a 40-80 fps game instead of 144 fps and it sometimes even crashes. Yes I can easily fix that by manualy changing the settings from the Control Panel and force it to run on dedicated GPU, but what about the players? Some of them may encounter the same problem but not everyone can fix it by themselves.

1. So, is there a way to modify the .exe file of a deployed project in order to force it to run through the GPU instead of iGPU?
2. Or a trick which will make the OS see it as heavier program and auto choose the GPU?
2. Will that affect Canvas mode somehow or that is not something I should be concerned about?
I don't know if this'll make Windows detect it properly, but if you use the Community_Basic plugin, I'd set rendering mode to WebGL in its plugin parameters.

If that doesn't work, then I have no idea.
Standalone RMMV games run in a NWJS app, which is essentially a small Chromium-based browser.

NWJS might support a command-line argument that affects which GPU is used to run the application? If so, you could add that to the chromium-args section of your game's manifest file (package.json). I just had a quick look here, though, and didn't see anything promising:
A quick search online suggests that Electron (an alternative to NW) has a --force_high_performance_gpu arg. I don't know whether that's from an updated version of Chromium, or something specific to Electron. Either way I tried that, as well as --in_process_gpu (to hit your 2nd point), but neither one seemed to change which GPU was used in playtest.

Canvas/WebGL render mode is initialised via the core scripts, after the app has launched. The game tries to do some WebGL stuff, and if that fails, it uses Canvas (cf Graphics.hasWebGL in rpg_core.js).
To add to caethyril, here's a few other chromium args you can try:
Code:
"chromium-args" : "--in-process-gpu ignore-gpu-blocklist --force-gpu-mem-available-mb=14000 --force-gpu-rasterization --enable-native-gpu-memory-buffers --enable-gpu-memory-buffer-compositor-resources",
but if you use the Community_Basic plugin
It does run on webGL by default when it's set on auto, but laptops usually have 2 gpu, the dedicated one (nvidia) and integrated (the GPU build inside the CPU) so I do technically run the game on webGL but my GPU (the real one) never activates. The whole problem comes from the fact that win11 considers RPG Maker games as "light" programs and It runs them on the weaker iGPU.


Standalone RMMV games run in a NWJS app
I'll look into that and research the topic, thanks


neither one seemed to change which GPU was used in playtest.
Playtest is not a problem I can just force it to use the right GPU on my laptop


To add to caethyril, here's a few other chromium args you can try:
I'll look into it

Thanks for the answers guys, cheers

Original thread: https://forums.rpgmakerweb.com/threads/force-game-exe-to-use-dedicated-gpu.181566/