I installed CUDA for my NVIDIA graphics card about a month ago, on a clean install of Ubuntu 16.04. I used the most recent runfile for the installation, and as far as I can tell followed the instructions to the letter, with the exception that the modifications to PATH and LD_LIBRARY_PATH given in the instructions are incorrect. The installation was successful, and even managed to run without interfering with X - my machine has an Intel graphics card as well, which was used for display.

This morning, CUDA programs stopped working, and nvidia-smi reported that it couldn't communicate with the graphics card because it was inactive. I fixed that by putting the display on the NVIDIA graphics card, with the obvious result - the screen can't update while a CUDA kernel is running. Now, when I switch the display back to the Intel graphics card, I get a new error: nvidia-smi reports:

NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please
make sure that the NVIDIA Display Driver is properly installed and present in
your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.

The directory containing libnvidia-ml.so is on the system PATH. This error, I should emphasize, disappears when the NVIDIA card is set as my main display card.

Whenever I run a CUDA program of any sort with the Intel set as display, I get error 35: "CUDA driver version is insufficient for CUDA runtime version." This seems impossible - "cat /proc/driver/nvidia/version" yields driver version 375.39, and as I understand it this is compatible with CUDA 8.


LD_PRELOAD=/usr/lib/nvidia-375/libnvidia-ml.so nvidia-smi

fixes the first error, but not the second.

I'm reluctant to reinstall CUDA without knowing what went wrong here - I'd rather not have to deal with this once a month. Any suggestions?

Update: When I begin with X running on the NVIDIA card and perform the following sequence of commands (after loading the CUDA .deb package):

sudo apt-get purge nvidia-*
sudo apt-get install nvidia-375
sudo apt-get install cuda

it works. But I think this is because I somehow fooled the NVIDIA card into thinking it's running X, without actually running X; when I reboot, the problem resurfaces (if I run X on the NVIDIA card, everything's fine but I can't run CUDA programs without freezing the screen; if I run X on the Intel card, no CUDA functionality works).


Ubuntu 16.04, cuda-8.0, and Nvidia 375 work just fine togehter, but there are lot of confusing older directions out there. Start with the Intel site, Intel Ubuntu installation , and use the deb file as the most system specific installation method. The default compilers, gcc5, are fine for 16.04.

First, get the Ubuntu Nvidia drivers set up before you start with any cuda installs. Enable the Canonical Partners under the software updater, Settings button/ Other Software. And the Proprietary Drivers under Ubuntu Software tab. Update the package index, and then under the Additional Drivers, install the Nvidia video driver (tested). Skip any offer of Nvidia drivers from the cuda package.

Download the Intel cuda 8.0 deb package, and use dpkg -i to install it. Note the location of the cuda-8.0 directory, you will use that to modify your PATH and LD_LIBRARY_PATH, adding /bin for the PATH and /lib64 for the libraries. Copy the samples directory from the cuda-8.0 location to some place writeable by you, so you can build things in it. Use apt-get to install the cuda and cuda-toolkit-8-0, they will bring in many other cuda packages. That's it, the makefiles in the sample directories should run (unless a specific sample needs additional libraries, nbody does not, so try that one first).

Now the Nvidia drivers are in flux, I had installed the 367 and got updated to the 375. I had no issues with that, but did find a 367 wired into the cuda samples, so careful if you try to clean up the old directories. The Nvidia libraries are in the normal /usr/lib/nvidia-375 locations, so no path mods needed for them.

Take a look at nvidia site's question like yours and solved problem like yours . Depends upon hardware.

  • Thanks for the detailed steps, but this didn't actually improve the situation. I uninstalled CUDA and followed your instructions, and I'm left with the same problem - it works fine as long as the NVIDIA GPU is the one being used for X, but not if I put X on the Intel GPU. – Reese May 26 '17 at 17:33

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.