Forked from Brainiarc7/cuda_installation_on_ubuntu_18.04
Last active
October 27, 2023 14:29
-
-
Save StianHanssen/3486986115e5fe5edc89c17f1adbdc61 to your computer and use it in GitHub Desktop.
cuda 10.0 installation guidline for ubuntu 18.04 LTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DISCLAIMER: This is what worked for me, there may be redunant steps in here or things that could have been | |
# done easier! Please let me know if you find improvements so I can update the guide! | |
# If you already have the recommended nvidia drivers skip to "install other import packages" | |
# OPTION 1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
# Install recommended drivers, if your recommended drivers is older than the requirements for CUDA 10 | |
# then your system may not be suitable for CUDA 10, see system requirements here: | |
# https://docs.nvidia.com/cuda/archive/10.0/cuda-installation-guide-linux/index.html#system-requirements | |
sudo ubuntu-drivers autoinstall | |
# OPTION 2 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
# Find nvidia driver fit for your system at https://www.nvidia.com/download/index.aspx?lang=en-us | |
DRIVER_NAME="nvidia-driver-440" | |
# First get the PPA repository driver | |
sudo add-apt-repository ppa:graphics-drivers/ppa | |
# Install nvidia driver | |
sudo apt install ${DRIVER_NAME} ${DRIVER_NAME}-dev | |
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
# Install other import packages | |
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev | |
# CUDA 10 requires gcc 7 | |
# Check if you have a gcc version equal to or higher than 7.3.0 | |
gcc --version | |
# If you get missing package or your version is too old, install gcc 7 | |
sudo apt install gcc-7 | |
sudo apt install g++-7 | |
# Downoad one of the "runfile (local)" installation packages from cuda toolkit | |
# (all installers are found here: https://developer.nvidia.com/cuda-10.0-download-archive) | |
wget https://developer.nvidia.com/compute/cudahttps://developer.nvidia.com/cuda-10.0-download-archive/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux | |
# make the download file executable | |
chmod +x cuda_10.0.130_410.48_linux.run | |
sudo ./cuda_10.0.130_410.48_linux.run --override | |
# Answer questions following while installation begin | |
# You are attempting to install on an unsupported configuration. Do you wish to continue? y | |
# Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 [YOUR DRIVER VERSION]? n | |
# Install the CUDA 9.0 Toolkit? y | |
# Other options you may choose as you like | |
# Set up symlinks for gcc/g++ | |
sudo ln -s /usr/bin/gcc-7 /usr/local/cuda/bin/gcc | |
sudo ln -s /usr/bin/g++-7 /usr/local/cuda/bin/g++ | |
# Setup your paths | |
echo 'export PATH=/usr/local/cuda-10.0/bin:$PATH' >> ~/.bashrc | |
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH' >> ~/.bash.rc | |
source ~/.bashrc | |
# Install cuDNN v7.6.5 | |
# In order to download cuDNN you have to regeistered here https://developer.nvidia.com/developer-program/signup, | |
# then download cuDNN v7.6.5 form https://developer.nvidia.com/cudnn | |
# Download both "cuDNN Runtime Library for Ubuntu18.04 (Deb)" and "cuDNN Developer Library for Ubuntu18.04 (Deb)" | |
# Install downloaded packages | |
sudo dpkg -i libcudnn7_7.6.5.32-1+cuda10.0_amd64.deb | |
sudo dpkg -i libcudnn7-dev_7.6.5.32-1+cuda10.0_amd64.deb | |
# Copy the following files into the cuda toolkit directory. | |
sudo cp -P /usr/include/cudnn.h /usr/local/cuda-10.0/include | |
sudo cp -P /usr/x86_64-linux-gnu/libcudnn* /usr/local/cuda-10.0/lib64/ | |
sudo chmod a+r /usr/local/cuda-10.0/lib64/libcudnn* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment