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

Failed to build - CUDA compiler identification is unknown #72

Closed
themousepotato opened this issue Jul 28, 2019 · 3 comments
Closed

Failed to build - CUDA compiler identification is unknown #72

themousepotato opened this issue Jul 28, 2019 · 3 comments

Comments

@themousepotato
Copy link

Getting this error message when i tried to build:

navaneeth@mousebox:~/workspace/spconv$ python3 setup.py bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=/home/navaneeth/.local/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/navaneeth/workspace/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_BUILD_TYPE=Release']
-- The CXX compiler identification is GNU 7.4.0
-- The CUDA compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working CUDA compiler: /usr/local/bin/cmake
-- Check for working CUDA compiler: /usr/local/bin/cmake -- broken
CMake Error at /usr/local/share/cmake-3.15/Modules/CMakeTestCUDACompiler.cmake:46 (message):
  The CUDA compiler

    "/usr/local/bin/cmake"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make cmTC_03517/fast && /usr/bin/make -f CMakeFiles/cmTC_03517.dir/build.make CMakeFiles/cmTC_03517.dir/build
    make[1]: Entering directory '/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
    Building CUDA object CMakeFiles/cmTC_03517.dir/main.cu.o
    /usr/local/bin/cmake    "--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__    -x cu -c /home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_03517.dir/main.cu.o
    Parse error in command line argument: -D__CUDA_NO_HALF_OPERATORS__
    Should be: VAR:type=value
    CMake Error: No cmake script provided.
    CMake Error: Problem processing arguments. Aborting.
    
    CMakeFiles/cmTC_03517.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_03517.dir/main.cu.o' failed
    make[1]: *** [CMakeFiles/cmTC_03517.dir/main.cu.o] Error 1
    make[1]: Leaving directory '/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_03517/fast' failed
    make: *** [cmTC_03517/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
See also "/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 99, in <module>
    zip_safe=False,
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 204, in run
    self.run_command('build')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 40, in run
    self.build_extension(ext)
  File "setup.py", line 82, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/navaneeth/workspace/spconv', '-DCMAKE_PREFIX_PATH=/home/navaneeth/.local/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/navaneeth/workspace/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

I have environment variables in my ~/.bashrc as:

export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-10.1/lib64
export CUDA_BIN_PATH=/usr/local/cuda-10.1/bin
export CMAKE_CUDA_COMPILER=/usr/local/cuda-10.1/bin/gcc
export CUDACXX=/usr/local/cuda-10.1/bin
export CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.1

cmake version: 3.15.0
nvcc version: 10.1.168

@themousepotato
Copy link
Author

I tried with CUDA 9.2 and now the error modifies to:

(ts) navaneeth@mousebox:~/workspace/spconv$ python3 setup.py bdist_wheel
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/spconv
copying spconv/pool.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/conv.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/ops.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/modules.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/test_utils.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/__init__.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/functional.py -> build/lib.linux-x86_64-3.7/spconv
creating build/lib.linux-x86_64-3.7/spconv/utils
copying spconv/utils/__init__.py -> build/lib.linux-x86_64-3.7/spconv/utils
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=/home/navaneeth/anaconda3/envs/ts/lib/python3.7/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.7', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/navaneeth/workspace/spconv/build/lib.linux-x86_64-3.7/spconv', '-DCMAKE_BUILD_TYPE=Release']
-- The CXX compiler identification is GNU 7.4.0
-- The CUDA compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working CUDA compiler: /usr/local/cuda-9.2/bin
-- Check for working CUDA compiler: /usr/local/cuda-9.2/bin -- broken
CMake Error at /usr/local/share/cmake-3.15/Modules/CMakeTestCUDACompiler.cmake:46 (message):
  The CUDA compiler

    "/usr/local/cuda-9.2/bin"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make cmTC_14841/fast && /usr/bin/make -f CMakeFiles/cmTC_14841.dir/build.make CMakeFiles/cmTC_14841.dir/build
    make[1]: Entering directory '/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp'
    Building CUDA object CMakeFiles/cmTC_14841.dir/main.cu.o
    /usr/local/cuda-9.2/bin    "--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__    -x cu -c /home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_14841.dir/main.cu.o
    /bin/sh: 1: /usr/local/cuda-9.2/bin: Permission denied
    CMakeFiles/cmTC_14841.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_14841.dir/main.cu.o' failed
    make[1]: *** [CMakeFiles/cmTC_14841.dir/main.cu.o] Error 126
    make[1]: Leaving directory '/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_14841/fast' failed
    make: *** [cmTC_14841/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeOutput.log".
See also "/home/navaneeth/workspace/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 99, in <module>
    zip_safe=False,
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
    self.run_command('build')
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 40, in run
    self.build_extension(ext)
  File "setup.py", line 82, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "/home/navaneeth/anaconda3/envs/ts/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/navaneeth/workspace/spconv', '-DCMAKE_PREFIX_PATH=/home/navaneeth/anaconda3/envs/ts/lib/python3.7/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.7', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/navaneeth/workspace/spconv/build/lib.linux-x86_64-3.7/spconv', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

@themousepotato
Copy link
Author

Got it solved after pointing CUDA compiler to nvcc and using gcc-6.

@ecr23xx
Copy link

ecr23xx commented Aug 19, 2019

@themousepotato Could you please explain in details how you solved this problem? I've met the same compiling error with CUDA 10.0 + gcc 6.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants