You are not logged in.

#1 2023-11-12 19:15:58

scippie
Member
Registered: 2019-06-07
Posts: 148

[solved] Struggling to get nvidia (with prime) to work on hybrid gpu

I've been using Arch for over 6 years now, but when it comes to this, I keep feeling like a newbie.

I installed Arch on my laptop yesterday with a minimal setup. After that, I installed QTile and got it to work.
QTile is running on Wayland (checked it), there is no Xorg on the system, and it is using the Intel GPU.
As this is a 4K screen laptop, I configured Kanshi to scale the image. It took me a long time to find out that my display name is eDP-1.

After that, I installed the nvidia and nvidia-prime packages. I also installed mesa-utils and xwayland to be able to use glxinfo to check which gpu is in use as I couldn't find a Wayland alternative to this.

After a reboot, my display name had changed from eDP-1 to eDP-2 (noticed that because Kanshi was no longer scaling with the config I made). I don't know why that happened, but according to glxinfo, the current gpu was still Intel.
(side question: why did this happen?)
Update: strange thing, the laptop has been off and now it is back to eDP-1.

Now I tried prime-run glxinfo to find out if the nvidia gpu would be used, but I got an error:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  150 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  50
  Current serial number in output stream:  51

I have read through the wiki, but I must admit that my concentration is bad, especially as this is the 5th time I read through those same pages.

Any tips on what to do?

$ lspci -k | grep VGA
00:02.0 VGA compatible controller: Intel Corporation CometLake-H GT2 [UHD Graphics] (rev 05)
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
$ nvidia-modprobe
-> this takes a while (3-4 seconds) and doesn't give any output

Last edited by scippie (2023-11-13 08:56:12)

Offline

#2 2023-11-12 23:09:59

seth
Member
Registered: 2012-09-03
Posts: 60,080

Re: [solved] Struggling to get nvidia (with prime) to work on hybrid gpu

"lspci -k" makes more sense when you grep it "-A3"
From the symptoms and the explaination of actions, I suspect nouveau is loaded and blocks nvidia (also check journal or dmesg)

nb. that gxlinfo just like most of "Xanything" has little relevance in a wayland context and the qtile wayland/todo list suggests that xwayland is still buggy.

Offline

#3 2023-11-13 08:55:41

scippie
Member
Registered: 2019-06-07
Posts: 148

Re: [solved] Struggling to get nvidia (with prime) to work on hybrid gpu

seth wrote:

"lspci -k" makes more sense when you grep it "-A3"
From the symptoms and the explaination of actions, I suspect nouveau is loaded and blocks nvidia (also check journal or dmesg)

That was it! Thanks!

I thought I never installed the nouveau driver but I got confused with the mesa driver which I installed for the Intel gpu.

$ lspci -k | grep VGA -A3

showed that nouveau was in use.
I disabled it in GRUB by adding the kernel parameter

module_blacklist=nouveau

and now the nvidia-prime command does its thing.

Offline

#4 2023-11-13 08:57:06

seth
Member
Registered: 2012-09-03
Posts: 60,080

Re: [solved] Struggling to get nvidia (with prime) to work on hybrid gpu

Offline

#5 2023-11-13 09:00:43

scippie
Member
Registered: 2019-06-07
Posts: 148

Re: [solved] Struggling to get nvidia (with prime) to work on hybrid gpu

Indeed... :shame:

Offline

Board footer

Powered by FluxBB