Missing folders in cuda 10.1

Good afternoon,

I would like to install CUDA to use for TensorFlow and other deep learning frameworks, and therefore I followed the instructions given on NVIDIA’s website:
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

However, I encountered a problem: I cannot find the folder bin and lib64 in /usr/local/cuda-10.1
I will then detail the procedure that I followed to ensure that I did not do something wrong.
Thank you by advance!

I could verify the different prerequistes:
CUDA-capable GPU

$ lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev a1)

Supported version of Linux

$ uname -m && cat /etc/*release
x86_64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"

GCC version

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609

Kernel version

$ uname -r
4.15.0-47-generic

Following the tutorial, I would run:

sudo apt-get install linux-headers-$(uname -r)

to get the kernel & dev packages

I would also follow the installation using debian packages with network installation.
I verified the checksum at https://developer.download.nvidia.com/compute/cuda/10.1/Prod/docs/sidebar/md5sum.txt for the version 10.1

I followed the instructions given without problem:

$ sudo dpkg -i cuda-repo-ubuntu1604_10.1.105-1_amd64.deb
$ sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
$ sudo apt-get update

But after running

$ sudo apt-get install cuda

I got the following:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 nvidia-cuda-toolkit : Depends: nvidia-cuda-dev (= 7.5.18-0ubuntu1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I could not find the file nvidia-uninstall in /usr/bin/, as well as uninstall_cuda_10.1.pl in /usr/local/cuda-10.1/bin/. Therefore, it let think that there is no conflicting with previous installations.

I did then what was adviced to get the dependencies:

$ sudo apt-get -f install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cuda-10-1 cuda-command-line-tools-10-1 cuda-compiler-10-1 cuda-cudart-10-1
  cuda-cudart-dev-10-1 cuda-cufft-10-1 cuda-cufft-dev-10-1 cuda-cuobjdump-10-1
  cuda-cupti-10-1 cuda-curand-10-1 cuda-curand-dev-10-1 cuda-cusolver-10-1
  cuda-cusolver-dev-10-1 cuda-cusparse-10-1 cuda-cusparse-dev-10-1
  cuda-demo-suite-10-1 cuda-documentation-10-1 cuda-driver-dev-10-1
  cuda-drivers cuda-gdb-10-1 cuda-gpu-library-advisor-10-1 cuda-libraries-10-1
  cuda-libraries-dev-10-1 cuda-license-10-1 cuda-memcheck-10-1
  cuda-misc-headers-10-1 cuda-npp-10-1 cuda-npp-dev-10-1 cuda-nsight-10-1
  cuda-nsight-compute-10-1 cuda-nsight-systems-10-1 cuda-nvcc-10-1
  cuda-nvdisasm-10-1 cuda-nvgraph-10-1 cuda-nvgraph-dev-10-1 cuda-nvjpeg-10-1
  cuda-nvjpeg-dev-10-1 cuda-nvml-dev-10-1 cuda-nvprof-10-1 cuda-nvprune-10-1
  cuda-nvrtc-10-1 cuda-nvrtc-dev-10-1 cuda-nvtx-10-1 cuda-nvvp-10-1
  cuda-runtime-10-1 cuda-samples-10-1 cuda-sanitizer-api-10-1
  cuda-toolkit-10-1 cuda-tools-10-1 cuda-visual-tools-10-1 freeglut3
  freeglut3-dev libcublas-dev libcublas10 libxmu-dev libxmu-headers
  nvidia-418-dev nvidia-modprobe
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  nvidia-cuda-dev
Recommended packages:
  libnvcuvid1
The following NEW packages will be installed:
  nvidia-cuda-dev
0 upgraded, 1 newly installed, 0 to remove and 54 not upgraded.
24 not fully installed or removed.
Need to get 201 MB of archives.
After this operation, 467 MB of additional disk space will be used.
Do you want to continue? [Y/n]

But I had the issue:

Get:1 http://fr.archive.ubuntu.com/ubuntu xenial/multiverse amd64 nvidia-cuda-dev amd64 7.5.18-0ubuntu1 [201 MB]
Fetched 201 MB in 5s (35.0 MB/s)          
(Reading database ... 242672 files and directories currently installed.)
Preparing to unpack .../nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-dev (7.5.18-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/stubs/libcublas.so', which is also in package libcublas-dev 10.1.0.105-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I then forced the overwrite of depackaging:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb

And then fixed the broken packages:

sudo apt -f install

But then I figured out that the lib64 folder was missing in the cuda folder:

/usr/local/cuda-10.1$ ls
LICENSE  README  libnsight  libnvvp  samples  src

Therefore, the path variable $LD_LIBRARY_PATH, which returns in my case /usr/local/cuda-10.1/lib64 points to a non-existing folder.

Could you help me?

Best regards

If I read correctly, you have CUDA 7.5 stuff with CUDA 10.x stuff, and apt will have trouble fixing it by itself.
Have you strictly followed the Linux installation guide?

Can you start synaptic, search for cuda and evaluate what packages and versions are currently installed?
Personally, and other people may differ, I think it is easier to just remove everything related to cuda from synaptic and use the standalone executable installer. If your driver is already good for the cuda version you want to use, don’t change it.