Regarding optimus support on wayland
Hey fellow people . I am having a strange problem. Been running nvidia optimus with amd vega gpu on my laptop on with gnome as my desktop environment. The thing is after setting up everyrhing according to the wiki, the driver loads up just fine when using Xorg. But as soon as i switch to wayland, the driver is not working. Nvidia-smi output gives no running processes found. Also i am running the latest nvidia drivers, one which has the wayland support.
Any help would be great.
About this post
- Posted
- Archived
- Score
- 2 · 75% up
- Kind
- Text
- ID
- py16xc
2 comments
Wayland was already supported by the Nvidia drivers. It was accelerated XWayland which wasn't supported until 470. Which would have no effect on whether or not Optimus would work.
But yeah, Optimus isn't supported on Wayland:
That's from the official documentation at https://github.com/Askannz/optimus-manager
Some poor soul posted on the Manjaro forums earlier in the year saying "Hey Optimus works on Manjaro" and their screenshot to show it working was them running
nvidia-smisuccessfully but it shows no running processes lmao.However I've seen people that appear to have had success with bumblebee/primus. Maybe try that.
I dont know about gnome but in kde wayland or sway (wayland) configured to use the amd gpu you can use the prime-run command to launch a xwayland using the nvidia card , you just have to set correctly some env variables :
In your session (bash, zsh) set :
And prepend to or better create a new prime-run (cause it can be replaced in an update) the same variables but for nvidia:
You have to have the nvidia modules loaded (via mkinitcpio.conf or in modprobe.d) or in my case I use a simple script to load/unload the modules.
Then prime-run app, should appear in nvidia-smi .
The problem is with my amd/nvidia laptop is that when the nvidia_drm module is loaded the opengl/vulkan games show some kind of stutter/artifacts like showing parts of a previous frame like if is not syncing but with normal/high fps, if the nvidia_drm is not loaded only with nvidia, nvidia_modeset, nvidia_uvm modules runs almost smooth but the fps could be lower and/or without sync. I dont know yet if is the xwayland or the driver.
edit: if nvidia-smi show no process means you are running your de/wm session with the integrated gpu (amdgpu), if the nvidia drivers were not loaded the nvidia-smi will crash with an error, only when using X11 config you will see a xorg process running in the case of prime offload until you launch others using it (prime-run) or many when X11 is configured to use only nvidia.