I have a server (running Debian 9 Stretch) with proprietary Nvidia driver installed. It is for scientific computation so headless.

So, the Nvidia driver is installed for using CUDA (during CUDA installation with a package file cuda_10.0.130_410.48_linux.run downloaded from Nvidia website). It used to work well.

Two days ago, I rebooted the system to enter into the BIOS to disable HyperThreading. After rebooting, the Nvidia driver was not loading. I rebooted the system several times and it was the same.

How can I bring it back?

Here is some information for your reference.

# lspci -v|grep VGA
05:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6G
B] (rev a1) (prog-if 00 [VGA controller])

# nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ma
ke sure that the latest NVIDIA driver is installed and running.

# modprobe nvidia
modprobe: FATAL: Module nvidia not found in directory /lib/modules/4.9.0-9-amd64

# nvidia-settings

ERROR: libgtk-3.so.0: cannot open shared object file: No such file or directory
       libnvidia-gtk3.so: cannot open shared object file: No such file or
       libgtk-x11-2.0.so.0: cannot open shared object file: No such file or
       libnvidia-gtk2.so: cannot open shared object file: No such file or

ERROR: A problem occured when loading the GUI library. Please check your
       installation and library path. You may need to specify this library when
       calling nvidia-settings. Please run `nvidia-settings --help` for usage
  • Hello. Without any GUI, what functions do you expect from this driver? – Vincent Achard Jul 17 '19 at 11:55
  • CUDA requires the installation of the driver. My program compiled with CUDA failed to run now (previously works well). – michael morgan Jul 17 '19 at 19:06
  • @VincentAchard CUDA ToolKit requires the proprietary driver. However, it is not a good idea to install it with the script Nvidia provides on its website. – Paradox Aug 6 '19 at 4:17

It is exactly for this kind of case that you should not install the Nvidia proprietary driver from the script provided on their website. You have created a FrankenDebian and you broke it.

The easiest and safest way to install the necessary packages and make use of CUDA capabilities of your GPU on Debian is to use the proprietary driver and the Nvidia toolkit that are in the official contrib and non-free repositories.

This seems a big drawback because you do not get the latest and up-to-date version (but you can mitigate that by using the backports repository), but it does really makes sense when it comes to CUDA, especially on a headless server.

Therefore, in order to bring back your server up and running (not to mention more reliable), I would strongly suggest to uninstall the previous driver installed from Nvidia website and install the Nvidia driver and CUDA toolkit packaged by the Debian community.

1) Uninstall previous driver, CUDA and others linked Nvidia packages:

# apt purge nvidia-*

2) Add contrib and non-free Debian repository in your /etc/apt/sources.list (if it is not already done), which should look like this:

deb http://deb.debian.org/debian stretch main contrib non-free deb-src 
http://deb.debian.org/debian stretch main contrib non-free

deb http://deb.debian.org/debian-security/ stretch/updates main contrib non-free  
deb-src http://deb.debian.org/debian-security/ strech/updates main contrib non-free

deb http://deb.debian.org/debian stretch-updates main contrib non-free 
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free

If you want the backports repository, add these as well after the rest:

deb http://deb.debian.org/debian stretch-backports main contrib non-free
deb-src http://deb.debian.org/debian stretch-backports main contrib non-free

3) Update apt cache:

# apt update

4) Install Nvidia proprietary driver (along with the kernel headers):

# apt install linux-headers-$(uname -r|sed 's/[^-]*-[^-]*-//') nvidia-driver

If you want to have a more up-to-date version and use the one in the backports repository (currently, 375.66 and 390.48 versions respectively), use this command instead of the previous one:

# apt-get install -t stretch-backports nvidia-driver

5) Install the CUDA toolkit:

# apt-get install nvidia-cuda-dev nvidia-cuda-toolkit

Please, note that CUDA 8 only supports gcc 5.3.1, which is not available for stretch. To compile you need to add -ccbin clang-3.8 to the nvcc command line.

If you want to use CUDA 9, you can use the version in the backports repository, the same way I did before for installing the nvidia-driver from it:

# apt-get install -t stretch-backports nvidia-cuda-dev nvidia-cuda-toolkit

You might want to take a look a the changelogs to see what improvements you could have when using the packages (either for the driver or the CUDA toolkit) from backports.

6) Reboot your machine

At this point, everything should be working well, like before without any noticeable performance hit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.