Ubuntu 20.04, probem to install nvcc

Hello,I run ubuntu 20.04 on my laptop. It has a mobile GPU :

nl37@nl37-Aspire-VX5-591G:~$ lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)

The last driver is installed :

nl37@nl37-Aspire-VX5-591G:~$ modinfo nvidia
filename: /lib/modules/5.8.0-41-generic/updates/dkms/nvidia.ko
alias: char-major-195-*
version: 460.32.03
[…]

Using sudo apt install nvidia-cuda-toolkit, the 10.2 version is installed. I need the version 11.2 for some IA application. Thereby, I have followed the folllowging procedure:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda-repo-ubuntu2004-11-2-local_11.2.0-460.27.04-1_amd64.debsudo
dpkg -i cuda-repo-ubuntu2004-11-2-local_11.2.0-460.27.04-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-2-local/7fa2af80.pub
sudo apt-get updatesudo apt-get -y install cuda

When I try to run a sample, I have the follwing error:

nl37@nl37-Aspire-VX5-591G:/usr/local/cuda-11.2/samples/3_Imaging/imageDenoising$ sudo make
[sudo] password for nl37:
/usr/local/cuda-11.2/bin/nvcc -ccbin g++ -I…/…/common/inc -m64 --threads 0 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o bmploader.o -c bmploader.cpp
make: /usr/local/cuda-11.2/bin/nvcc: Command not found

Thank you for your help,

Please check if the package is installed:
dpkg -l |grep “cuda-nvcc”

Hello,

To complete my previsous post, at the end of sudo apt-get -y install cuda, I got the following message :>

Errors were encountered while processing:
/tmp/apt-dpkg-install-TgfrVo/00-cuda-cudart-11-2_11.2.72-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/01-cuda-nvrtc-11-2_11.2.67-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/02-libcublas-11-2_11.3.1.68-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/09-cuda-driver-dev-11-2_11.2.72-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/10-cuda-cudart-dev-11-2_11.2.72-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/11-cuda-nvcc-11-2_11.2.67-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/14-cuda-nvrtc-dev-11-2_11.2.67-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/15-libcublas-dev-11-2_11.3.1.68-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/17-cuda-cupti-11-2_11.2.67-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/18-cuda-cupti-dev-11-2_11.2.67-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/22-cuda-nvprof-11-2_11.2.67-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/23-cuda-nvtx-11-2_11.2.67-1_amd64.deb
/tmp/apt-dpkg-install-TgfrVo/31-cuda-nvml-dev-11-2_11.2.67-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

To answer your question, dpkg -l | grep “cuda-nvcc” doesn’t return anything.

Thank you

Seems something is wrong with your package database, try

sudo dpkg ––configure –a
sudo apt autoremove

I got the following message:

nl37@nl37-Aspire-VX5-591G:~$ sudo dpkg ––configure –a
dpkg: error: need an action option

Type dpkg --help for help about installing and uninstalling packages [*];
Use ‘apt’ or ‘aptitude’ for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through ‘less’ or ‘more’ !

Odd message.
Another idea: maybe you ran out of tmpfs space while installing, cuda 11.2 is quite large. please check the available space.

Find below the results:

nl37@nl37-Aspire-VX5-591G:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8100960 0 8100960 0% /dev
tmpfs 1626028 2220 1623808 1% /run
/dev/nvme0n1p2 238798492 72798552 153799904 33% /
tmpfs 8130124 0 8130124 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8130124 0 8130124 0% /sys/fs/cgroup
/dev/loop1 100352 100352 0 100% /snap/core/10583
/dev/loop3 56832 56832 0 100% /snap/core18/1944
/dev/loop2 139008 139008 0 100% /snap/chromium/1466
/dev/loop4 66432 66432 0 100% /snap/gtk-common-themes/1514
/dev/loop7 297600 297600 0 100% /snap/kde-frameworks-5-qt-5-14-core18/4
/dev/loop6 63616 63616 0 100% /snap/gtk-common-themes/1506
/dev/loop5 166784 166784 0 100% /snap/gnome-3-28-1804/145
/dev/loop8 224256 224256 0 100% /snap/gnome-3-34-1804/66
/dev/loop0 9344 9344 0 100% /snap/canonical-livepatch/95
/dev/loop9 435072 435072 0 100% /snap/pycharm-community/226
/dev/loop10 56320 56320 0 100% /snap/core18/1880
/dev/loop11 52352 52352 0 100% /snap/snap-store/518
/dev/loop13 30720 30720 0 100% /snap/snapd/8542
/dev/loop12 177152 177152 0 100% /snap/spotify/43
/dev/loop14 51072 51072 0 100% /snap/snap-store/467
/dev/nvme0n1p1 523248 8168 515080 2% /boot/efi
/dev/loop15 62720 62720 0 100% /snap/wallpaperdownloader/30
/dev/loop16 245376 245376 0 100% /snap/zoom-client/131
/dev/loop17 239488 239488 0 100% /snap/zoom-client/128
/dev/loop18 261760 261760 0 100% /snap/gnome-3-34-1804/36
/dev/loop19 112768 112768 0 100% /snap/xournalpp/42
/dev/loop20 31872 31872 0 100% /snap/snapd/10707
/dev/loop21 20224 20224 0 100% /snap/okular/98
/dev/sda1 976760828 361354528 615406300 37% /mnt/166CCE046CCDDE9D
tmpfs 1626024 88 1625936 1% /run/user/1000

Looks like you have on-disk /tmp and enough space.

Ok and do you have any idea to solve it ? Because I am able to install 10.2 version.
Thank you

Not really, did you uninstall cuda 10 beforehand? IIRC, some libs are installed into system paths. Otherwise, you could try to use the online repo instead of the offline download or try to use the .run installer, skipping driver install.

Yes I uninstalled all cuda components using:

sudo apt-get --purge remove “cublas” “cuda*” “nsight*”

I tried the .run installer, and I also had a error. Maybe the problem is from the kernel version? I know that some people have been coping with the 5.9 version, but I use the 5.8.0…

Thanks for trying!