Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVCC does not support Apple Clang version 8.x #1384

Closed
mlloreda opened this issue Apr 14, 2016 · 37 comments
Closed

NVCC does not support Apple Clang version 8.x #1384

mlloreda opened this issue Apr 14, 2016 · 37 comments
Labels

Comments

@mlloreda
Copy link
Member

@mlloreda mlloreda commented Apr 14, 2016

Error message: nvcc fatal : The version ('80000') of the host compiler ('Apple clang') is not supported

Steps to fix:

  1. Log in to https://developer.apple.com/downloads/
  2. Download Xcode CLT (Command Line Tools) 7.3
  3. Install CLT
  4. Run sudo xcode-select --switch /Library/Developer/CommandLineTools
  5. Verify that clang has been downgraded via clang --version

Source: http://stackoverflow.com/a/36590330/701646

Edit: Update to 7.3 and fail at 8.0

@shehzan10
Copy link
Member

@shehzan10 shehzan10 commented May 27, 2016

This issue does not affect CUDA >= 8.0

@samedling
Copy link

@samedling samedling commented Sep 28, 2016

First of all, CUDA 8.0 isn't widely available yet as it hasn't been officially released. Second, even CUDA 8 doesn't work with the current version of the Apple LLVM (version 8.0.0). It produces the following error message:
nvcc fatal : The version ('80000') of the host compiler ('Apple clang') is not supported

@gmachiraju
Copy link

@gmachiraju gmachiraju commented Sep 28, 2016

^Running into the same error message, @samedling

@shehzan10
Copy link
Member

@shehzan10 shehzan10 commented Sep 28, 2016

Thanks for your feedback. Unfortunately, this is an issue for CUDA to handle rather than ArrayFire. We are just a consumer on this front. That's why we have marked it as a known issue.

CUDA 8 has been release as of today. However, as far as I can see, there is no download available for OSX.

@shehzan10 shehzan10 added the OSX label Oct 12, 2016
@shehzan10
Copy link
Member

@shehzan10 shehzan10 commented Oct 12, 2016

CUDA 8 for OSX has been released and supports clang version 7.3.
It however does NOT support XCode 8/Clang 8.

Editing this issue to reflect that.

@shehzan10 shehzan10 changed the title NVCC does not support Apple Clang version 7.3 NVCC does not support Apple Clang version 8.x Oct 12, 2016
@henrythung
Copy link

@henrythung henrythung commented Oct 25, 2016

Downloaded CLT from https://developer.apple.com/download/more/.
another issue occurred:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented Oct 26, 2016

@Sitin
Copy link

@Sitin Sitin commented Nov 23, 2016

I have CUDA 8.0.46, OS X 10.12 and Xcode 8.1 but still have the same issue.

@adam-erickson
Copy link

@adam-erickson adam-erickson commented Nov 27, 2016

To switch Xcode CLT back to 8.1 run this:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

@pavanky
Copy link
Member

@pavanky pavanky commented Nov 28, 2016

@Sitin the issue description says you need to downgrade to 7.3 for CUDA to work.

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented Dec 8, 2016

Great news - CUDA 8.0.55 now supports Xcode 8!

Those of you who downgraded to CLT 7.3 need to upgrade to CLT 8.x, otherwise building the CUDA backend will fail due to a missing <string.h>.

@joseph-zhong
Copy link

@joseph-zhong joseph-zhong commented Apr 4, 2017

I now get

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

Through clang --version I see the following

Apple LLVM version 8.1.0 (clang-802.0.38)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I have Xcode and CLT both installed and am not sure what to do?

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented Apr 4, 2017

@joseph-zhong, it looks like you're using Xcode 8.3, which CUDA (v8.0.61) does not yet support. :(

Downgrading to CLT 8.2 should work.

For reference:

  1. Log in to https://developer.apple.com/downloads/
  2. Download Xcode CLT (Command Line Tools) 8.2
  3. Install CLT
  4. Run sudo xcode-select --switch /Library/Developer/CommandLineTools
  5. Verify that clang has been downgraded via clang --version
@mlloreda mlloreda reopened this Apr 4, 2017
@HiCraigChen
Copy link

@HiCraigChen HiCraigChen commented Apr 4, 2017

Thanks a lot, @mlloreda
I have the same problem when I install tensorflow GPU version

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

I did your method step by step and it worked !

@kwccoin
Copy link

@kwccoin kwccoin commented Apr 15, 2017

work for both Mac Pro and MacBook Pro until 10.12 as long as using switch above and not the latest clang version (7.x and 8.2 both ok)

80100 can work with some nvcc programs

I used "80100" and nvcc work for some of my other programs.

... but not sample

`

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

`

install CLT 8.2 it is sort of ok with message about "command line tools instance"

I google and see this discussion and thanks the hint to switch to CLT 8.2. It is sort of ok with warning message about "command line tools instance"

Need to use "sudo make" to compile sample code:

`
...
$ sudo make
Password:

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 deviceQuery.o -c deviceQuery.cpp

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

/Developer/NVIDIA/CUDA-8.0/bin/nvcc -ccbin g++   -m64  -Xcompiler -arch -Xcompiler x86_64  -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-8.0/lib  -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 deviceQuery deviceQuery.o 

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

mkdir -p ../../bin/x86_64/darwin/release

cp deviceQuery ../../bin/x86_64/darwin/release

$ ./deviceQuery
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)
...

`

@Isachenko
Copy link

@Isachenko Isachenko commented Apr 26, 2017

Hi have the same problem, have tried @mlloreda solution.
But after I switched to version 8.2 I got error message
"nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X."
after running make command.
Looks like it try to run gcc instead of clang now. Don't know what to do.

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented Apr 26, 2017

@Isachenko have CC or CXX been set on your system?

@Isachenko
Copy link

@Isachenko Isachenko commented Apr 26, 2017

@mlloreda no, both this variables are empty, if I understand you right.

@NataliaDiaz
Copy link

@NataliaDiaz NataliaDiaz commented Apr 28, 2017

I still get the same error when following the downgrading steps (in the last step installing Torch ./install.sh):

`
nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported
nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
Error generating
/Users/natalia/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o

CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
Error generating
/Users/natalia/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o

make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
Error generating
/Users/natalia/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o

make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.
`

@pavanky
Copy link
Member

@pavanky pavanky commented Apr 28, 2017

@NataliaDiaz What is the version of CUDA you have ?

@NataliaDiaz
Copy link

@NataliaDiaz NataliaDiaz commented Apr 28, 2017

nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Sun_Sep_18_22:16:08_CDT_2016
Cuda compilation tools, release 8.0, V8.0.46

on OS X Sierra

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented Apr 28, 2017

@NataliaDiaz what does clang --version return?

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented Apr 28, 2017

@Isachenko next step would be to check your symlinks. Make sure that you are pointing to clang and not gcc.

@pavanky
Copy link
Member

@pavanky pavanky commented Apr 29, 2017

@NataliaDiaz you need v8.0.61, please check the nvidia website and download the right version.

@NataliaDiaz
Copy link

@NataliaDiaz NataliaDiaz commented Apr 29, 2017

My clang version is Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented May 1, 2017

@NataliaDiaz you have two options:

  1. Update to the latest CUDA (v8.0.61) or
  2. Downgrade to CLT 7.3
@guillochon
Copy link

@guillochon guillochon commented May 1, 2017

@mlloreda I logged into the the Apple Developer page but your direct link to XCT 8.2 redirects me to https://developer.apple.com/unauthorized/. Instead people should visit https://developer.apple.com/download/more/ and search the list there for XCT 8.2.

@mlloreda
Copy link
Member Author

@mlloreda mlloreda commented May 1, 2017

@guillochon interesting - the link still works for me after logging in but thanks for the heads up!

@NataliaDiaz
Copy link

@NataliaDiaz NataliaDiaz commented May 2, 2017

@derwentx
Copy link

@derwentx derwentx commented May 22, 2017

To anyone stuck on this. Even though you might change the xcode version with xcode-select, and your clang version might say it's an older version, for some reason the compiler that ends up being used is still the latest version of XCode. Renaming the latest version of xcode.app to xcode_<new_version>.app after installing the older version to xcode_<old_version>.app fixed this for me.

Other things to try:
If you see this message somewhere in the failed compile
Automatic GPU detection failed. Building for common architectures.
re-install CUDA toolkit AFTER changing XCode versions and restarting your computer:

@adib
Copy link

@adib adib commented Jun 11, 2017

I'm stuck. Both Xcode and CUDA are at their latest release versions.

Xcode 8.3.3

clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix

CUDA Driver version: 8.0.83

nvcc fatal   : The version ('80100') of the host compiler ('Apple clang') is not supported
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
CMake Error at THC_generated_THCTensor.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensor.cu.o
@adib
Copy link

@adib adib commented Jun 11, 2017

Uninstalled Xcode 8.3.3, installed Xcode 8.2 into /Applications/Xcode.app and now compilation fails due to a missing header file. CUDA Driver version: 8.0.83

In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include <string.h>
         ^
In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include <string.h>
         ^
In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include <string.h>
         ^
In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include <string.h>
         ^
In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include <string.h>
         ^
In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include <string.h>
         ^
In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: In file included from <built-in>:337:
In file included from <command line>:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include <string.h>
         ^
'string.h' file not found
#include <string.h>
         ^
1 error generated.
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o


1 error generated.
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensor.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensor.cu.o


1 error generated.
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o] Error 1
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
1 error generated.
1 error generated.
CMake Error at THC_generated_THCTensorCopy.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o] Error 1
CMake Error at THC_generated_THCStorageCopy.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCStorageCopy.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o] Error 1
1 error generated.
1 error generated.
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
CMake Error at THC_generated_THCStorage.cu.o.cmake:207 (message):
  Error generating
  /Users/adib/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCStorage.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o] Error 1
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2
@LegendaryKim
Copy link

@LegendaryKim LegendaryKim commented Jun 16, 2017

I made it with "NVIDIA CUDA Installation Guide for Mac OS X
1.1. System Requirements" in Cuda Toolkit Documantation.

My operation is MacOS 10.12.5
and I did downgrade X_Code to X_Code 8.2

  1. Download X_Code 8.2
  2. Unzip "Xcode_8.2.xip" and movie it to "Application folder" as /Applications/Xcode_8.2.app
  3. Run sudo xcode-select -s /Applications/Xcode_8.2.app/Contents/Developer
  4. Check version by Run /usr/bin/cc --version, it should be Apple LLVM version 8.0.0
@EliezerIsrael
Copy link

@EliezerIsrael EliezerIsrael commented Jul 2, 2017

After downgrading XCode to 8.2, I found that I had to clear out the build directory and start the build from scratch.

@pabloheimplatz
Copy link

@pabloheimplatz pabloheimplatz commented Sep 11, 2017

@derwentx thanks a lot! Your tip to rename the newer version helped me to solve this issue here.
(and I ran straight into the next problem... (pytorch/pytorch#2682)

@gaoyangyiqiao
Copy link

@gaoyangyiqiao gaoyangyiqiao commented Nov 6, 2017

@mlloreda It works well for me!Thanks a lot!

@davidwowa
Copy link

@davidwowa davidwowa commented Jan 9, 2018

Note that the CUDA 9.1 driver supports macOS 10.13. This means that existing CUDA applications can be run on Mac systems with CUDA 9.1 installed, however new CUDA applications cannot be compiled with CUDA 9.1 on macOS 10.13.

Read more at: http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#ixzz53drQrgjs
Follow us: @gpucomputing on Twitter | NVIDIA on Facebook

@9prady9 9prady9 closed this May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.