CUDA linking error on OS X El Capitan

时间秒杀一切 提交于 2019-12-04 06:32:19

问题


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!


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/41861885/cuda-linking-error-on-os-x-el-capitan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!