Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing cuda via brew and dmg

Tags:

dmg

cuda

gpu

nvidia

After attempting to install nvidia toolkit on MAC by following guide : http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#axzz4FPTBCf7X I received error "Package manifest parsing error" which led me to this : NVidia CUDA toolkit 7.5.27 failing to install on OS X . I unmounted the dmg and upshot was that instead of receiving "Package manifest parsing error" the installer would not launch (it seemed to launch briefly , then quit).

Installing via command brew install Caskroom/cask/cuda (CUDA 7.5 install on Mac missing nvrtc) seems to have successfully installed cuda.

command nvcc --version returns :

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Mon_Apr_11_13:23:40_CDT_2016
Cuda compilation tools, release 7.5, V7.5.26

I've built the example in /Developer/NVIDIA/CUDA-7.5/samples/1_Utilities with :

make -C bandwidthTest/

This executed without error.

It appears installing with brew install Caskroom/cask/cuda is safe method of installing ? What is difference between this install method and installing via DMG file from nvidia ?

Caskroom appears to be an extension for brew for installing GUI applications : https://github.com/caskroom/homebrew-cask

Should an IDE also be installed as part of the cuda install ?

like image 639
blue-sky Avatar asked Jul 25 '16 11:07

blue-sky


People also ask

Is it possible to install CUDA in Mac?

Once you have verified that you have a supported NVIDIA GPU, a supported version the MAC OS, and clang, you need to download the NVIDIA CUDA Toolkit. The NVIDIA CUDA Toolkit is available at no cost from the main CUDA Downloads page. The installer is available in two formats: 1.

Is it possible to install CUDA on Mac M1?

CUDA in particular is unlikely to ever be supported on ARM-based Apple Systems: NVIDIA has exited the Apple market, after years of disagreements with Apple. Sorry, but you simply will not be able to use your M1 MacBook Pro for this purpose.

Do I need to install CUDA separately?

Cuda needs to be installed in addition to the display driver unless you use conda with cudatoolkit or pip with cudatoolkit. Tensorflow and Pytorch need the CUDA system install if you install them with pip without cudatoolkit or from source.

Can I install CUDA without Visual Studio?

Can we install CUDA Toolkit without Visual Studio? Yes we can install CUDA toolkit without visual studio integration on windows.


1 Answers

Nowadays you have to do the following to install cuda via brew:

brew tap homebrew/cask-drivers
brew cask install nvidia-cuda

See https://github.com/caskroom/homebrew-cask/issues/38325 . Then you also need to 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}}

See http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html.

UPDATE: Newer versions of Mac OS X with activated SIP (System integrity protection) will prevent modifying the DYLD_LIBRARY_PATH (see https://groups.google.com/forum/#!topic/caffe-users/waugt62RQMU). You can check that via

source ~/.bash_profile
env | grep DYLD_LIBRARY_PATH

If the output of this command is empty SIP is active and you might want to deactivate it as described at https://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html . After doing this you should see

env | grep DYLD_LIBRARY_PATH
DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.0/lib
like image 90
asmaier Avatar answered Sep 28 '22 06:09

asmaier