在 Mac 上设置 CUDA?
Setting up CUDA on Mac?
我正在按照 NVIDIA 网站上的说明在我的计算机上安装 CUDA。我已经完成了“3.2 安装”之前的所有操作 (http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#installation)。我不确定如何使用命令 cuda-install-samples-8.0.sh
,它说找不到命令。当我尝试 运行 make 编译一些示例时,我收到以下消息:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
expr: syntax error
/Developer/NVIDIA/CUDA-8.0/bin/nvcc -ccbin g++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o vectorAdd.o -c vectorAdd.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
make: *** [vectorAdd.o] Error 1
我希望这与我没有设置环境变量有关。我有一台带有 NVIDIA GeForce GT 650M GPU 的 MacBook Pro,所以我很确定我的电脑与 CUDA 兼容。
我已经安装了 Xcode,并更新了它并确保安装了命令行工具。
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
答案可以在下面link https://github.com/nodejs/node-gyp/issues/569#issuecomment-255589932(bergerjac 的答案)中找到。也可能会弹出另一个错误,可能类似于
Unable to open output file 'vectorAdd.o': 'Error opening output file 'vectorAdd.o': Permission denied
所以我 运行 下面的命令
sudo chown -R your-user-name /Developer/NVIDIA/CUDA-7.0/samples
我相信它工作正常。
我正在按照 NVIDIA 网站上的说明在我的计算机上安装 CUDA。我已经完成了“3.2 安装”之前的所有操作 (http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#installation)。我不确定如何使用命令 cuda-install-samples-8.0.sh
,它说找不到命令。当我尝试 运行 make 编译一些示例时,我收到以下消息:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
expr: syntax error
/Developer/NVIDIA/CUDA-8.0/bin/nvcc -ccbin g++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o vectorAdd.o -c vectorAdd.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
make: *** [vectorAdd.o] Error 1
我希望这与我没有设置环境变量有关。我有一台带有 NVIDIA GeForce GT 650M GPU 的 MacBook Pro,所以我很确定我的电脑与 CUDA 兼容。
我已经安装了 Xcode,并更新了它并确保安装了命令行工具。
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
答案可以在下面link https://github.com/nodejs/node-gyp/issues/569#issuecomment-255589932(bergerjac 的答案)中找到。也可能会弹出另一个错误,可能类似于
Unable to open output file 'vectorAdd.o': 'Error opening output file 'vectorAdd.o': Permission denied
所以我 运行 下面的命令
sudo chown -R your-user-name /Developer/NVIDIA/CUDA-7.0/samples
我相信它工作正常。