Torch.cuda.is_available() returns False with CUDA 8.0 even though CUDA is successfully installed


#1

Hi everyone,

I’ve successfully installed CUDA 8.0.83 on OS 10.12.5 (verified by running the ./deviceQuery and ./bandwidthTest sample scripts from the CUDA install and going through the first PyTorch tutorial). I’ve also installed Pytorch successfully using pip. However, when I run torch.cuda.is_available(), I get False in return.

Not quite sure why this step fails when all the other steps are successful. Any help would be appreciated. Cheers!


(Spruce Bondera) #2

As you can see on the PyTorch install selection screen, on macOS you have to install from source for CUDA support. Check out https://github.com/pytorch/pytorch#from-source.


#3

Yes, I have followed the instructions to install from source. I am assuming the install was successful since both the ./deviceQuery and ./bandwidthTest scripts ran ok. My issue is still that PyTorch can’t seem to detect that cuda is available when I run β€œtorch.cuda.is_available()”.


(Spruce Bondera) #4

Sorry, to clarify, you installed PyTorch or CUDA from source? deviceQuery and bandwithTest are scripts to check CUDA worked, and have nothing to do with PyTorch. You need to install PyTorch from source, not with pip, by following the instructions in the link I posted.


#5

I installed CUDA from source via the instructions on this site: http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#axzz4kJrsqXTL. I have Xcode 8.2 and CUDA 8.0.83. This installation passes the deviceQuery and bandwithTest scripts.

I have also installed PyTorch from source via the link you posted above. I have anaconda installed and I set β€œexport CMAKE_PREFIX_PATH=~/anaconda”. The step that fails is: python setup.py install.

When I run python setup.py, this is what I get from terminal:

sudo MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install
running install
running build_deps
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/_thnn/utils.py:1: RuntimeWarning: Parent module β€˜torch._thnn’ not found while handling absolute import
import os
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/_thnn/utils.py:2: RuntimeWarning: Parent module β€˜torch._thnn’ not found while handling absolute import
import itertools
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/_thnn/utils.py:3: RuntimeWarning: Parent module β€˜torch._thnn’ not found while handling absolute import
import importlib
– Try OpenMP C flag = [-fopenmp=libomp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [ ]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-fopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [/openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-Qopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-xopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [+Oopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-qsmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-mp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-fopenmp=libomp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [ ]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-fopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [/openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-Qopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-xopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [+Oopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-qsmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-mp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)
– Could not find hardware support for NEON on this machine.
– No OMAP3 processor on this machine.
– No OMAP4 processor on this machine.
– SSE2 Found
– SSE3 Found
– AVX Found
– AVX2 Found
– TH_SO_VERSION: 1
– Atomics: using GCC intrinsics
– Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m]
– Library mkl_intel_lp64: /Users/zzhao/miniconda2/lib/libmkl_intel_lp64.dylib
– Library mkl_intel_thread: /Users/zzhao/miniconda2/lib/libmkl_intel_thread.dylib
– Library mkl_core: /Users/zzhao/miniconda2/lib/libmkl_core.dylib
– Library iomp5: /Users/zzhao/miniconda2/lib/libiomp5.dylib
– Library pthread: /usr/lib/libpthread.dylib
– Library m: /usr/lib/libm.dylib
– MKL library found
– Found a library with BLAS API (mkl).
– Found a library with LAPACK API. (mkl)
– Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run β€œcmake
–help-policy CMP0042” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

TH

This warning is for project developers. Use -Wno-dev to suppress it.

– Generating done
– Build files have been written to: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/TH
[100%] Built target TH
Install the project…
– Install configuration: β€œRelease”
– Installing: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTH.1.dylib
– Installing: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTH.dylib
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/TH.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THAllocator.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THMath.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THBlas.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THDiskFile.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THFile.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THFilePrivate.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGeneral.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateAllTypes.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateDoubleType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateFloatType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateHalfType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateLongType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateIntType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateShortType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateCharType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateByteType.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateFloatTypes.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THGenerateIntTypes.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THLapack.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THLogAdd.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THMemoryFile.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THRandom.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THSize.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THStorage.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THTensor.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THTensorApply.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THTensorDimApply.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THTensorMacros.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THVector.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THAtomic.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/THHalf.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/vector/AVX.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/vector/AVX2.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THBlas.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THBlas.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THLapack.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THLapack.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THStorage.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THStorage.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THStorageCopy.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THStorageCopy.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensor.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensor.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorConv.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorConv.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorCopy.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorCopy.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorLapack.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorLapack.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorMath.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorMath.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorRandom.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorRandom.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THVectorDispatch.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH/generic/THVector.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/share/cmake/TH/THConfig.cmake
Updating install_name for libTH.1.dylib
Updating install_name for libTHNN.1.dylib
Updating install_name for libTHS.1.dylib
– TH_LIBRARIES: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTH.1.dylib
– THS_SO_VERSION: 1
– Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run β€œcmake
–help-policy CMP0042” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

THS

This warning is for project developers. Use -Wno-dev to suppress it.

– Generating done
– Build files have been written to: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THS
[ 50%] Linking C shared library libTHS.dylib
[100%] Built target THS
Install the project…
– Install configuration: β€œRelease”
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTHS.1.dylib
– Installing: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTHS.dylib
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/THS.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/THSGenerateAllTypes.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/THSGenerateFloatTypes.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/THSGenerateIntTypes.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/THSTensor.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/generic/THSTensor.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/generic/THSTensor.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/generic/THSTensorMath.c
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS/generic/THSTensorMath.h
Updating install_name for libTH.1.dylib
Updating install_name for libTHNN.1.dylib
Updating install_name for libTHS.1.dylib
– TH_LIBRARIES: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTH.1.dylib
– Try OpenMP C flag = [-fopenmp=libomp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [ ]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-fopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [/openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-Qopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-xopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [+Oopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-qsmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP C flag = [-mp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-fopenmp=libomp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [ ]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-fopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [/openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-Qopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-openmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-xopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [+Oopenmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-qsmp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Try OpenMP CXX flag = [-mp]
– Performing Test OpenMP_FLAG_DETECTED
– Performing Test OpenMP_FLAG_DETECTED - Failed
– Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)
CMake Warning (dev) at CMakeLists.txt:61 (LINK_DIRECTORIES):
This command specifies the relative path

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run β€œcmake --help-policy CMP0015” for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

– THNN_SO_VERSION: 1
– Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run β€œcmake
–help-policy CMP0042” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

THNN

This warning is for project developers. Use -Wno-dev to suppress it.

– Generating done
– Build files have been written to: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THNN
[ 50%] Linking C shared library libTHNN.dylib
[100%] Built target THNN
Install the project…
– Install configuration: β€œRelease”
– Installing: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTHNN.1.dylib
– Installing: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTHNN.dylib
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THNN/THNN.h
– Up-to-date: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THNN/generic/THNN.h
Updating install_name for libTH.1.dylib
Updating install_name for libTHNN.1.dylib
Updating install_name for libTHS.1.dylib
– Removing -DNDEBUG from compile flags
– TH_LIBRARIES: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/lib/libTH.1.dylib
– MAGMA not found. Compiling without MAGMA support
– Automatic GPU detection failed. Building for common architectures.
– Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2;6.0;6.1;6.1+PTX
– got cuda version 8.0
– Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
– CUDA_NVCC_FLAGS: -DTH_INDEX_BASE=0 -I/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include -I/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/TH -I/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THC -I/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THS -I/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THCS -I/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/tmp_install/include/THPP;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_61,code=compute_61;-DCUDA_HAS_FP16=1
– THC_SO_VERSION: 1
– Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run β€œcmake
–help-policy CMP0042” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

THC

This warning is for project developers. Use -Wno-dev to suppress it.

– Generating done
– Build files have been written to: /Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC
[ 1%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o
[ 4%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o
[ 4%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o
[ 6%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o
[ 6%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o
[ 7%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o
[ 9%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o
[ 9%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o
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
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_THCSleep.cu.o.cmake:207 (message):
Error generating
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o

CMake Error at THC_generated_THCTensor.cu.o.cmake:207 (message):
Error generating
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensor.cu.o

CMake Error at THC_generated_THCStorageCopy.cu.o.cmake:207 (message):
Error generating
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCStorageCopy.cu.o

CMake Error at THC_generated_THCTensorCopy.cu.o.cmake:207 (message):
Error generating
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o

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_THCStorage.cu.o.cmake:207 (message):
Error generating
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCStorage.cu.o

make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o] Error 1
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o] Error 1
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o] Error 1
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
Error generating
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o

make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o] Error 1
nvcc fatal : The version (β€˜80100’) of the host compiler (β€˜Apple clang’) is not supported
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
Error generating
/Users/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o

make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
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/zzhao/Desktop/pytorch-master/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o

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

I’ve seen that the nvcc fatal error is due to having the wrong Xcode CLT version (https://github.com/arrayfire/arrayfire/issues/1384) . So I tried switching to Xcode CLT 7.3β€”however, I still get the same errors when running setup.py.

As of right now, I have CUDA 8.0.83, OS 10.12.5, Apple LLVM Version 8.0.0, and Xcode 8.2 and I’m still having trouble getting torch.cuda.is_available() to return true. Any further help would be appreciated!


(Spruce Bondera) #6

You should be almost there. This is effectively what I did as well, although I only had to downgrade from Xcode 8.3 to 8.2 (and the same should be true for you with CUDA 8.0.83). What exactly do you get when you run clang --version? You did run xcode-select right?


#7

When I run clang --version, I have:

clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode_8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I’ve also ran β€œsudo xcode-select -s /Applications/Xcode_8.2.app/Contents/Developer”.


#8

Sprucebβ€”thanks for your help on this topic btw. It seems that this issue will remain unsolved for the time being. Hopefully someone else can work through this issue in the future. Cheers.


(Joo Sung Yoon) #9

I have also same issues… T_T


#10

Any updates on this ? Thanks.


#11

Unfortunately, no. I ultimately ended up installing PyTorch on Ubuntu 16.04.

Zhen (Tony) Zhao
Research Engineer, Virtual Driver Systems, Autonomous Vehicles and Robotics
Ford Motor Company, Dearborn MI

Semper Fidelis


#12

Thanks for the fast reply.

Just as a side thought, β€œ10.9” found in this line:
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install

isn’t true for all machines. Since you are using Mac OS 10.12.x, it must be changed to 10.12, not 10.9

Could you see if this will do it?

EDIT: Actually, it worked for me. torch.cuda.is_available() now prints β€œTrue”.
I also updated my NVIDIA drivers.