Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 3652  / 2 Years ago, sun, may 29, 2022, 7:58:11

The official packages do not seem up-to-date (https://packages.ubuntu.com/search?keywords=nvidia-cuda-toolkit) but using the latest cuda seems to matter when using newer hardware.


Nvidia is making packages available, but there is no guarantee that they will work well or will integrate with Ubuntu's management of nvidia drivers.


Is there an effort to create an ubuntu package in a PPA so we do not have to install manually and work out conflicts individually? (the package would handle that)


More From » nvidia

 Answers
6

  1. Open the terminal and remove any NVIDIA traces that you may have on your system.


    sudo rm /etc/apt/sources.list.d/cuda*
    sudo apt remove --autoremove nvidia-cuda-toolkit
    sudo apt-get remove --autoremove nvidia-*


  2. Setup the correct CUDA PPA on your system.


    export DISTRO=ubuntu2004
    export ARCHITECTURE=x86_64
    sudo apt update
    sudo add-apt-repository ppa:graphics-drivers
    sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/${DISTRO}/${ARCHITECTURE}/7fa2af80.pub
    sudo bash -c "echo deb http://developer.download.nvidia.com/compute/cuda/repos/${DISTRO}/${ARCHITECTURE}/ / > /etc/apt/sources.list.d/cuda.list"
    sudo bash -c "echo deb http://developer.download.nvidia.com/compute/machine-learning/repos/${DISTRO}/${ARCHITECTURE} / > /etc/apt/sources.list.d/cuda_learn.list"


  3. Install CUDA 11.1 packages.


    sudo apt update
    sudo apt -y install cuda-11-1
    sudo apt install libcudnn8


  4. Specify the PATH to CUDA in the '.profile' file. Open the file by running sudo nano ~/.profile and add the following lines at the end of the file:


    # set PATH for cuda 11.1 installation
    if [ -d "/usr/local/cuda-11.1/bin/" ]; then
    export PATH=/usr/local/cuda-11.1/bin${PATH:+:${PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    fi

    Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location. Use the keyboard combination Ctrl + X to exit nano.



  5. Restart with sudo reboot and check the versions of the installation.


    CUDA:


    nvcc  --version

    NVIDIA driver:


    nvidia-smi

    libcudnn:


    /sbin/ldconfig -N -v $(sed ‘s/:/ /’ <<< $LD_LIBRARY_PATH) 2>/dev/null | grep libcudnn



[#2382] Tuesday, May 31, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uxuriousrnal

Total Points: 279
Total Questions: 106
Total Answers: 96

Location: Fiji
Member since Wed, Mar 29, 2023
1 Year ago
uxuriousrnal questions
Wed, Mar 9, 22, 09:04, 2 Years ago
Mon, Jul 18, 22, 01:48, 2 Years ago
Wed, Apr 13, 22, 01:15, 2 Years ago
Thu, Aug 26, 21, 22:01, 3 Years ago
;