Problem with prime-run

Hello! I installed video-hybrid-intel-nvidia-prime and I cannot use prime-run to run applications with my nvidia graphic card. xrandr --listproviders also list only one provider.

prime-run glxinfo | grep "OpenGL"

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

xrandr --listproviders

xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x49 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 7 associated providers: 0 name:modesetting

mhwd -li

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
     video-modesetting            2020.01.13                true            PCI
video-hybrid-intel-nvidia-prime            2020.11.30               false            PCI

nvidia-smi

Sun Mar 21 19:44:12 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.56       Driver Version: 460.56       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| 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  Quadro T2000        Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   37C    P0     7W /  N/A |      0MiB /  3914MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

inxi -G

Graphics:
  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel 
  Device-2: NVIDIA TU117GLM [Quadro T2000 Mobile / Max-Q] driver: nvidia 

lsmod |grep nvidia

nvidia_modeset       1232896  0
nvidia_uvm           1175552  0
nvidia              34181120  2 nvidia_uvm,nvidia_modeset
1 Like

For me it shows:

lsmod |grep nvidia
nvidia_drm             65536  2
nvidia_modeset       1232896  3 nvidia_drm
nvidia              34185216  98 nvidia_modeset
drm_kms_helper        282624  2 nvidia_drm,i915
drm                   581632  22 drm_kms_helper,nvidia_drm,i915

Seems like you are either missing some nvidia packages or maybe some configs. Try to uninstall and install it again using mhwd via tty, then reboot.

Did you use mhwd to install the drivers for the first time?

Please post the full output of inxi -G, and furthermore the latest Xorg log file (which is either in /var/log/ or ~/.local/share/xorg/).

inxi -G

Graphics:
  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel 
  Device-2: NVIDIA TU117GLM [Quadro T2000 Mobile / Max-Q] driver: nvidia 
  v: 460.56 
  Device-3: Microdia Integrated_Webcam_HD type: USB driver: uvcvideo 
  Device-4: Sunplus Innovation Aukey-PC-LM1E Camera type: USB 
  driver: snd-usb-audio,uvcvideo 
  Display: x11 server: X.Org 1.20.10 driver: loaded: modesetting 
  resolution: 1: 1080x1920 2: 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) 
  v: 4.6 Mesa 20.3.4 

It seems that I cannot post .txt file, do you need the output of cat Xorg.0.log? (it is very long)

edit : ok I didn’t know about pastebin services. But I am a new account and thus cannot paste link. h t t p : / / ix . io / 2TIE

and thank you for your help :slight_smile:

I did the installation via gui “Hardware Configuration” of KDE, I clicked on Auto Install Proprietary Driver and I think it auto installed video-hybrid.

But yes ok let me try.

Edit : So I uninstalled the driver (sudo mhwd -r pci video-hybrid-intel-nvidia-prime) and successfully reinstalled it (sudo mhwd -i pci video-hybrid-intel-nvidia-prime) then reboot, but it still outputs the same error :

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

And additionally the output of lsmod | grep nvidia is now empty :sweat_smile:

There’s nothing saying “NVIDIA” in the logs, so there might be some misconfiguration. Please post the output of head -n 999 /etc/X11/xorg.conf.d/* /etc/X11/xorg.conf.

head -n 999 /etc/X11/xorg.conf.d/* /etc/X11/xorg.conf

==> /etc/X11/xorg.conf.d/00-keyboard.conf <==
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "ch"
        Option "XkbModel" "pc105"
        Option "XkbVariant" "fr"
EndSection

==> /etc/X11/xorg.conf.d/10-optimus-manager.conf <==
Section "Device"
        Identifier "integrated"
        Driver "modesetting"
        BusID "PCI:0:2:0"
        Option "DRI" "3"
EndSection


==> /etc/X11/xorg.conf.d/30-touchpad.conf <==
Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
EndSection

==> /etc/X11/xorg.conf.d/90-mhwd.conf.bak <==
Section "ServerLayout"
  Identifier "layout"
  Screen 0 "intel"
  Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
  Identifier "intel"
  Driver "modesetting"
  BusID "PCI:0:2:0"
EndSection

Section "Screen"
  Identifier "intel"
  Device "intel"
EndSection

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:1:0:0"
  Option "AllowEmptyInitialConfiguration"
EndSection
head: cannot open '/etc/X11/xorg.conf' for reading: No such file or directory

I don’t have a xorg.conf file in my X11 directory :confused:

cd /etc/X11 && ls -a
.  ..  mhwd.d  xinit  xorg.conf.d

You have optimus-manager? If so, then you need to switch to “hybrid” mode for prime-run to work.

@whitecastle

Looks like optimus-manager has renamed:

/etc/X11/xorg.conf.d/90-mhwd.conf.bak

you use this one:

/etc/X11/xorg.conf.d/10-optimus-manager.conf

10 has a higher priority than 90 and therefore it uses the 10-optimus-manager.conf, but there is no nvidia gpu written, but in 90-mhwd.conf.bak… do you see it?

Ok I see! Yes I didn’t remember I have optimus-manager. And Indeed I cannot switch to hybrid mode directly

optimus-manager --switch hybrid

ERROR: a GPU setup was initiated but Xorg post-start hook did not run.
Log at /var/log/optimus-manager/switch/switch-20210322T094629.log
If your login manager is GDM, make sure to follow those instructions:
https://github.com/Askannz/optimus-manager#important--gnome-and-gdm-users
If your display manager is neither GDM, SDDM nor LightDM, or if you don't use one, read the wiki:
https://github.com/Askannz/optimus-manager/wiki/FAQ,-common-issues,-troubleshooting
Cannot execute command because of previous errors.

Should I remove optimus-manager then? Or modify 10-optimus-manager.conf?

Run prime-offload and try again.

It didn’t work

What’s in /etc/optimus-manager/optimus-manager.conf?

there is no optimus-manager.conf in /etc/optimus-manager/

ls -a /etc/optimus-manager/
.   nvidia-disable.sh  xorg              xsetup-integrated.sh
..  nvidia-enable.sh   xsetup-hybrid.sh  xsetup-nvidia.sh

Do you get any output when you run prime-offload?

prime-offload
[5] INFO: # Xorg post-start hook
[1180] INFO: Running /etc/optimus-manager/xsetup-integrated.sh
[1196] INFO: Writing state {'type': 'done', 'switch_id': '20210322T094629', 'current_mode': 'integrated'}
[1197] INFO: Xorg post-start hook completed successfully.

And when you run optimus-manager --switch hybrid you get the exact same error?

Oh yes I am able to switch now

optimus-manager --switch hybrid
WARNING : no power management option is currently enabled (this is the default since v1.2). Switching between GPUs will work but you will likely experience poor battery life.
Follow instructions at https://github.com/Askannz/optimus-manager/wiki/A-guide--to-power-management-options to enable power management.

You are about to switch GPUs. This will forcibly close all graphical sessions and all your applications WILL CLOSE.
(you can pass the --no-confirm option to disable this warning)
Continue ? (y/N)

So I switched but now the display is like super slow on my external monitor