If like me you had some problem using CUDA on your High Sierra computer (samples not compiling or having driver error at execution), here's my recipe to make it work.
References used :
- https://developer.download.nvidia.com/compute/cuda/10.0/Prod/docs/sidebar/CUDA_Installation_Guide_Mac.pdf
- https://devtalk.nvidia.com/default/topic/1025945/mac-cuda-driver-fully-compatible-with-macos-high-sierra-10-13-error-quot-update-required-quot-solved-/
-
Clean up
If a previous version was installed, uninstall it using the official scripts :
sudo perl /usr/local/bin/uninstall_cuda_drv.pl sudo perl /Developer/NVIDIA/CUDA-10.0/bin/uninstall_cuda_10.0.pl
-
Graphic driver
Download the last version of the NVidia driver for OSX 10.13.6 (which was actually this one for me).
Your graphic card might not be listed as a supported product, but it still works.
Install it and restart
Go to System Preferences > NVIDIA Driver Manager > Updates > Check Now and update if needed
A NVidia menu now appear in your menubar to switch between the NVidia driver and the system default one
-
CUDA driver
Download the lastest version of CUDA driver for OSX here (which was actually this one for me)
Install it and restart
-
CUDA Toolkit
Download CUDA Toolkit 10.0
When installing, only select Toolkit and, optionally Samples (recommended to test your installation)
Go to System Preferences > Energy Saver and uncheck Automatic graphics switching
-
Update Environment variable
sudo nano /etc/paths
Add the line
/Developer/NVIDIA/CUDA-10.0/bin
sudo nano /etc/bashrc
Add the line
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-10.0/lib\ ${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
-
Xcode downgrade
To be able to compile, download Xcode 9.4 here (an Apple account is necessary).
Extract and rename the file as Xcode_9.4.app and put it in the /Application folder
To change the current Xcode :
sudo xcode-select -s /Applications/Xcode_9.4.app # if needed xcode-select --install # to go back to default sudo xcode-select -s /Applications/Xcode.app
There you are, you should now be able to compile and launch CUDA apps on your system !