CUDA installation problems: can't get right drivers for K40c?

I’ve been trying to install CUDA for a compute-only K40c. I tried both the runfile and .deb installations on the Nvidia guide. Both complete the installation process, but don’t seem to produce working installs.

For the most recent .deb installation, I used the Nvidia installation guide. However, “nvidia-smi” still gives “command not found” after installing. Additionally, trying to run the samples gives “CUDA driver version is insufficient for CUDA runtime version”.

Am I missing something in my process?

OK, I think it’s fixed. I did a fresh install and decided to try using CUDA 9.0 instead, as the Nvidia drivers for 9.1 didn’t seem to support the K40c.

I tried the runfile first, and it failed with an error “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.”

Tried again with the package manager .deb install (local) installation, following the install guide and https://askubuntu.com/questions/799184/how-can-i-install-cuda-on-ubuntu-16-04 as well. It appears to work, and nvidia-smi now detects the K40c.

The samples also compile, and deviceQuery works.

The answer to the questions: maybe. The mixing of the two installation methods is usually a recipe for trouble, at times major trouble. Use one method consistently, otherwise you may be in for a major cleanup effort to get things going again.

My standing recommendation is to always use the runfile method. I have installed drivers on Linux systems a couple of hundred times, and this method is extremely robust. Obviously, this is one person’s experience, I haven’t tried all Linux versions, etc, etc.