Ubuntu Cuda 10 ERROR

Hi,

I’ve just installed the cuda 10 tool kit from the cuda_10.0.130_410.48_linux.run file from the nvidia website on my ubuntu 18.04.1.LTS dual booted acer aspire laptop with a gtx960m. When I run the test example in the directory: ~/NVIDIA_CUDA-10.0_Samples/5_Simulations/nbody I get the following:

(terminal output)
Run “nbody -benchmark [-numbodies=]” to measure performance.
-fullscreen (run n-body simulation in fullscreen mode)
-fp64 (use double precision floating point values for simulation)
-hostmem (stores simulation data in host memory)
-benchmark (run benchmark to measure performance)
-numbodies= (number of bodies (>= 1) to run in simulation)
-device= (where d=0,1,2… for the CUDA device to use)
-numdevices= (where i=(number of CUDA devices > 0) to use for simulation)
-compare (compares simulation results running once on the default GPU and once on the CPU)
-cpu (run n-body simulation on the CPU)
-tipsy=<file.bin> (load a tipsy model file for simulation)

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

Error: only 0 Devices available, 1 requested. Exiting.
(terminal output end)

It seems like from this that cuda is not finding my GPU. I would really appreciate any help because I want to get started with pytorch soon! Thanks in advance.

PS Maybe relevant info:
To get to the point I have I’ve followed the instructions in the nvida getting started guide. Black listing the nouvea driver got me to the point where the GPU driver could be installed. After this, I noticed the drivers were greyed out in the software and updates application but now I’ve installed the 390 driver (the lastest on the nvidia website) to try and solve this issue and the software and updates application now shows all clickable with the 390 as the one being active. The 410 driver is not seen there but has been installed correctly with the cuda run file. One more strange thing is that nvcc --version only works if I sudo su before it.

What is your output with command nvidia-smi?

It outputs: NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running."

Thanks for your help

Your driver is not properly installed. The problem arises due to dual-boot. From my experiences, to get over this problem (in case if you have not found the solution yet):

1.) Disable Secure boot in BIOS (Esc, F10 or some other key at startup)
2.) Remove all installed Nvidia drivers (with purge)
3.) Install Nvidia driver again.
4.) Reinstall Cuda

Good luck!

I down graded to Ubuntu 16 and did what you suggested above. Works fine now

I also got the same error.

This was the code I used to install:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600

wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb

sudo dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

I used Additional drivers option in software and updates in ubuntu to load nvidia drivers.

First I got the same error [I had already exported paths]. Then I found that it was because I enabled Secure boot.

So I disabled Secure Boot.

Now it works flawless.