Accidentally delete /usr/local/cuda in CentOS

Hi all,

I just accidentally deleted /usr/local/cuda and /usr/local/cuda-8.0 in CentOS when I tried to reinstall cuda toolkit. Now I tried to install cuda toolkit again, but I found that /usr/local/cuda seems to disappear forever. Is there any way to save this?

I’m new to linux, so if there is any information I have to provide, please let me know. Thanks in advance.

When you reinstall, if the directory /usr/local/cuda-8.0 appears (it should) then /usr/local/cuda is just a symlink to /usr/local/cuda-8.0

Normally the installer will create this symlink for you, but I don’t know what method you used to install the toolkit.

Anyway, if /usr/local/cuda-8.0 is properly set up, you can easily create the symlink yourself, something like (as root):

ln -s -T /usr/local/cuda-8.0 /usr/local/cuda

on linux you can often get command help with for example:

man ln

Thank you for your reply.

I was following the official guide (http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#axzz4mWXuCnyc), and I used rpm to install cuda.

I had tried to remove cuda and reinstall it, but /usr/local/cuda-8.0 still didn’t appear.

If /usr/local/cuda-8.0 does not appear, then the install process is not working.

after looking at your cross-posting:

https://stackoverflow.com/questions/45034348/accidentally-delete-usr-local-cuda-in-centos

I would suggest:

  1. Follow the steps in the linux install guide to completely remove the package manager (rpm/yum) installation:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#handle-uninstallation

yum remove cuda

  1. Start over and run a the full install process:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#redhat-installation

sudo rpm --install cuda-repo--..rpm
sudo yum clean expire-cache
sudo yum install cuda

Sorry about the limited information, but I don’t know what information I should provide.

After I downloaded cuda toolkit, I followed the installation instruction and ran these:

  1. rpm -i cuda-repo-rhel6-8-0-local-ga2-8.0.61-1.x86_64.rpm`
  2. yum clean all
  3. sudo yum install cuda

The following is the console result when I tried to run “yum install cuda”. It seems cuda was successfully installed, but /usr/local/cuda-8.0 didn’t appear.

[root@Linux1 CYH]# yum install cuda
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.isu.edu.tw
 * epel: ftp.riken.jp
 * extras: ftp.isu.edu.tw
 * updates: ftp.isu.edu.tw
Resolving Dependencies
--> Running transaction check
---> Package cuda.x86_64 0:8.0.61-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================
 Package          Arch          Version          Repository          Size
=============================================================================================================
Installing:
 cuda             x86_64        8.0.61-1           cuda             5.7 k

Transaction Summary
=============================================================================================================
Install       1 Package(s)

Total download size: 5.7 k
Installed size: 0  
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 5.7 k
cuda-8.0.61-1.x86_64.rpm                                                                                                                                                                                              | 5.7 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : cuda-8.0.61-1.x86_64                                                                                                                                                                                                      1/1 
  Verifying  : cuda-8.0.61-1.x86_64                                                                                                                                                                                                      1/1 

Installed:
  cuda.x86_64 0:8.0.61-1

If there is any information I should provide, please let me know. Thank you.

I saw your cross posting and updated my post above

Thanks for the suggestion.

I have just remove cuda and reinstall it, but /usr/local/cuda-8.0 still doesn’t appear.

Are you using the network install or local install?

Try downloading the local installer

I was using local install, although I had tried network one, which didn’t work, either.

Well I’m not sure what the problem is. The package manager is getting confused, somehow.

Another option is to switch to the runfile installer method. Be sure to fully remove and clean out the package manager install using the instructions I already linked, then download the runfile installer from http://www.nvidia.com/getcuda and follow the instruction in the guide for a runfile install.

Okay, thanks a lot for your reply.

Just asking, is it necessary to reboot if I use runfile installer (as the instruction suggests)? Since I am actually using teamviewer to control the computer remotely, if I have to reboot the computer, I will have to use the computer in directly, which is not convenient for now.

I just tried the runfile installer method, and it worked. Thanks for your suggestion.