Score:0

Ubuntu 23.04/gnome-shell 44.1 wayland how to force use nvidia driver

si flag

I have a laptop with nvidia RTX 3050 GPU and just installed Ubuntu 23.04, gnome 44.1 and wayland. I tried nvidia driver 530, 535 but gnome-shell does not use nvidia driver on wayland session. It uses intel UHD driver. So it's very slow on 4k monitor.

$ glxinfo | egrep "OpenGL vendor|OpenGL renderer"

OpenGL vendor string: Intel OpenGL renderer string: Mesa Intel(R) UHD Graphics (TGL GT1)

When I turned into X11 session, nvidia works properly, and performs very well.

How can I force gnome-shell use nvidia propretary driver?

Hannu avatar
ca flag
Open a terminal (CTRL+ALT+T), type `nvidia-smi` and hit Enter. If that doesn't list your GPU, then you have a driver issue and need to rectify that. WinKey and typing `Addditional Drivers` should list Nvidia drivers (and allow to select one), if it doesn't look in the `Ubuntu Software`-tab and make sure all is selected except `Sources`, the go back check. Any earlier / remnants of drivers (installation attempts) must be removed / cleansed prior to this though.
si flag
`nvidia-smi` shows `NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2`
Score:0
us flag

For Wayland sessions you can control which GPU to use with an udev rule. Here's how to do it, assuming both of your drivers work correctly:

Create a new file with the nano text editor:

sudo nano /etc/udev/rules.d/61-mutter-primary-gpu.rules

Paste the following content:

ENV{DEVNAME}=="/dev/dri/card1", TAG+="mutter-device-preferred-primary"

Save with CTRL + O, and press enter. Reboot your system.

Notice that in the example above I set it to card1, you probably have card0 and card1 in your system so you might have to try both to find the correct one. I have successfully used this method to change from my dedicated Nvidia GPU to my integrated AMD GPU when using Wayland (AMD drivers work better with Wayland).

si flag
thank you, but it does not work for me.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.