void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

nvidia driver issues again - hang at loading initial ramdisk

Open sww1235 opened this issue 8 years ago • 7 comments

System

Fresh install of void in a kvm/qemu vm with no more updates showing in xbps-install -Svu. Linux 4.18.9_1

  • package:
    nvidia 390.87

Other system info

  • GTX1060 gfx card passed into the VM
  • Windows 10 vm with identical setup has no issues.

Expected behavior

nvidia driver installs and the system boots

Actual behavior

After installing the nonfree repo and the nvidia package and rebooting, my system freezes after the loading initial ramdisk prompt in grub. I have tried with both nomodeset and not in the grub linux parameters line.

Everything built properly and seemed to work.

Steps to reproduce the behavior

  • install void
  • install void-repo-nonfree
  • install nvidia package
  • reboot system

I had this issue before on 4.17.19_1 and 390.77 but could never figure out a resolution. See #2330

I am happy to do some troubleshooting, etc but I have no idea how to troubleshoot the initramfs if my system doesn't actually boot.

Thank you for your help

sww1235 avatar Sep 23 '18 17:09 sww1235

Let me first say that I have little experience with vm's, and none with kvm/qemu. I do have a few thoughts though. If not already tried, perhaps manually run "nvidia-xconfig" after installing the driver but before rebooting. It would be very helpful to see what is in /var/log/Xorg.0.log. Is this possible?
Also, the nvidia driver in the past has occasionally been confused as to which output is the primary one. This may be solved by adding:

Option "UseDisplayDevice" "your-correct-one"

to Section "Screen" in /etc/X11/xorg.conf. My last idea is a reach, but I can also recall a similar black screen experience years ago with nvidia drivers due to improper allocation of video memory. This was almost certainly a uniquely 32-bit problem, but you might try appending "vmalloc=256M" or similar to the grub kernel line just for fun. Hope this helps.

furryfixer avatar Sep 23 '18 18:09 furryfixer

Actually, doesn't Nvidia's driver refuse to load in KVM environments with consumer cards because they want to force you to buy Quadro cards? I think there was some switch to try to hide KVM's presence in the VM though, can't quite recall how it's called though

Cogitri avatar Sep 25 '18 06:09 Cogitri

@Cogitri I have that switch enabled on both the windows and linux guests. The windows guest works fine, the linux guest hangs. Unless the linux driver is somehow "smarter" than the windows one, then I think it is another issue.

sww1235 avatar Sep 25 '18 18:09 sww1235

Hm, okay. I don't have much of a clue of Nvidia's proprietary driver (other than that it's a pain) as I use AMD exclusively, but maybe you could see if anything is returned when you add rd.debug to your GRUB_CMDLINE_LINUX_DEFAULT?

Cogitri avatar Sep 25 '18 19:09 Cogitri

sorry for leaving this issue open for so long without a response.

in the preceding weeks, I tried several things, all of which didn't work including installing the driver manually and switching to freebsd 😎

After doing a bit more research, I tried just completely disabling nouveau since I was seeing some nvidia driver bitching in dmesg before I rebooted, after I installed the nvidia driver through xbps.

When I did this, I still got the same hang at loading initial ramdisk

since this system is a vm, I was thinking it was an issue with not having any video drivers at all for the 1060, so I removed the pcie passthrough device, and added a spice display through virt-manager. Once the system booted again, it came up just fine using the spice display.

I then reinstalled the nvidia driver and rebooted, making sure the system came back up using the spice channel. I then re-added the pcie passthrough devices and booted again. This time the spice channel booted like normal but the monitor connected to the 1060 had the same behavior as always.

dmesg from right after booting with both spice and nvidia cards attached to vm, with nvida drivers successfully loaded: http://ix.io/1pEL

I am going to try a suggestion I got when I asked on the IRC channel, located here https://gist.github.com/atweiden/701d14375996cf4823d369ef51169580 and try and adapt it to dracut.

sww1235 avatar Oct 21 '18 03:10 sww1235

in order to convert the instructions in the gist over to dracut and void linux, I:

  1. created /etc/modprobe.d/nvidia-drm.conf with the contents:
nvidia
nvidia-modeset
nvidia-uvm
nvidia-drm
options nvidia-drm modeset=1
  1. created /etc/dracut.conf.d/nvidia.conf with the options add_drivers+="nvidia nvidia_modeset nvidia_uvm nvidia_drm"

  2. added nvidia-drm.modeset=1 to the end of the grub linux commandline line in /etc/default/grub.cfg

then regened initramfs using dracut --force

This resulted in large amounts of spam from kmod saying that lines 1-4 in nvidia-drm.conf were bad and it was skipping them.

I then attempted to use modprobe to test loading each module manually after I verified they were all in /lib/modules/4.18.15_1 and it failed. I then ran depmod -a 4.18.15_1 which fixed the issue with modprobe but not with kmod.

sww1235 avatar Oct 21 '18 05:10 sww1235

After looking at this some more, it seems that the modules were loading correctly as seen here, but I was still getting the error from kmod, so I just commented out all the lines in the nvidia-drm.conf file which fixed the error messages and the modules continued to load according to lsmod after a reboot.

however after going through all this, I still am getting no output on the screen driven from the nvidia card after loading initial ramdisk

sww1235 avatar Oct 21 '18 05:10 sww1235