GithubHelp home page GithubHelp logo

ubuntu_cuda_instructions's Introduction

Installing CUDA 10.0 and CUDnn 7.6 on Ubuntu 18.04, for pytorch (~1.3) and tensorflow (~2.0, 1.14-1.15) to both be able to use the GPU Also git, anaconda, pytorch, tensorflow, etc

1. Install nvidia drivers if they aren't installed already

  • Add nvidia PPA
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
  • Install latest nvidia driver for the graphics card
sudo apt-get install nvidia-driver-430
  • Reboot
sudo reboot
  • Check nvidia driver is installed
nvidia-smi

2. Install CUDA

  • Install dependencies
sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev
wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux
wget http://developer.download.nvidia.com/compute/cuda/10.0/Prod/patches/1/cuda_10.0.130.1_linux.run
  • Install CUDA 10.0 and patch (Don't install driver, since we already installed the driver)
sudo sh cuda_10.0.130_410.48_linux
sudo sh cuda_10.0.130.1_linux.run
  • Add CUDA directories to PATH variable
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' >> ~/.bashrc
source ~/.bashrc
sudo ldconfig
  • Check CUDA is installed
nvcc --version

3. Install CUDnn

sudo dpkg -i libcudnn7_7.6.5.32-1+cuda10.0_amd64.deb

4. Install Anaconda

wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
  • Run install script (do not sudo!)
sh Anaconda3-2019.10-Linux-x86_64.sh

5. (Optional) Install Git

sudo apt install git

6. (Optional) Make a dummy conda environment, install pytorch and tensorflow, check that they can access the GPU

conda create -n dummy python=3.7
conda activate dummy
pip install tensorflow-gpu
pip install torch torchvision
python
>>> import torch
>>> torch.cuda.is_available()
>>> import tensorflow as tf
>>> tf.test.is_gpu_available()

ubuntu_cuda_instructions's People

Contributors

daveboat avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.