NVidia drivers not loading / unloading properly

I need some help with NVidia drivers. I can install drivers just fine, but they won’t work as desired. Prime render offload does not seem to work.

This is what I get when I try to test it:

prime-run glxinfo | grep “OpenGL renderer”
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

I’ve followed Arch wiki and NVidia’s guides. I don’t know where to troubleshoot any more. Seems that I’ve tried everything.

:hugs:

1 Like

@His_Turdness
You need to start from the beginning. inxi -FGz

Edit: also can you post

pacman -Q | grep nvidia
1 Like

@His_Turdness
I don’t know your hardware. I assume it’s Intel & Nvidia. Not sure what you are trying to accomplish but keep in mind that Bumblebee is not compatible with Prime Render from my understanding. Correct me if i’m wrong here. But if it’s prime render you seek then here is some info to help.

inxi -FGz does nothing, no such command.

I’m not using bumblebee. I’ve tried optimus-manager and it sometimes works, but I can’t set it to boot with hybrid mode. I’m guessing that’s because I got vfio modules loading at start. I can disable those, but then my VM won’t start.

pacman -Q | grep nvidia:

lib32-nvidia-utils 440.82-1
nvidia 440.82-21
nvidia-dkms 440.82-2
nvidia-installer 3-1
nvidia-installer-db 2.2-1
nvidia-prime 1.0-3
nvidia-settings 440.82-1
nvidia-utils 440.82-2

I got an i7 8700k with the UHD630 + NVidia GTX 1070 ITX.

Currently nothing in /etc/X11/xorg.conf, because it doesn’t seem to make any difference.

You probably don’t have inxi installed. Anyway i think if you look at the info i have posted the link for you should be able to work through it.

you may need optimus-manager:

1 Like

also if you have nvidia-dkms in use you no need for nvidia installed… if you want to use prime

Ok, I removed “nvidia”. It gave me some erros, but driver got uninstalled.

Preparing...
Checking dependencies...
Removing nvidia (440.82-21)...
Running post-transaction hooks...
Arming ConditionNeedsUpdate...
Updating module dependencies...
Cleaning pacman cache...
==> no candidate packages found for pruning
Update Nvidia module in initcpio
==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'default'
  -> -k /boot/vmlinuz-linux-lts -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-lts.img
==> Starting build: 5.4.46-1-lts
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> ERROR: module not found: `nvidia_modeset'
Error while configuring 
==> ERROR: module not found: `nvidia'
Error while configuring 
==> ERROR: module not found: `nvidia_drm'
Error while configuring 
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-lts.img
==> WARNING: errors were encountered during the build. The image may not be complete.
Error while configuring 
==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'fallback'
  -> -k /boot/vmlinuz-linux-lts -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-lts-fallback.img -S autodetect
==> Starting build: 5.4.46-1-lts
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: wd719x
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> ERROR: module not found: `nvidia_modeset'
Error while configuring 
==> ERROR: module not found: `nvidia'
Error while configuring 
==> ERROR: module not found: `nvidia_drm'
Error while configuring 
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-lts-fallback.img
==> WARNING: errors were encountered during the build. The image may not be complete.
Error while configuring 
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.7.2-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> ERROR: module not found: `nvidia_modeset'
Error while configuring 
==> ERROR: module not found: `nvidia'
Error while configuring 
==> ERROR: module not found: `nvidia_drm'
Error while configuring 
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> WARNING: errors were encountered during the build. The image may not be complete.
Error while configuring 
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 5.7.2-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: wd719x
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> ERROR: module not found: `nvidia_modeset'
Error while configuring 
==> ERROR: module not found: `nvidia'
Error while configuring 
==> ERROR: module not found: `nvidia_drm'
Error while configuring 
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> WARNING: errors were encountered during the build. The image may not be complete.
Error while configuring 
Error: command failed to execute correctly
Transaction successfully finished.


I’ll try to get this to work when I get back home.

and if you want to use lts kernel and main kernel nvidia-dkms will work for both, as it will build modules for all installed kernels.
The other option is to install both nvidia and nvidia-lts plus linux-headers and linux-lts-headers.
So using nvidia-dkms is the more easy solution here.

OK, good to know. I tried to load the nvidia-dkms module, but got a not found error /lib/modules/arch. I’ll try to reinstall the driver later.

the errors before hinting to some issue already, i would reinstall nvidia-dkms package first:
sudo pacman -Syyu
sudo pacman -S nvidia-dkms

and read this:
https://wiki.archlinux.org/index.php/PRIME#PRIME_render_offload

Reinstalled. Took a while, got some errors, but I don’t think they should affect anything.

==> dkms remove nvidia -v 440.82 -k 5.4.46-1-lts
rmdir: failed to remove '': No such file or directory
rmdir: failed to remove '': No such file or directory
rmdir: failed to remove '': No such file or directory
==> dkms remove nvidia -v 440.82 -k 5.7.2-arch1-1
rmdir: failed to remove '': No such file or directory
rmdir: failed to remove '': No such file or directory
rmdir: failed to remove '': No such file or directory
:: Processing package changes...
(1/1) reinstalling nvidia-dkms                                                                                                                    [#########################################################################################] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Install DKMS modules
==> dkms install nvidia/440.82 -k 5.4.46-1-lts
==> dkms install nvidia/440.82 -k 5.7.2-arch1-1
==> Unable to install module nvidia/440.82 for kernel 5.7.2-zen1-1-zen: Missing kernel modules tree.
(3/3) Cleaning pacman cache...
==> no candidate packages found for pruning

does it rebuild modules for nvidia and both kernels?

I tried to load nvidia-dkms again after I unbound my dGPU from VM.

sudo modprobe nvidia-dkms
modprobe: FATAL: Module nvidia-dkms not found in directory /lib/modules/5.7.2-arch1-1

nvidia-drm works though and is loaded.

I’m not understanding why you are doing this?
sudo modprobe nvidia-dkms

Edit:
lsmod | grep nvidia

I was trying to load different drivers. I read somewhere that nvidia-dkms is pretty much useless and shouldn’t be used. I installed nvidia and nvidia-lts. Got prime render offload to work again, if I load the nvidia-drm manually (edit: and restart SDDM)

lsmod | grep nvidia
nvidia              20512768  24
ipmi_msghandler        73728  2 ipmi_devintf,nvidia

And if I run sudo modprobe nvidia-drm

lsmod | grep nvidia
nvidia_drm             53248  1
nvidia_modeset       1118208  1 nvidia_drm
nvidia              20512768  25 nvidia_modeset
ipmi_msghandler        73728  2 ipmi_devintf,nvidia
drm_kms_helper        258048  3 vboxvideo,nvidia_drm,i915
drm                   581632  18 drm_kms_helper,drm_vram_helper,vboxvideo,drm_ttm_helper,nvidia_drm,i915,ttm

For some reason the nvidia-drm does not load after my dGPU is unbound from my a VM.

nvidia-dkms is the package name only, modules will be rebuilded against installed kernels by this and then loaded automatically: what will look like this:

:: Running pre-transaction hooks...
(1/1) Remove DKMS modules
:: Processing package changes...
(1/1) reinstalling nvidia-dkms                                     [------------------------------------] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Install DKMS modules
==> dkms install nvidia/440.82 -k 5.4.46-1-lts
==> dkms install nvidia/440.82 -k 5.7.2-arch1-1

Is there a safe way to uninstall and delete everything related to nvidia? Maybe it would be easier to start from scratch?

will be only removing may existing:
sudo rm /etc/X11/xorg.conf.d/20-nvidia.conf
and then uninstall nvidia packages:
sudo pacman -R lib32-nvidia-utils nvidia nvidia-dkms nvidia-installer nvidia-installer-db nvidia-prime nvidia-settings nvidia-utils

this may give you an error if one or more packages are not installed anymore, but then run again and remove packagename fom the command…

you can also search for all related installed nvidia packages with pacman:
pacman -Qs nvidia