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 error when complie spconv #21

Closed
Leeshihyeon opened this issue Feb 18, 2019 · 8 comments
Closed

nvcc error when complie spconv #21

Leeshihyeon opened this issue Feb 18, 2019 · 8 comments
Labels

Comments

@Leeshihyeon
Copy link

(python3.6) linux@linux-System-Product-Name:~/spconv$ python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
/home/linux/spconv/build/lib.linux-x86_64-3.6
Release
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /usr/bin/nvcc
-- Check for working CUDA compiler: /usr/bin/nvcc -- broken
CMake Error at /usr/local/share/cmake-3.13/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler

"/usr/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e0aa3/fast"
/usr/bin/make -f CMakeFiles/cmTC_e0aa3.dir/build.make CMakeFiles/cmTC_e0aa3.dir/build
make[1]: Entering directory '/home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_e0aa3.dir/main.cu.o
/usr/bin/nvcc    "--expt-relaxed-constexpr"    -x cu -c /home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_e0aa3.dir/main.cu.o
Internal error: assertion failed at: "/dvs/p4/build/sw/rel/gpu_drv/r384/r384_00/drivers/compiler/edg/EDG_4.12/src/cmd_line.c", line 10726


1 catastrophic error detected in this compilation.
Compilation aborted.
Aborted (core dumped)
CMakeFiles/cmTC_e0aa3.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_e0aa3.dir/main.cu.o' failed
make[1]: *** [CMakeFiles/cmTC_e0aa3.dir/main.cu.o] Error 134
make[1]: Leaving directory '/home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_e0aa3/fast' failed
make: *** [cmTC_e0aa3/fast] Error 2

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

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

@GIMPS
Copy link

GIMPS commented Mar 13, 2019

same

@traveller59
Copy link
Owner

@GIMPS I need to know your environment information to solve this problem:
system version, cuda version

@GIMPS
Copy link

GIMPS commented Mar 13, 2019

Thank you for replying. Excuse me for following up under open issues since I am still browsing through all issues for a solution.
In my case, I was using Linux + GCC 5.4.0 + CMAKE 3.13.4 + CUDA9.0 + PyTorch 1.0. Apparently the problem is about CMAKE failing to identify CUDA directory, whereas my nvcc works properly.
My guess is that this is a duplicate issue to #16 . However, modifying cmakelist did not work out for me.

@ZwwWayne
Copy link

I meet the same problem, and I make it success by simply add one line in the Cmakelist.txt
set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc")
This should be added before the line 5
'if (SPCONV_BuildCUDA)'
Because things goes wrong when you see
'-- The CUDA compiler identification is unknown'
during cmake, and this comes with the original line 6, which means the cmake can not identify the nvcc from the start.

Hope it helps

@vetsasai
Copy link

vetsasai commented Nov 22, 2022

I am facing the same exact issue and unable to resolve by adding this line set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc") in CMakeLists.txt

Could you please help me if its the right approach or if I have to try any other thing?


cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(SparseConv LANGUAGES CXX CUDA VERSION 1.0)

option(SPCONV_BuildTests "Build the unit tests when BUILD_TESTING is enabled." OFF)
set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc")
set(CMAKE_CXX_EXTENSIONS OFF) # avoid gnu++11 be added to CXX flags

set(CUDA_TOOLKIT_ROOT_DIR "${CMAKE_CUDA_COMPILER}")
get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR}" DIRECTORY)
get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR}" DIRECTORY)
if(WIN32) # true if windows (32 and 64 bit)
    set(CUDA_LIB_PATH_HINTS "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64")
    add_compile_definitions(TV_WINDOWS)
 else()
    set(CUDA_LIB_PATH_HINTS "${CUDA_TOOLKIT_ROOT_DIR}/lib64")
 endif()

@madanmch
Copy link

@vetsasai could you able to resolve this issue finally? I have the same problem now.

@vetsasai
Copy link

@madanmch that issue wasn't resolved. I tried with different CUDA version and it seemed to work but I faced some other errors after that. So we changed our approach which doesn't involve spconv.

Try using compatible CUDA/UBUNTU versions.

@hotpotWithoutHemorrhoids
Copy link

hotpotWithoutHemorrhoids commented Nov 11, 2024

i has meet the same problem, but failed by trying set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc") . solve it by add " -DCMAKE_CUDA_COMPILER=`which nvcc` " while execute cmake .. command. like: "cmake .. -DCMAKE_CUDA_COMPILER=`which nvcc` "

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

No branches or pull requests

7 participants