ValveSoftware / Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
470 stars 38 forks source link

[Linux] Unable to offload Dota2 to eGPU on laptop with integrated + dedicated Nvidia graphics #2393

Open mikoff opened 1 year ago

mikoff commented 1 year ago

Your system information

Please describe your issue in as much detail as possible:

I have a laptop with:

I can successfully offload all the apps to eGPU (e.g. glxgears) and see that the process is really processed on this (using nvidia-smi, I see that the eGPU is actually loaded).

However, it is not the case for Dota2 or other steam-games. They, nevertheless, are calculated on internal GPU of the laptop (MX150).

Steps for reproducing this issue:

  1. Prepend the following parameters to the Dota2 or steam client: __NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command% By doing so we say that we want our application to be uploaded to eGPU (NVIDIA-G1 in my case).

  2. Start Dota2.

  3. Run nvidia-smi, you will notice that the game is actually processed in "C+G" mode and offloaded to internal dedicated GPU (NVIDIA-G0, or MX150 in my case), and not to eGPU.

Note: to enable eGPU after driver install add the following line to /usr/share/X11/xorg.conf.d/10-nvidia.conf:

    Option "AllowExternalGpus" "true"

Screenshot from 2023-07-16 16-38-08

However, if I use the same env parameters to run vkcube, it works as expected, offloading it to eGPU: Screenshot from 2023-07-16 16-40-33

danginsburg commented 1 year ago

Does adding -adapter 1 to the command line use the eGPU?

mikoff commented 1 year ago

Suprisingly, it worked out! Thanks for a hint!