-2

I try to build one of the samples using

make -C 0_Simple/vectorAdd

I get the following output:

/Developer/NVIDIA/CUDA-9.0/bin/nvcc -ccbin clang++ -I…/…/common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -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 fatal : The version (‘40001’) of the host compiler (‘clang’) is not supported
make: *** [vectorAdd.o] Error 1

I have OSX 10.12.6 (sierra)

I installed XCode 8.3.3 and have set it using sudo xcode-select -s /Applications/Xcode_8.3.3.app/Contents/Developer. I also installed the command line tools.

This is for CUDA-9.0 since any higher version requires OSX 10.13 or higher.


If I use:

sudo xcode-select --switch /Library/Developer/CommandLineTools/

and then:

make -C 0_Simple/vectorAdd

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-9.0/bin/nvcc -ccbin g++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -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 fatal : The version ('90000') of the host compiler ('Apple clang') is not supported make: *** [vectorAdd.o] Error 1

It is all so unclear, why is it not supported, is it too new? Is it too old? Should clang be updated or downgraded etc?

talonmies
  • 70,661
  • 34
  • 192
  • 269
clankill3r
  • 9,146
  • 20
  • 70
  • 126
  • 1
    CUDA 9 requires Xcode 8.3.3 -- https://docs.nvidia.com/cuda/archive/9.0/cuda-installation-guide-mac-os-x/index.html – talonmies May 13 '20 at 16:45
  • 1
    As the link I have provided clearly states -- you need the exact version of both Xcode and Clang installed for the CUDA toolkit to work. If you don't have that (and you don't), then it won't work. The default clang versions can be found here https://trac.macports.org/wiki/XcodeVersionInfo, you can clearly see that you are still using the clang from the Xcode 9.2 installation you installed earlier – talonmies May 18 '20 at 14:15

1 Answers1

1

In general, CUDA is strictly versioned and requires exact versions of host SDKs and compilers to work. For CUDA 9.0 on OS X, the requirements are

  • XCode 8.3.3
  • Clang (Apple LLVM 8.1.0), aka "8100"

(Taken directly from the installation instructions)

If and only if you have those two items correctly installed, CUDA 9.0 will work on Mac OS X 10.12. Otherwise it will not.

talonmies
  • 70,661
  • 34
  • 192
  • 269