How To: Fix X.org Black Screen with Nvidia drivers and Linux Kernel 3.10+

I’m running Arch Linux with a Nvidia graphics card, and after doing a system update back in March 2014 any kernel past 3.10.x would cause X / Xorg to fail to start; instead there’d be a black screen and the fans on the graphics card would spin up to full speed so my machine sounded like a hovercraft. I initially got around this by running the linux-lts (Long Term Support) kernel, until that too exhibited the exact same issue and I was forced to boot the system from USB, chroot into it and switch out the nvidia driver for nouveau (the open-open source, 2D accelerated nvidia driver).

However, as I happen to quite like accelerated 3D graphics and occasionally playing games, I’ve been digging around for a fix for this for ages – and it turns out that the fix (which is now added to the Arch Nvidia wiki page) is to add the following kernel parameter to your bootloader’s kernel line:

rcutree.rcu_idle_gp_delay=1

If you’re using GRUB, when menu shows up just move the selection to Arch or your Linux distro exhibiting the issue, then hit the e key to edit the line, and change the linux kernel loading line from, for example:

linux /boot/vmlinuz-linux root=/dev/sda8 rw

To include the rcutree kernel parameter, something like this:

linux /boot/vmlinuz-linux root=/dev/sda8 rw rcutree.rcu_idle_gp_delay=1

At which point you can hit F10 (again, assuming you’re using GRUB) to boot using your newly added kernel parameters. Don’t worry if your kernel loading line identifies your partition by UUID value instead of plain ‘ol /dev/sdx – that’s fine and mine does too (I changed it to /dev/blah to make the line shorter) – just add the parameter and try your luck – hopefully your distro will now boot into X without issue, and you can stop swearing and cursing like a drunken sailor. Or perhaps that was just me.

Further reading about the issue on the nvidia development website: https://devtalk.nvidia.com/default/topic/567297/linux/linux-3-10-driver-crash/4/.

Cheers!

P.S. If you need to chroot into your Arch system to change the drivers also, then here’s a quick run-down of the process. Make a bootable USB from the Arch ISO (I could only get this to work by using the dd command from another Linux distro – Rufus and UNetBootin would make a USB I couldn’t boot from – google or search this site for “dd iso usb” for instructions), then, when you’ve booted into the live USB/CD-ROM or what-not, run the following commands (the “<---- optional" lines are optional, don't actually enter that into your files, obviously!):

# Create a directory that we'll mount our Arch / partition to
mkdir /mnt/arch
 
# Mount the directory and chroot into it!
mount /dev/sdaX /mnt/arch       <--- replace X with the partition containing your Arch / partition, mine's /dev/sda8 - but yours likely isn't!
arch-chroot /mnt/arch
 
#Now do all your pacman stuff, for example:
#To go from nouveau to nvidia you might use (don't include the lib32 things if you're not using them! I use them for Steam):
#pacman -Rdds nouveau-dri xf86-video-nouveau mesa-libgl lib32-nouveau-dri lib32-mesa-libgl
#pacman -S nvidia nvidia-libgl nvidia-utils lib32-nvidia-libgl
#
#Or, to go from nvidia to nouveau you might use:
#pacman -Rdds nvidia nvidia-libgl nvidia-utils lib32-nvidia-libgl
#pacman -S nouveau-dri xf86-video-nouveau lib32-nouveau-dri
 
# Also, if you're going TO nouveau then you should create the file /etc/X11/xorg.conf.d/20-nouveau.conf with contents:
#Section "Device"
#	Identifier "nvidia card"
#	Driver "nouveau"
#	Option "GLXVBlank" "true"           <---- optional
#EndSection
#
# And if you're going TO nvidia then you should create the file /etc/X11/xorg.conf.d/20-nvidia.conf with the contents:
#Section "Device"
#        Identifier "Nvidia Card"
#        Driver "nvidia"
#        VendorName "NVIDIA Corporation"
#        Option "NoLogo" "true"            <---- optional
#EndSection
 
# Regardless of which of the above files you create, get rid of /etc/X11/xorg.conf - we should use the xorg.conf.d files now!
 
# Just to be safe, make sure you aren't blacklisting any modules by checking for files in /etc/modprobe.d/ which contain "blacklist nouveau" or "blacklist nvidia"
 
# If you want to make sure /boot/grub/grub.cfg contains the rcutree kernel parameter we've been discussing, now's the time to do it...
 
# Finally, exit the chrooted environment and reboot
exit
systemctl reboot

With any luck you’ll have now transitioned the drivers successfully and have a fully working system – fingers crossed, good luck!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.