nVidia update strangeness

Since the 515 update, if I run in switchable, my laptop (Legion 5) is using the nVidia opengl not the AMD renoire (or was it Cezanne :smiley: ).

Sway with nVidia discrete is really glitchy, sway with nVidia opengl is laggy.

How do I force it to use pure AMD?

Graphics:
  Device-1: NVIDIA GA104M [GeForce RTX 3070 Mobile / Max-Q] driver: nvidia
    v: 515.43.04
  Device-2: Acer Integrated Camera type: USB driver: uvcvideo
  Display: wayland server: X.org v: 1.21.1.3 with: Xwayland v: 21.1.99
    compositor: sway v: 1.7 driver: X: loaded: nvidia unloaded: modesetting
    gpu: nvidia,nvidia-nvswitch resolution: 1920x1080~144Hz
  OpenGL: renderer: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2
    v: 4.6.0 NVIDIA 515.43.04

^ nVidia discrete - BRB

Graphics:
  Device-1: NVIDIA GA104M [GeForce RTX 3070 Mobile / Max-Q] driver: nvidia
    v: 515.43.04
  Device-2: AMD Cezanne driver: amdgpu v: kernel
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo
  Display: wayland server: X.org v: 1.21.1.3 with: Xwayland v: 21.1.99
    compositor: sway v: 1.7 driver: X: loaded: amdgpu,nvidia
    unloaded: modesetting gpu: amdgpu resolution: 1920x1080~144Hz
  OpenGL: renderer: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2
    v: 4.6.0 NVIDIA 515.43.04

^ switchable.

GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau nohpet quiet nvidia-drm.modeset=1 resume=UUID=ba983a7c-9d2a-4b9f-88bb-8879c19eae00 loglevel=3 nowatchdog nvme_load=YES nvidia-drm.modeset=1"

Downgraded to 510:

Graphics:
  Device-1: NVIDIA GA104M [GeForce RTX 3070 Mobile / Max-Q] driver: nvidia
    v: 515.43.04
  Device-2: AMD Cezanne driver: amdgpu v: kernel
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo
  Display: wayland server: X.org v: 1.21.1.3 with: Xwayland v: 21.1.99
    compositor: sway v: 1.7 driver: X: loaded: amdgpu gpu: amdgpu
    resolution: 1920x1080~144Hz
  OpenGL: renderer: N/A v: N/A

Any ideas?

What is thisswitchable ? :laughing: Optimus-manager or BIOS? If BIOS, what other options exist?
Add also inxi -SCaz
I am not updated on what nvidia-nvswitch does. If you know something, please explain or give a link for reading.
In any case, provide Xorg logs (from journalctl on modesetting, or wherever they are, even from DM).

This is normally not needed, since nvidia package has a blacklist for nouveau, unless there is another reason…

This is inserted twice :scream: just FYI…

Do you use Early loading (check mkinitcpio.conf)? Maybe removing it would make AMD take over first… Not sure though…

The perils of copy and paste, wont hurt :smiley:

In my bios I have two options, switchable and discrete. The discrete is an nvidia RTX3070, the switchable uses the built-in AMD.

I do not use optimus or it’s friends, I run on the AMD most of the time in Sway as the nVidia experience is horrible.

The rd.driver bit came from trying to get Sway to run on the nVidia from a tutorial on the forum.

1 Like

Comparing the logs would give some idea of what is being done differently in new vs. old driver.
Wayland does not create /var/log/Xorg.?.log I suppose. I have seen them in journal with a GDM Gnome issue.

@jonathon - just wondering if you are seeing this (or do you run with discrete all the time, are you still running Mate?).

I’ve been running discrete because of the constant-Xorg-CPU-use-with-hybrid-graphics-and-external-display issue, but I’ll have to try with 515.

Thanks :smiley: I downgraded back to 510 so Sway is less laggy, will have another play when I get back from work.

1 Like

OK, so it looks like whatever was previously broken with switchable+GNOME+Wayland (I can’t remember what it was) is now working correctly - I have a running Wayland session using the AMD GPU with various applications being automatically offloaded to the NVIDIA GPU.

One other difference (which means this is not systematic… :person_facepalming:) was that I set

GBM_BACKEND=nvidia-drm
__GLX_VENDOR_LIBRARY_NAME=nvidia

in /etc/environment

Actually, that’s worth trying as it should get Sway running on NVIDIA using GBM (instead of EGLStreams, which Sway doesn’t support).

(There’s still the reverse-PRIME-external-display-high-CPU issue with Xorg.)

Graphics:
  Device-1: NVIDIA GA104M [GeForce RTX 3070 Mobile / Max-Q] driver: nvidia
    v: 515.43.04
  Device-2: AMD Cezanne driver: amdgpu v: kernel
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo
  Display: wayland server: X.org v: 1.21.1.3 with: Xwayland v: 22.1.1
    compositor: gnome-shell v: 42.1 driver: X: loaded: amdgpu,nvidia
    unloaded: fbdev,modesetting gpu: amdgpu,nvidia,nvidia-nvswitch
    resolution: 1: 3440x1440~144Hz 2: 1920x1080~144Hz
  Message: Wayland GBM/EGL data currently not available.
1 Like

Nope, didn’t work. Sway glitchy as hell.

1 Like

At work, so I am going to leave this here to try when I get home, but appears to contain some good stuff :smiley:

Brilliant, that worked. Am now running on the built-in swappable with the correct opengl:

Graphics:
  Device-1: NVIDIA GA104M [GeForce RTX 3070 Mobile / Max-Q] driver: nvidia
    v: 515.43.04
  Device-2: AMD Cezanne driver: amdgpu v: kernel
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo
  Display: wayland server: X.org v: 1.21.1.3 with: Xwayland v: 21.1.99
    compositor: sway v: 1.8-dev-3f600565 driver: X: loaded: amdgpu gpu: amdgpu
    resolution: 1920x1080~144Hz
  OpenGL: renderer: AMD RENOIR (LLVM 13.0.1 DRM 3.44 5.17.7-zen1-2-zen)
    v: 4.6 Mesa 22.0.3
1 Like

Yes; you disabled the NVIDIA GPU entirely so it’s running only on the AMD GPU.

1 Like

Would you mind explaining what you modified?

I just followed the reddit tutorial, blacklisted everything and created a basic xorg.conf and rebooted.

I would appreciate if you post the file contents when you find some time.
The tutorial was for a personal unique HW/SW combination and also not so easy for inexperienced users to comprehend. Having a copy in the forum would be more helpful IMHO.
Thanks anyway for answering.

Section "Device"
    Identifier "amdgpu"
    Driver "amdgpu"
EndSection

Is what I used.

2 Likes

I suspect just blacklisting all the NVIDIA driver modules (nvidia, nvidia-drm, nouveau) would achieve the same thing, so only amdgpu is loaded.

No, tried that first, it needed the xorg.conf.

1 Like