Install Nvidia driver instead of nouveau

2,088

Solution 1

Ubuntu 14.04 and beyond

Please note that nouveau drivers manual removal is required only if you are going to install the proprietary nvidia drivers yourself. If this is not the case then directly install the required graphic drivers from System > Administration > Hardware drivers. It's the recommended and the most convenient way available.

We'll blacklist all the culprit modules, remove all the nvidia* packages and as an extra step we may have to update the initramfs disk because it could be configured to load the modules at startup.

  1. Blacklist the modules. Open the blacklist.conf file.

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

    press i to enter insert mode and add the following modules in the file.

    # this one might not be required for x86 32 bit users.
    blacklist amd76x_edac 
    
    blacklist vga16fb
    blacklist nouveau
    blacklist rivafb
    blacklist nvidiafb
    blacklist rivatv
    

    Save the file and exit.

  2. Remove all the nvidia* packages

    sudo apt-get remove --purge nvidia-*
    
  3. Once you are done with the steps above, reboot, stop the display manager and try to install nvidia drivers.

    Press Ctrl+Alt+F1. Once you are in the text mode, stop the display manager. This will forcibly terminate all running applications, so you better save anything you're working on and close them yourself before completing this step. To stop the display manager, run one of these commands depending on your display manager (lightdm is default in vanilla Ubuntu, but older versions or systems with GNOME desktop may use gdm and on KDE/Kubuntu/Plasma it should be kdm:

Edit: To determine what the default display manager your Ubuntu system is using, issue the command cat /etc/X11/default-display-manager While this doesn't guarantee you anything, in many cases it will be the correct choice.

    sudo service lightdm stop

    sudo /etc/init.d/gdm stop

Now, run the driver package that you downloaded from Nvidia’s website. Edit: Replace the filename in the example below with the one you actually have.

    sudo ./NVIDIA-Linux-x86-260.19.44.run

Note: If you still get the error related to nouveau drivers then you are probably required to update the initramfs, which might be configured to load the nouveau drivers. Don't reboot or poweroff, run this command to update the initramfs disk.

sudo update-initramfs -u

Now reboot and repeat step 3. This time things should go smoothly.

Solution 2

Manual removal of nouveau is not required anymore. If you install nvidia drivers from Additional Drivers on Ubuntu, the installation scripts will make sure that nouveau is blacklisted.

However, before you do anything you have to add graphics repo for nvidia drivers:

sudo apt-add-repository ppa:graphics-drivers/ppa
sudo apt-get update

I suggest you have a look at nvidia website for the drivers your card supports and install those from the Additional Drivers tool on Ubuntu.

Solution 3

16.04 How To

Insert

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

into

etc/modprobe.d/blacklist.conf

and reboot, before installing the NVidia driver. Worked for me on Ubuntu 16.04 LTS.

Solution 4

Blacklisting nouveau as mentioned in Nvidia's documentation doesn't work. We don't need to blacklist it. Just install the Nvidia drivers using apt. You just need to login to tty by pressing Ctrl+Alt+F1 and stop the lightdm service, and then type:

sudo apt-add-repository ppa:graphics-drivers/ppa 
sudo apt install nvidia-384  # or whatever version compatible with your GPU

Then restart.

Solution 5

Xubuntu 20.04.1 (Desktop, obviously)

Note for the impatient -- skip to the end. But you should probably read the other answers (and the README from NVidia) if you decide to actually install the NVidia code directly.

Identify my card.

root@...:/lib/modules/5.4.0-62-generic# dmesg | grep -i nvidia
[   10.448241] nouveau 0000:01:00.0: NVIDIA GK208B (b06070b1)
[   12.059748] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input16
[   12.059815] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input17
[   12.059874] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input18
[   12.059936] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input19
[   12.059993] input: HDA NVidia HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input20

Just double-checking (this is the piece of information I need to continue).

root@...:/lib/modules/5.4.0-62-generic# lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GK208B [GeForce GT 730] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK208 HDMI/DP Audio Controller (rev a1)

Go to this page for NVidia Drivers https://www.nvidia.com/en-us/geforce/drivers/

Then selected parameters to include above card...

results (chose the most recent of several) https://www.nvidia.com/en-us/drivers/results/168347/ Don't use this page. Just included for reference.

Downloaded the driver package I wanted.

Check the Additional Information on the website (at the bottom of the page of package details). There is a handy link to the README, which is worth reviewing.

Additional Information

Known issue:

Vulkan with flipping enabled on Quadro cards can lead to graphic corruption. If you think you have run into it you can do either of the following as a workaround:

  • Disable flipping in nvidia-settings (uncheck "Allow Flipping" in the "OpenGL Settings" panel)
  • Disable UBB (run 'nvidia-xconfig --no-ubb')
  • Use a composited desktop

Note that many Linux distributions provide their own packages of the NVIDIA Linux Graphics Driver in the distribution's native package management format. This may interact better with the rest of your distribution's framework, and you may want to use this rather than NVIDIA's official package.

Also note that SuSE users should read the SuSE NVIDIA Installer HOWTO before downloading the driver.

[NOT INCLUDED in the quoted section] 
must first stop the Xserver 
-- for xubuntu 20.04,
log off your session
switch to tty1 (ctrl+alt+f1)
log on as root
systemctl stop lightdm
systemctl status lightdm 
[back to instuctions]

Installation instructions: Once you have downloaded the driver, change to the directory containing the driver package and install the driver by running, as root, sh ./NVIDIA-Linux-x86_64-460.32.03.run

One of the last installation steps will offer to update your X configuration file. Either accept that offer, edit your X configuration file manually so that the NVIDIA X driver will be used, or run nvidia-xconfig

Note that the list of supported GPU products is provided to indicate which GPUs are supported by a particular driver version. Some designs incorporating supported GPUs may not be compatible with the NVIDIA Linux driver: in particular, notebook and all-in-one desktop designs with switchable (hybrid) or Optimus graphics will not work if means to disable the integrated graphics in hardware are not available. Hardware designs will vary from manufacturer to manufacturer, so please consult with a system's manufacturer to determine whether that particular system is compatible.

See the README for more detailed instructions.

For further information please visit our forum, https://forums.developer.nvidia.com/c/gpu-unix-graphics/linux/148.

Note for the impatient: When I had launched the installation, it reminded me that there might be better-integrated drivers available in: software & updates --> Additional Drivers

Lo and behold - there was, and the metapackage had the same major release number as the one I had just downloaded (460.32). (see screen shot at the end).

So, I installed the most recent one, and after a day, I have not been bothered by all the weird video and xserver hangs that had been plaguing me multiple times per day.

Kudos to nvidia and ubuntu for keeping the drivers so wonderfully up to date.

Screen Shot of NVidia Additional Drivers

Share:
2,088

Related videos on Youtube

Alomoni
Author by

Alomoni

Updated on September 18, 2022

Comments

  • Alomoni
    Alomoni over 1 year

    I am new to AngularJS. How do I apply the ng-class to the alternating row in ui-grid with gridOptions?

    It is kind of like with

    ng-repeat (ng-class="$odd ? 'odd' : 'even')
    
  • tomasb
    tomasb about 8 years
    Thank for his recipe. Worked for me in Ubuntu 14.04, just 2 notes: to stop X needed sudo service lightdm stop (instead of /etc/init.d/gdm stop) and needed one more reboot after update-initramfs.
  • Elder Geek
    Elder Geek about 8 years
    @tomasb good point on the lightdm - updated answer
  • jokerdino
    jokerdino almost 8 years
    Hey, that link needs some updating.
  • Manuel J. Diaz
    Manuel J. Diaz over 7 years
    This worked to pass by the nouveau driverd on Ubuntu 16.04.
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 7 years
    Its good to have 16.04 instructions because the questions and answers are about 14.04. Can you put '16.04 How To" at the beginning in Heading format? +1
  • Oscar Reyes
    Oscar Reyes over 7 years
    This worked very nice on Ubuntu 16.10, great answer
  • gerardw
    gerardw almost 7 years
    On xubuntu at least, you don't have to reboot to remove the noveau driver. After stopping the display manager modprobe -r nouveau unloads the noveau driver from the kernel.
  • Elder Geek
    Elder Geek over 6 years
    @Zanna thanks for the edit. Your efforts are (as always) appreciated.
  • MuntingInsekto
    MuntingInsekto over 6 years
    Now I am stuck with single screen working. The other screen is not detected :(
  • Elder Geek
    Elder Geek over 6 years
    @vnpnlz You may find that this answer relates to your current situation. Cheers!
  • jchook
    jchook over 6 years
    This worked for me on 16.04 but I had to run sudo update-initramfs -u before rebooting and attempting the .run file installation again. I had to do it this way because Ubuntu broke their apt package.
  • saurabheights
    saurabheights about 6 years
    How do you install cuda after this?
  • Monku
    Monku about 6 years
  • CAK2
    CAK2 almost 6 years
    The following alternative also works: :nth-child(2n).ui-grid-row .ui-grid-cell-contents { background-color: #f3f3f3; }
  • Patrick J. S.
    Patrick J. S. about 5 years
    This is true as long as the ppa just works™ (right now there seems to be an issue with my kernel version and the dkms from the ppa that is fixed in the newest driver from nvidia directly).