CUDA + cuDNN Installation:
-
Install Cuda (2 options):
- Download from NVIDIA website. Will install to
/Developer/NVIDIA/CUDA=#-#
(macOS / OS X), with symlinks in/usr/local/cuda/
. - Alternatively, use
brew cask install cuda
.
- Download from NVIDIA website. Will install to
-
Download CuDNN from NVIDIA website into
local_cudnn_path
, then:sudo mkdir /usr/local/cudnn
sudo cp -r local_cudnn_path/* /usr/local/cudnn/
-
Setup paths in
~/.bash_profile
:export CUDA_HOME=/usr/local/cuda
export CUDNN_HOME=/usr/local/cudnn
- macOS / OS X:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$CUDA_HOME/lib:$CUDNN_HOME/lib
- Linux:
sudo apt-get install libcupti-dev
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDNN_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64
-
Test:
cp -r /usr/local/cuda/samples ~/cuda-samples pushd ~/cuda-samples make popd ~/cuda-samples/bin/x86_64/darwin/release/deviceQuery
-
Troubleshoot
Failed to initialize NVML: Driver/library version mismatch
error (via https://stackoverflow.com/a/45319156):sudo rmmod nvidia_drm sudo rmmod nvidia_modeset sudo rmmod nvidia_uvm sudo rmmod nvidia nvidia-smi