Skip to content

Instantly share code, notes, and snippets.

@Chadys
Last active November 27, 2018 21:44
Show Gist options
  • Save Chadys/c2eea5320b126ab5139fb6c308930f42 to your computer and use it in GitHub Desktop.
Save Chadys/c2eea5320b126ab5139fb6c308930f42 to your computer and use it in GitHub Desktop.
A complete guide to install CUDA 10.0 on OSX High Sierra 10.13.6

How to install CUDA 10.0 on OSX 10.13.6

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 :

  1. 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
  2. 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

  3. CUDA driver

    Download the lastest version of CUDA driver for OSX here (which was actually this one for me)

    Install it and restart

  4. 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

  5. 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}}

  6. 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 !

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