Dgpu switching issues, switcheroo not working

Hoping someone here can help, at my limit of trying to fix this.
Leap 15.6
ROG Zephyrus G14
Nvidia: 570.124.04

I am trying to get switcheroo working after months of pain with suse-prime and not able to reliably switch back and forth between my integrated and nvidia dgpu.

So far I have followed the guides for switcheroo which seem easy. Have removed and locked suse-prime as suggested. Switcheroo is installed and recognizes my integrated and nvidia gpu.

But I cannot seem to turn the dpgu off at all. Have gone through endless prompts with grok to try and resolve this. Honestly a bit lost in everything I’ve tried. Currently this is where I’m at:

Removed and locked suse-prime:
sudo zypper remove suse-prime
sudo zypper al suse-prime

Installed switcheroo
switcherooctl version
2.6

switcheroo list shows my hardware just fine:
Device: 0
Name: Advanced Micro Devices, Inc. [AMD®/ATI] Renoir [Radeon Vega Series / Radeon Vega Mobile Series]
Default: yes
Environment: DRI_PRIME=pci-0000_04_00_0

Device: 1
Name: NVIDIA Corporation TU106M [GeForce RTX 2060 Max-Q]
Default: no
Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only

Created this file: /etc/udev/rules.d/80-nvidia-pm.rules
ACTION==“bind”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x030000”, TEST==“power/control”, ATTR{power/control}=“auto”
ACTION==“bind”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x030200”, TEST==“power/control”, ATTR{power/control}=“auto”
ACTION==“unbind”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x030000”, TEST==“power/control”, ATTR{power/control}=“on”
ACTION==“unbind”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x030200”, TEST==“power/control”, ATTR{power/control}=“on”

Added these lines to ~/.config/kwinrc
[Wayland]
PreferAMDGPU=true

Added these lines to ~/.config/environment.d/wayland.conf
DRI_PRIME=0

Past this I’m stuck and cannot seem to get further. Any help would be very much appreciated.

What does switcherooctl list report?

Can you switch off the DGPU with sudo switcherooctl off?

switcherooctl list returns the correct hardware:

  Name:        Advanced Micro Devices, Inc. [AMD®/ATI] Renoir [Radeon Vega Series / Radeon Vega Mobile Series]
  Default:     yes
  Environment: DRI_PRIME=pci-0000_04_00_0

Device: 1
  Name:        NVIDIA Corporation TU106M [GeForce RTX 2060 Max-Q]
  Default:     no
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only

running sudo switcherooctl off returns the rollowing error:

  File "/usr/bin/switcherooctl", line 187, in <module>
    launch(args, gpu)
  File "/usr/bin/switcherooctl", line 66, in launch
    os.execvp(args[0], args)
  File "/usr/lib64/python3.6/os.py", line 559, in execvp
    _execvpe(file, args)
  File "/usr/lib64/python3.6/os.py", line 604, in _execvpe
    raise last_exc.with_traceback(tb)
  File "/usr/lib64/python3.6/os.py", line 594, in _execvpe
    exec_func(fullname, *argrest)
FileNotFoundError: [Errno 2] No such file or directory

The switcherootctl list output confirmed that the AMD GPU (iGPU) is active and default as expected.

Which desktop environment are you using? Switching to the dGPU should only happen when requested. GNOME integrates with NVIDIA PRIME Render Offload via the system’s desktop menu entries, and KDE can be configured similarly, for apps that would benefit from using the dedicated graphics processing. Otherwise, it should just stay inactive.

More info:

My bad - the switcherootctl off was a mistake (not a valid command).

I’m on KDE. Everything seems to be set as it should yet the dGPU will not turn off. I have previously used Gnome with an extension to switch (cannot remember the name now), it stopped working and have since moved to back to KDE.

With suse-prime it was flaky at best, but when properly off nvidia-smi would return nothing as the Nvidia gpu was not active. However right now it seems always active and I cannot seem to launch with just the iGPU and only launch applications as requested.

Why do you think this? How are you determining dGPU activity? If you run some applications, show us what is reported by nvidia-smi. They’ll only be reported if using the NVIDIA dGPU.

This is the output of nvidia-smi. The way suse-prime worked when the gpu was off, nvidia-smi would return nothing and had to right click an application to launch with the dgpu. Similarly with nvtop there was no Nvidia information to show.

To use Davinci Resolve for example, would need to specifically launch it with the dgpu or it would not find it.

| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2060 ...    Off |   00000000:01:00.0 Off |                  N/A |
| N/A   37C    P8              2W /   30W |      14MiB /   6144MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            1570      G   /usr/bin/X                                4MiB |
|    0   N/A  N/A            2520      G   /usr/bin/ksmserver                        1MiB |
|    0   N/A  N/A            2795      G   /usr/bin/kaccess                          1MiB |
+-----------------------------------------------------------------------------------------+```

OK, that output is as expected for Plasma Wayland. The NVIDIA GPU is in a very low-power idle state (P8), using only 2W (almost off). The GPU utilization is at 0%. So, it is powered but idle.

The ksmserver and kaccess entries are KDE session processes, and of course XWayland is also active. So, there is a small GPU context, but nothing significant.

I still notice a significant difference in battery life. 1-2hrs vs 4-6hrs. This is not a huge issue ,but was looking for a way to disable it completely and only have applications launch using it if I specifically ask it.

You’d likely need to use an X11 desktop session if you want to completely have it powered down.

Ok, thanks very much for your help. I found X11 to have other issues and prefer to stay with Wayland.

Yes, Wayland offers other significant advantages and is the way forward. It’s a small tradeoff IMHO. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.