I am trying to install NVIDIA CUDA 8.0 on my Ubuntu 16.04 LTS, even following the Linux Install Guide from NVIDIA I can not get it working.
Here is the details.
I have a laptop Acer Aspire VX, it cames with Windows 10 and I did a dual boot installation of Ubuntu.
The hardware is a Intel Core i5 7300HQ with an NVIDIA GeForce 1050.
The pre-installation actions and their output:
$ lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation Device 1c8d (rev a1)
$ uname -m && cat /etc/*release
x86_64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ uname -r
4.10.0-33-generic
Until here everything was ok. Moreover, I install it following the pass by pass of the guide. I downloaded the file .deb from the NVIDIA site for Linux x86_64 machines.
- $ sudo dpkg -i /home/marlosdamasceno/Downloads/cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb
- $ sudo apt-get update
- $ sudo apt-get install cuda
That was ok as well. Aftet that I installed the Patch 2 (Released Jun 26, 2017). Here are the steps.
- $ sudo dpkg -i /home/marlosdamasceno/Downloads/cuda-repo-ubuntu1604-8-0-local-cublas-performance-update_8.0.61-1_amd64.deb
- $ sudo apt-get update
- $ sudo apt-get upgrade cuda
Everything looks like ok until here. Therefore, I follow the post-installation actions.
$ export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61
$ cuda-install-samples-8.0.sh /home/marlosdamasceno/
Ok, everything looks ok again, however here was the first problem, when I was checking the driver, there was no folder at all of nvidia.
$ cat /proc/driver/nvidia/version
cat: /proc/driver/nvidia/version: No such file or directory
Here is a print of the folder: https: //ibb.co/cWjpTa
The only thing on the folder is a rtc file.
I tryed to keep going and did the make step of the samples.
I got this:
/usr/bin/ld: cannot find -lnvcuvid
collect2: error: ld returned 1 exit status
Makefile:381: recipe for target 'cudaDecodeGL' failed
make[1]: *** [cudaDecodeGL] Error 1
make[1]: Leaving directory '/home/marlosdamasceno/NVIDIA_CUDA-8.0_Samples/3_Imaging/cudaDecodeGL'
Makefile:52: recipe for target '3_Imaging/cudaDecodeGL/Makefile.ph_build' failed
make: *** [3_Imaging/cudaDecodeGL/Makefile.ph_build] Error 2
Moreover, when I ran the deviceQuery, I got this message.
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL
In addition, here are some more commands and outputs to help.
Nothing happens when typing this command.
$ lsmod | grep nvidia
Another command.
$ nvidia-smi
nvidia-smi: command not found
Another command.
$ sudo lshw -c video
*-display
description: 3D controller
product: NVIDIA Corporation
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=nouveau latency=0
resources: irq:318 memory:a3000000-a3ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:4000(size=128)
*-display
description: VGA compatible controller
product: Intel Corporation
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:319 memory:a2000000-a2ffffff memory:b0000000-bfffffff ioport:5000(size=64) memory:c0000-dffff
So here are the questions.
I have Secure Boot enable, it is possible to be that?
The path file from the command export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}} always keep erasing it self. So when I do the command $ nvcc –version, I got the message.
The program 'nvcc' is currently not installed. You can install it by typing: sudo apt install nvidia-cuda-toolkit
How can I set the path and keep it that way?
Am I missing a step?
Thanks in advance for any help!!!
Best Answer
After a lot of effort for a new fella on Ubuntu I got it working!!!
@ubfan1 helped me when he said the command
lshw -c video
the hint I needed to know that I was not running on NVIDIA's driver.After that I tried to install without success (the secure boot was off). I got this error: The system is running in low-graphics mode” (see this question). Therefore, I boot using the command **Alt+Ctrl+F1* and removed all files from NVIDIA using the command below.
With that I could come back to my Desktop, where I could use the System Settings tool from Ubuntu to install the drivers (Software & Updates ->Addtional Drivers->Using NVIDIA binary -version 375.82 from nvidia-375 (open source). See the print:
I reboot the system and everything was installed!!! After that I tested the command ./deviceQuery from the bin inside the samples and the test PASS!
Lesson learned
Before to install CUDA, make sure all drivers of NVIDIA are running OK! You may install them like @ubfan1 suggest in this link.
Execute the following commands to check if the installation is the default and it is running.
Just to check the secure boot you can run.