Jeremy Kahn
Jeremy Kahn

Reputation: 103

CUDA linking error on OS X El Capitan

I've been trying to install CUDA and cuDNN for TensorFlow as instructed on the TensorFlow page. Everything works until I do the following:

$ cp -r /usr/local/cuda/samples ~/cuda-samples
$ pushd ~/cuda-samples
$ make

I then get the following error:

clang++  -rpath /Developer/NVIDIA/CUDA-7.5/lib -L/Developer/NVIDIA/CUDA-7.5/lib -framework CUDA -o clock_nvrtc clock.o  -lnvrtc
ld: framework not found CUDA
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [clock_nvrtc] Error 1
make: *** [0_Simple/clock_nvrtc/Makefile.ph_build] Error 2

My question of course is what's causing the error, and how to fix it. I had previously installed CUDA 7.5, and then I installed 8.0. The whole of CUDA (and its installation) is just a black box to me; I'm just trying to get it to work with TensorFlow.

Thanks!

Upvotes: 0

Views: 417

Answers (2)

Pedro Jiménez
Pedro Jiménez

Reputation: 499

Run the following in your terminal -

xcode-select --install

Then try to run make again.

Saw the answer on an NVidia forum - https://devtalk.nvidia.com/default/topic/628298/cuda-samples-on-mac-os-x-mavericks-10-9-matrixmuldrv/

It's also documented in this Quick Start Guide - http://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html#axzz4YvZYOZc0

Upvotes: 1

Top Sekret
Top Sekret

Reputation: 758

Add the folder containing the folder CUDA.framework to the command line as such:

-F<folder>

It looks like the linker isn't able to find the framework and you have to point it where it is

Upvotes: 2

Related Questions