I tried to compile the example on this page https://devblogs.nvidia.com/even-easier-introduction-cuda/ using the command
$ nvcc add.cu -o add_cuda
but got this error message
nvcc fatal : Path to libdevice library not specified
Based on this post https://devtalk.nvidia.com/default/topic/804501/cuda-setup-and-installation/libdevice-library-not-found-by-nvcc/post/4424877/#4424877, it seemed as though reinstalling would fix the problem, but when I run
$ sudo apt-get --purge remove "*cublas*" "cuda*" $ sudo apt-get --purge remove "*nvidia*"
as specified in https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#removing-cuda-tk-and-driver the packages are not removed and I get the error messages
dpkg: error processing archive /var/cache/apt/archives/nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb (--unpack): trying to overwrite '/usr/include/cublas.h', which is also in package libcublas-dev 10.2.0.168-1 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
I am using Ubuntu 18.04.2 LTS and installed the CUDA toolkit using the deb network installer. I’m guessing I did something stupid, as I’m not very experienced with linux, but I’m hopelessly confused and Google isn’t helping.