-
Notifications
You must be signed in to change notification settings - Fork 18
CUDA
vhvkhoa edited this page Aug 19, 2023
·
2 revisions
- Find your desired CUDA-toolkit version here.
- Select
Linux -> x86_64 -> Ubuntu -> [UnbuntuVersion] -> runfile (local)
- Open terminal.
- Copy the
wget ...
command under instructions to download Cuda toolkit installer.
- Instead of running
sudo sh cuda...
as instructed, removesudo
. - Wait several minutes for the installer to setup and start command prompt.
- If it says “Existing package manager installtion of the driver found…”, select
Continue
. - Type
accept
when being asked to accept the EULA.. - At CUDA Installer page:
- Unselect everything except
CUDA Toolkit <version>
- Go to
Options -> Toolkit Options
, then:- unselect everything
- go to
Change Toolkit Install Path
- Change toolkit install path to a directory inside your home directory, e.g.,
/home/<user_name>/cuda-<version>/
if you're installing CUDA 11.8. Also remember the path you use for Step 9. - Press
Enter
, and selectDone
, andDone
again to go back to CUDA Installer page.
- Unselect everything except
- Press
Install
to start installation. - If the installation is successful, the console will prompt a summary and some instructions to let your terminal use local CUDA toolkit instead of the global version.
- Remove log file to avoid installer bug:
rm /tmp/cuda-installer.log
- To let terminal use your local CUDA Toolkit version, you need to add it to PATH and LIBRARY_PATH environment variables. Use the following command:
echo "export PATH=\"/home/<user_name>/cuda-<version>/bin:\$PATH\"" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=\"/home/<user_name>/cuda-<version>/lib64:\$LD_LIBRARY_PATH\"" >> ~/.bashrc
This is probably a bug from CUDA Toolkit runfile.
Bug summary: the installation generates a temporal logfile at /tmp/cuda-installer.log
. There are 3 scenarios:
- When another user install CUDA Toolkit with sudo, there is no problem because sudo helps override the file.
- When the machine is reboot, the file is automatically removed, if another user afterwards, there is also no problem.
- When another user install CUDA Toolkit without sudo, an error of
Log file not open. Segmentation fault (core dumped)
will prompt.
Solution: You need to remove the logfile by yourself because only you are allowed to do that (except sudoers):
rm /tmp/cuda-installer.log