- install webdriver.sh
brew tap vulgo/repo
brew install webdriver.sh
- install lastest driver
webdriver
installed version 387.10.10.10.40.133
- install cuda via brew:
brew tap homebrew/cask-drivers
brew cask install nvidia-cuda
- add the following to your file ~/.bash_profile:
export PATH=/Developer/NVIDIA/CUDA-9.0/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.0/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
- verify installation
nvcc --version
installed version 418.105
Install cuDNN
- download cuDNN v7.6.5 (November 5th, 2019), for CUDA 10.1
- untar
tar -xzvf cudnn-10.1-osx-x64-v7.6.5.32.tgz
- copy the files into the CUDA Toolkit directory, and change the file permissions
sudo cp cuda/include/cudnn*.h /usr/local/cuda/include
sudo cp cuda/lib/libcudnn* /usr/local/cuda/lib
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
installed version 7.6.5
Build PyTorch from source
- install anaconda
- remove previous versions of pythorch
conda remove pytorch torchvision -y
pip uninstall torch -y
pip uninstall torch -y # yes twice
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
MACOSX_DEPLOYMENT_TARGET=10.13 CC=clang CXX=clang++ python setup.py install
error when linking
libtorch_cuda.dylib
on macOS 10.13.6 fix
- build
torchvision
from source
git clone --recursive https://github.com/pytorch/vision
cd vision
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
MACOSX_DEPLOYMENT_TARGET=10.13 CC=clang CXX=clang++ python setup.py install
- verify installation
import torch
print(torch.__version__)
import torch
assert torch.cuda.is_available()
assert torch.randn(20).cuda().is_cuda
import torch
assert torch.backends.cudnn.enabled
installed version 1.7.0a0+eeb43ff
I added
#include <math.h>
in/Users/gw/repos/pytorch/aten/src/ATen/native/ReduceOps.cpp
/Users/gw/repos/pytorch/aten/src/ATen/native/cpu/MaxPoolKernel.cpp
/Users/gw/repos/pytorch/aten/src/ATen/native/cpu/MaxPooling.cpp
/Users/gw/repos/pytorch/aten/src/ATen/native/cpu/AdaptiveMaxPoolKernel.cpp
But I'm still getting the same error messages: