92

When installing CUDA in Ubuntu 16.04 by executing cuda_8.0.44_linux.run,

I got the following error message in /var/log/nvidia-installer.log

enter image description here

Then I checked /etc/modprobe.d/nvidia-installer-disable-nouveau.conf and got

enter image description here

Any suggestion to disable Nouveau Kernel Driver?

I found this 2012 discussion but didn't work for me.

willSapgreen
  • 1,053

3 Answers3

130

According to the NVIDIA developer zone: Create a file:

sudo nano /etc/modprobe.d/blacklist-nouveau.conf

With the following contents:

blacklist nouveau
options nouveau modeset=0

Regenerate the kernel initramfs:

sudo update-initramfs -u

Finally, reboot:

sudo reboot

Read more at: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ixzz4rQODN0jy

Eliah Kagan
  • 119,640
Boern
  • 1,415
36

maybe it is too late ,but hope can help for others. the follow tips worked for ubuntu 16.04 and elementary os 0.4.

  1. remove all nvidia packages ,skip this if your system is fresh installed

    sudo apt-get remove nvidia* && sudo apt autoremove
    
  2. install some packages for build kernel:

    sudo apt-get install dkms build-essential linux-headers-generic
    
  3. now block and disable nouveau kernel driver:

    sudo vim /etc/modprobe.d/blacklist.conf
    

Insert follow lines to the blacklist.conf:

blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

save and exit.

  1. Disable the Kernel nouveau by typing the following commands(nouveau-kms.conf may not exist,it is ok):

    echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
    
  2. build the new kernel by:

    sudo update-initramfs -u
    
  3. reboot

George Udosen
  • 37,534
3

Unlike the other answers, I assert that the blacklist keyword will not actually blacklist the driver.

Let me explain what that keyword actually does. blacklist does not blacklist the driver at all. The most it can do is offer a gentle suggestion. What you are writing is not a rule, but rather a guideline for one small portion of the boot process. Ubuntu can decide to break your blacklist guidelines at any time. You can clearly see that blacklist nouveau does not actually what it claims to do, because you can still do modprobe nouveau with the guideline in place. Don't offer any options to nouveau for any ifs and buts, if nouveau is blocked like you want, it won't even get to see its options.

What you actually need is the install [module] /bin/false line:

  1. echo 'install nouveau /bin/false' | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
  2. sudo update-initramfs -u
  3. reboot
  4. sudo modprobe nouveau - Yes, please actually try this. You will instantly see the night and day difference that install nouveau /bin/false makes compared to the useless blacklist nouveau.
Daniel T
  • 5,339