網頁

2017年6月18日 星期日

GPU on OSX

Q: zsh: command not found: nvcc

A:



export PATH=/Developer/NVIDIA/CUDA-8.0/bin${PATH:+:${PATH}}

export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-8.0/lib\

${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}

Q: 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).

A:













nvcc -gencode arch=compute_30,code=sm_30 hello.cu -o hello

Q: nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported

A:












1. 下載Xcode 8.3.3 (https://developer.apple.com/download/more/)
2. Unzip "Xcode8.3.3.xip" and movie it to "Application folder" as /Applications/Xcode.app3. $ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
4. $ /usr/bin/cc --version
移除xcode
sudo rm -rf /Applications/Xcode.app
sudo rm -rf /Library/Preferences/com.apple.dt.Xcode.plist
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist rm -rf ~/Library/Caches/com.apple.dt.Xcode rm -rf ~/Library/Application\ Support/Xcode
rm -rf ~/Library/Developer/Xcode rm -rf ~/Library/Developer/CoreSimulator rm -rf ~/Library/Developer/XCPGDevices