I installed nvidia-cuda-dev
on ubuntu 16.04 using sudo apt-get install
. But when I try to install caffe, it says make: /usr/lib/bin/nvcc: Command not found
. I guess maybe the nvcc
location is wrong. But I can't find nvcc using sudo find / -name "nvcc"
Ubuntu – Nvcc: Command not find after installed nvidia-cuda-dev on ubuntu 16.04
16.04cudanvidia
Related Solutions
I have exactely the same issue. I am trying to test my working setup with Ubuntu 16.04 and GTX1080 with CUDA 7.5 for parallel computing, and was hoping to easily get this done by using the packages provided in the repos. Unfortunately as noted above they are missing. It is possible to use the runfile install for installing only the samples. See e.g. for an older version:
This works also for 7.5. Simply say "no" when prompted for driver and toolkit installation. You will also need to set the right toolkit libraries. This installs cuda samples into your home by default. However there seem to be an issue with libraries not being found as the package from the repo also puts them into a different location.
However some simple samples like matrixMul compile and run fine.
There might be a simple workaround by adding the right path, but probably installing at least cuda-toolkit together with samples from the runfile should make it work 'out-of-the-box' - have not tried it yet...
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.
sudo apt-get remove --purge nvidia-*
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!
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 1050"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory: 4041 MBytes (4237426688 bytes)
( 5) Multiprocessors, (128) CUDA Cores/MP: 640 CUDA Cores
GPU Max Clock rate: 1493 MHz (1.49 GHz)
Memory Clock rate: 3504 Mhz
Memory Bus Width: 128-bit
L2 Cache Size: 524288 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX 1050
Result = 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.
$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 375.82 Wed Jul 19 21:16:49 PDT 2017
GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
$ sudo lshw -c video
[sudo] password for marlosdamasceno:
*-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=nvidia latency=0
resources: irq:321 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:318 memory:a2000000-a2ffffff memory:b0000000-bfffffff ioport:5000(size=64) memory:c0000-dffff
$ lsmod | grep nvidia
nvidia_uvm 647168 0
nvidia_drm 45056 2
nvidia_modeset 790528 5 nvidia_drm
nvidia 12701696 85 nvidia_modeset,nvidia_uvm
drm_kms_helper 151552 2 i915,nvidia_drm
drm 352256 6 i915,nvidia_drm,drm_kms_helper
$ nvidia-smi
Fri Sep 8 19:47:17 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.82 Driver Version: 375.82 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1050 Off | 0000:01:00.0 Off | N/A |
| N/A 49C P0 N/A / N/A | 536MiB / 4041MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 996 G /usr/lib/xorg/Xorg 271MiB |
| 0 1827 G compiz 177MiB |
| 0 2351 G ...el-token=FDDD25D3486FDA0AB5CD0952493279C6 86MiB |
| 0 14381 G unity-control-center 1MiB |
+-----------------------------------------------------------------------------+
Just to check the secure boot you can run.
$ mokutil --sb-state
SecureBoot enabled
Best Answer
nvcc
is in the packagenvidia-cuda-toolkit
(see this package search).