linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.53k stars 735 forks source link

Switcheroo Control Does Not Work Properly with Nvidia Drivers #11580

Closed BlindRepublic closed 1 year ago

BlindRepublic commented 1 year ago

Issue

Launching applications that have PrefersNonDefaultGPU=true in their .desktop file does not result in the application running on the Nvidia card.

Steps to reproduce

  1. Install Steam
  2. Run Steam from menu (without changing environment variables)
  3. Select a game to play
  4. Note that game is using the integrated GPU (verify with nvidia-smi)

Expected behaviour

The game should be using the Nvidia graphics card and the binary should be visible under nvidia-smi.

Other information

leigh123linux commented 1 year ago

Does this work?

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia  steam

Maybe steam needs this to run

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only steam
BlindRepublic commented 1 year ago

Yes, and even manually running Steam via switcherooctl launch /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper com.valvesoftware.Steam works properly.

BlindRepublic commented 1 year ago

Looking through https://github.com/linuxmint/xapp/blob/b0bc45f8e5cb2aa2afb1d76569589234feac33d6/libxapp/xapp-util.c, it seems that xapp_util_gpu_offload_supported uses Ubuntu specific tooling. It would be better to use switcheroo-control instead. I'll report this there too.

mtwebster commented 1 year ago

https://github.com/linuxmint/cinnamon/commit/00b0a65bd47d805b7bdbfcc4723f3d43ac1ea116

InfinityBladeX10STD commented 10 months ago

How to do this in fortnite in windows in laptop