Skip to content

Instantly share code, notes, and snippets.

@karkirowle
Last active November 29, 2017 13:43
Show Gist options
  • Save karkirowle/23128559933557a248d48bf0e3fae56f to your computer and use it in GitHub Desktop.
Save karkirowle/23128559933557a248d48bf0e3fae56f to your computer and use it in GitHub Desktop.
Installing cuDNN on Lenovo-Y50 Ubuntu 16.04 - felt this is kind of tricky, it might help some
# I had so many troubles getting CUDA 8 on my Lenovo-Y50 Ubuntu 16.04, so here you go, hope this helps a lot of
sudo apt-get purge libvdpau-va-gl1 bumblebee* nvidia*
# Driver
sudo apt-get install nvidia-384 nvidia-settings nvidia-prime
# Do a reboot here
sudo reboot
# Downloads the respective driver
cd ~/Downloads
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run
chmod +x cuda_8.0.61_375.26_linux.run
# Run the driver install
cd ~/Downloads
sudo bash cuda_8.0.61_375.26_linux.run --no-opengl-libs
# Control+C skip eula to end
# accept
# no for the accelerated driver
# yes for toolkit, symbolic link. and yes for samples
# Download cuDNN v6 from the website
# https://developer.nvidia.com/cudnn
# Extract cudnn-8.0-linux-x64-v5.1.tgz you will get a folder "cuda"
# Make sure to download the right
cd ~/Downloads/cuda
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
# Install tensorflow by activating your virtual environment and installing in gpu-enabled mode
# Check tensorflow installation as given on tensorflow installation page
# If import tensorflow throws an error for which indicates a libcudnn.so.7 or something like that, try to downgrade or upgrade cuDNN
@dat14
Copy link

dat14 commented Nov 29, 2017

For those who struggles with verifying cuDNN v7 64-bit installation:

  • If you receive a message like: ./mnistCUDNN: error while loading shared libraries: libcudart.so.9.0: cannot open shared object file: No such file or directory
  • Check what your CUDA installation folder is in /usr/local directory, it can be cuda or cuda-9.0. You will set the environmental variables accordingly.
  • Check your PATH variable ($ echo $PATH) and LD_LIBRARY_PATH variable ($ echo $LD_LIBRARY_PATH) and make sure both of it contains /usr/local/cuda/lib64 or /usr/local/cuda-9.0/lib64
  • Check the directories and make sure the files copied from the .tgz file are in there.

In case the you are missing the required PATHs use these command below in terminal to add them:

  • $ export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} or $ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}

  • $ export LD_LIBRARY_PATH=/usr/local/cuda/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} or $ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment