Nouveau is the open-source graphics driver for NVIDIA graphics cards. When I tried to install a driver downloaded from the NVIDIA website on a computer, the installer complained like this:
The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.
To disable the Nouveau kernel driver:
- Remove the installed NVIDIA drivers:
$ sudo apt-get purge "nvidia*"
$ sudo apt autoremove
- Create a new file named
/etc/modprobe.d/disable-nouveau.conf with the following lines:
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
- Append this line to
options nouveau modeset=0
- Update the boot environment for your kernel:
$ sudo update-initramfs -u
- Now reboot and you should get a low resolution GUI which indicates that Nouveau graphics driver is not being used.
Tried with: Ubuntu 18.04
Reference: How to remove Nouveau kernel driver
I was trying to install a NVIDIA graphics driver on a machine. The installer failed with this error:
ERROR: You appear to be running an X server; please exit X before installing. For further details, please see the section INSTALLING THE NVIDIA DRIVER in the README available on the Linux driver download page at www.nvidia.com
This is a common error when installing the graphics driver on Linux. You just need to exit X before you install the driver.
This can be done on Ubuntu with this command:
$ sudo service lightdm stop
Tried with: Ubuntu 14.04
I was trying to install the latest NVIDIA graphics driver on a machine. When I ran the installer, it would complain like this:
An NVIDIA kernel module nvidia appears to already be loaded in your kernel
I tried to remove the module:
$ sudo modprobe -r nvidia
But, the kernel complained that the module was being used.
I tried to see which process was using this module:
$ lsof /dev/nvidia*
This showed that no process was using the module. This was surprising.
This is what worked for me in the end. I added a
blacklist nvidia line to
/etc/modprobe.d/blacklist.conf and rebooted the machine.
I then invoked the NVIDIA driver installer with the
--uninstall option. Another reboot later, I found that the module was no longer in the kernel.
I was able to install the NVIDIA driver after that.
Tried with: Ubuntu 14.04
Controlling what is updated in Windows Update has gotten harder in Windows 10. Drivers for your hardware are automatically installed when you update Windows now. In earlier Windows, you got a chance to cherry pick the updates and mark some updates to never be done. Those choices are gone now! (You can uninstall an update. That is not a great solution when your driver update has made it impossible for your Windows to boot!)
Automatic driver update is a good feature for almost everyone, except those who have NVIDIA graphics cards. Graphics drivers are notorious for being buggy. You almost never want to get the driver from Windows Update for your NVIDIA graphics card. You should always get it from the NVIDIA website itself.
There is a solution to this: block Windows 10 from installing drivers when it does Windows Update.
To do this, open Control Panel and go to System -> Advanced System Settings -> Hardware -> Device Installation Settings. Here choose to never update drivers through Windows Update.
If you work with lots of devices in Windows, you are sure to run into problems with device drivers. Sometimes, a particular version of a device driver might cause problems and removing it might be the only solution.
Using Device Manager
This is an easy removal method if you have the device and know that its driver is being used when the device is plugged in. For such a case, plug in the device and open Device Manager. Right-click on the device and choose Properties. In the Driver tab, choose Uninstall.
Using Driver Store Explorer
If you do not have the device or plugging it in causes problems, then the Driver Store Explorer (RAPR) can be used to remove the driver as described here.
Tried with: Windows 7 x64
On a computer with a NVIDIA GeForce GTS 250 graphics card running Ubuntu 14.04, I decided to update the installed driver from
nvidia-343. I did this:
$ sudo apt-get install nvidia-343
It installed the driver and then compiled and installed the kernel module. I rebooted the computer. I was able to login in the GUI, but got an empty desktop!
What kind of graphics driver problem allows graphics, but only hides the desktop elements in Unity? No idea. I dug through
/var/syslog, searched for
nvidia and found this:
NVRM: The NVIDIA GeForce GTS 250 GPU installed in this system is
NVRM: supported through the NVIDIA 340.xx Legacy drivers. Please
NVRM: visit http://www.nvidia.com/object/unix.html for more
NVRM: information. The 343.22 NVIDIA driver will ignore
NVRM: this GPU. Continuing probe...
NVRM: ignoring the legacy GPU 0000:03:00.0
So, it turns out that the GTS 250 is no longer supported in the 343 version drivers and later. I removed this driver and reinstalled back 331 driver and got back my desktop.
Windows (Vista and later) manage device drivers in a location called the driver store. This makes it easy to manage both the inbuilt and third-party drivers on the system. When you face some driver problems, you may want to view and manipulate with drivers.
The Driver Store Explorer (RAPR) is an useful tool to view, add or remove drivers from the driver store. I found it useful to fix a recent problem where a newer driver was not being installed over an older one.
I opened RAPR with Administrator privileges, clicked Enumerate to view the list of drivers, found the old offending driver and removed it. I later installed the new driver using its installer.
Tried with: RAPR 0.5 and Windows 7 x64
The Ubuntu repositories now host CUDA packages. These may not be latest and greatest, but I find them to work well with the NVIDIA drivers from the same place. Also, they are very easy to install compared to the packages from the NVIDIA website.
- First, install the latest NVIDIA driver available from the repositories. NVIDIA driver package is named as
xyz is the version. Pick the largest number version that is available from the repositories. For example:
$ sudo apt install nvidia-331
The installation process compiles the driver for your particular Linux kernel and deploys that module. Restart the computer once the install is done.
You must be able to see a NVIDIA module when you list the kernel modules. For example, on my computer:
$ dkms status
nvidia-331, 331.38, 3.13.0-24-generic, x86_64: installed
- Now you are ready to install CUDA. This is really easy since installing the package
nvidia-cuda-toolkit will pull in all the hundred other CUDA packages and tools that are needed:
$ sudo apt install nvidia-cuda-toolkit
That is it, enjoy your CUDA programming! 🙂
Tried with: Linux kernel 3.13.0-24-generic, CUDA 5.5, NVIDIA driver 331, NVIDIA GTX Titan and Ubuntu 14.04
These steps helped me to successfully install CUDA 5.0 on many Ubuntu 12.04 LTS computers, including headless servers that do not run X windows.
- Make sure the computer has a NVIDIA graphics card that is recognized by Linux. This can be done as shown here.
Uninstall all NVIDIA drivers and kernel modules. Steps to do this are described here.
Download CUDA 5.0 installer for Linux. There is no installer for Ubuntu 12.04 LTS, so download the installer for Ubuntu 11.10 instead.
Make the installer executable and run it as sudo. When asked to install the NVIDIA driver, choose Yes. This is important, allow the installer to install its own drivers. Let it install CUDA to the default location:
If the computer is a headless Ubuntu server which is not connected to a display or does not run X, then device files for your card are not created by default. So, create a shell script file (say
/home/joe/NvidiaDevCreator.sh) with the following code:
Add the line
/etc/rc.local and restart the system. This ensures that the necessary dev files are created on every startup for access by CUDA programs.
- Add the following to your bashrc:
This ensures that the CUDA libraries are available for dynamic loading by CUDA programs.
That is all! Any user on your Ubuntu 12.04 system should now be able to compile and run CUDA 5.0 programs without any special access permissions or privileges 🙂
Note: I had problems when I used the nvidia-current and nvidia-current-updates drivers from Ubuntu. Only by uninstalling them and using the drivers that ship with the CUDA installer was I able to get CUDA working.
Tried with: NVIDIA GeForce 9900 GT and NVIDIA GTX 690