home projects speaker

Fix for "Failed to load the NVIDIA kernel module" on Ubuntu

Note

Please note that this is an archived post, so links, code and the communicated message might be outdated. YMMV

I struggled with my NVIDIA drivers after a kernel update, and no matter what I tried; I edited my xorg.conf, reinstalled drivers from source or with apt-get, nothing worked, until I found a great solution to this error (you can maybe fix this with similar errors):

"(EE) NVIDIA(0): Failed to load the NVIDIA kernel module!"

So, the fix:

First, go here: http://www.nvidia.com/Download/index.aspx?lang=en-us to get the latest NVIDIA drivers. Install them as root after you've reset x (ctrl+alt+backspace). Then reboot.

Then remove the xorg.conf that the NVIDIA install created and start X with default options.

Edit /etc/modprobe.d/lrm-video with a text editor and put a # in front of the line containing something like

install nvidia /sbin/lrm-video nvidia $CMDLINE_OPTS

There might be one or more lines like that, so it could look like this:

# Make nvidia/nvidia_legacy and fglrx use /sbin/lrm-video to load
install fglrx /sbin/lrm-video fglrx $CMDLINE_OPTS
#install nvidia /sbin/lrm-video nvidia $CMDLINE_OPTS
#install nvidia_legacy /sbin/lrm-video nvidia_legacy $CMDLINE_OPTS
#install nvidia_new /sbin/lrm-video nvidia_new $CMDLINE_OPTS'

Add the line:

nvidia

to /etc/modules file. This file contains the list of kernel modules that should be always loaded when your machine boots. After you've done this, run:

sudo nvidia-xconfig

to make a new xorg.conf and restart X. Good luck!


About the author

Hi! My name is Alexander, and I am a creative frontender, specializing in UX, accessibility, universal design, frontend-architecture, node and design systems. I am passionate with open source projects and love to dabble with new emerging technologies related to frontend. With over 26 years of frontend experience, I have earned the right to be called a veteran. I am a lover of life, technologist at heart. If I am not coding, I am cooking and I love whisky and cigars. Oh, and coffee, I LOVE coffee!

If you want to know more about me, here is some links you might want to check out: GitHub, Instagram, Twitter, LinkedIn, CodePen, Slides.com, npm,

Speaker

I am also an avid speaker on several topics! Check out some of the things I speak about, and contact me if you are interested in having me at your next event!