All folders under CUDA are empty, after I installed CUDA 10.2 on Ubuntu 18.04 server

Hi everyone,

I met a problem after I installed the CUDA 10.4 on my Ubuntu 18.04 server. I found all the files under the CUDA folder are disappear! Can you help me with this issue? Thank you a lot in advance!

Here are some details of my questions.

Firstly, I followed the steps below to uninstall the existing CUDA, and installed the latest version:

Uninstall

sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /usr/local/cuda*

Install

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt updat
sudo ubuntu-drivers autoinstall

sudo apt install nvidia-cuda-toolkit

Everything looks good at this moment, here are some install results:

$ nvidia-smi

Mon May 25 02:32:42 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro K600         Off  | 00000000:02:00.0  On |                  N/A |
| 31%   62C    P0    N/A /  N/A |    422MiB /   974MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 106...  Off  | 00000000:03:00.0 Off |                  N/A |
|  0%   40C    P8     4W / 120W |     15MiB /  6078MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1432      G   /usr/lib/xorg/Xorg                            31MiB |
|    0      1500      G   /usr/bin/gnome-shell                          51MiB |
|    0      1681      G   /usr/lib/xorg/Xorg                            95MiB |
|    0      1799      G   /usr/bin/gnome-shell                          89MiB |
|    0      2687      G   ...AAAAAAAAAAAAAAgAAAAAAAAA --shared-files   148MiB |
|    1      1432      G   /usr/lib/xorg/Xorg                             5MiB |
|    1      1681      G   /usr/lib/xorg/Xorg                             6MiB |
+-----------------------------------------------------------------------------+

$ nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85

Then the question came. Normally CUDA should under /usr/local, but I cannot find it there. Hence I tried:

locate cuda | grep /cuda$

/home/zihan/.local/lib/python3.6/site-packages/torch/cuda
/home/zihan/.local/lib/python3.6/site-packages/torch/backends/cuda
/home/zihan/.local/lib/python3.6/site-packages/torch/include/ATen/cuda
/home/zihan/.local/lib/python3.6/site-packages/torch/include/c10/cuda
/home/zihan/.local/lib/python3.6/site-packages/torch/include/torch/csrc/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/numba/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/tensorflow_core/include/external/local_config_cuda/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/tensorflow_core/include/external/local_config_cuda/cuda/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/tensorflow_core/include/tensorflow/stream_executor/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/torch/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/torch/backends/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/torch/include/ATen/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/torch/include/c10/cuda
/home/zihan/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/cuda
/home/zihan/anaconda3/pkgs/numba-0.45.1-py37h962f231_0/lib/python3.7/site-packages/numba/cuda
/home/zihan/anaconda3/pkgs/pytorch-1.3.1-cuda100py37h53c1284_0/lib/python3.7/site-packages/torch/cuda
/home/zihan/anaconda3/pkgs/pytorch-1.3.1-cuda100py37h53c1284_0/lib/python3.7/site-packages/torch/backends/cuda
/home/zihan/anaconda3/pkgs/pytorch-1.3.1-cuda100py37h53c1284_0/lib/python3.7/site-packages/torch/include/ATen/cuda
/home/zihan/anaconda3/pkgs/pytorch-1.3.1-cuda100py37h53c1284_0/lib/python3.7/site-packages/torch/include/c10/cuda
/home/zihan/anaconda3/pkgs/pytorch-1.3.1-cuda100py37h53c1284_0/lib/python3.7/site-packages/torch/include/torch/csrc/cuda
/home/zihan/anaconda3/pkgs/tensorflow-base-1.15.0-gpu_py37h9dcbed7_0/lib/python3.7/site-packages/tensorflow_core/include/external/local_config_cuda/cuda
/home/zihan/anaconda3/pkgs/tensorflow-base-1.15.0-gpu_py37h9dcbed7_0/lib/python3.7/site-packages/tensorflow_core/include/external/local_config_cuda/cuda/cuda
/home/zihan/anaconda3/pkgs/tensorflow-base-1.15.0-gpu_py37h9dcbed7_0/lib/python3.7/site-packages/tensorflow_core/include/tensorflow/stream_executor/cuda
/home/zihan/anaconda3/pkgs/tensorflow-base-1.15.0-mkl_py37he1670d9_0/lib/python3.7/site-packages/tensorflow_core/include/external/local_config_cuda/cuda
/home/zihan/anaconda3/pkgs/tensorflow-base-1.15.0-mkl_py37he1670d9_0/lib/python3.7/site-packages/tensorflow_core/include/external/local_config_cuda/cuda/cuda
/home/zihan/anaconda3/pkgs/tensorflow-base-1.15.0-mkl_py37he1670d9_0/lib/python3.7/site-packages/tensorflow_core/include/tensorflow/stream_executor/cuda
/usr/include/thrust/system/cuda
/usr/lib/cuda

Then I went to /usr/lib/cuda to check it. However, I found all folders inside CUDA are empty. I mean, everything disappears!

/usr/lib/cuda$ ls
bin  include  lib64  nvvm  version.txt
/usr/lib/cuda/bin$ ls -l
total 0
# (questions are same in other folders, like lib64)

/usr/lib/cuda/lib64$ ls -l
total 0

May I ask where these files go? Why this happens, and how can I fix that? Thank you a lot for your help in advance.