FeralInteractive / gamemode

Optimise Linux system performance on demand
BSD 3-Clause "New" or "Revised" License
4.68k stars 184 forks source link

0% GPU utilization with OpenGL applications #395

Open SpoodyTheOne opened 1 year ago

SpoodyTheOne commented 1 year ago

Gamemoderun does not make the program or game use the GPU in certain circumstances. I noticed this when i tried to play Factorio and Team Fortress 2, where mangohud reported 0% gpu utilization. Likewise DaVinci Resolve did not function until i switched from gamemoderun to prime-run. I suspected it might be because these 3 use OpenGL, so i tested glxgears with the command mangohud gamemoderun glxgears And sure enough, mangohud reported 0% gpu utilization. Running mangohud prime-run glxgears works as expected Running vkcube instead of glxgears shows the GPU being used

To Reproduce Steps used to reproduce the behavior:

  1. Launch gamemod with mangohud gamemoderun glxgears
  2. See that mangohud reports 0% gpu usage

Expected behavior Gamemoderun should provide gpu usage in the same manner as prime-run.

System Info:

Additional context

mangohud gamemoderun glxgears image

mangohud prime-run glxgears image

mangohud gamemoderun vkcube image

Any help would be greatly appreciated

SpoodyTheOne commented 1 year ago

Adding GAMEMODERUNEXEC="env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only" to /etc/environment fixed the issue

SpoodyTheOne commented 1 year ago

Nevermind, adding GAMEMODERUNEXEC="env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only" to /etc/environment breaks picom for some reason