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

python setup.py bdist_wheel failed #241

Closed
GYE19970220 opened this issue Oct 20, 2020 · 14 comments
Closed

python setup.py bdist_wheel failed #241

GYE19970220 opened this issue Oct 20, 2020 · 14 comments

Comments

@GYE19970220
Copy link

First of all, thank you very much for your code.I have a problem when running the command python setup.py bdist_wheel .Although I followed the instructions in #78 and #70 by @MartinHahner, #21, #167 , it did not work.Then I rummaged through almost all the problems, but I didn’t solve it.I would appreciate it if you can help me.My environment is as follows:
OS version:Ubuntu 18.04
GPU name:TITAN V
CUDA version:9.2
Pytorch:1.1
Python:3.6
gcc version:7.5.0

image
image
image
image

running bdist_wheel
running build
running build_py
running build_ext
/home/gye/PointCloud/objectDetection/spconv_8da6f96/build/lib.linux-x86_64-3.6
Release
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /home/gye/anaconda3/envs/cuda92/bin/nvcc
-- Check for working CUDA compiler: /home/gye/anaconda3/envs/cuda92/bin/nvcc -- broken
CMake Error at /home/gye/.local/lib/python3.6/site-packages/cmake/data/share/cmake-3.13/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler

"/home/gye/anaconda3/envs/cuda92/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_cd192/fast"
/usr/bin/make -f CMakeFiles/cmTC_cd192.dir/build.make CMakeFiles/cmTC_cd192.dir/build
make[1]: 进入目录“/home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp”
Building CUDA object CMakeFiles/cmTC_cd192.dir/main.cu.o
/home/gye/anaconda3/envs/cuda92/bin/nvcc    "--expt-relaxed-constexpr"    -x cu -c /home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_cd192.dir/main.cu.o
Linking CUDA device code CMakeFiles/cmTC_cd192.dir/cmake_device_link.o
/home/gye/.local/lib/python3.6/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cd192.dir/dlink.txt --verbose=1
/home/gye/anaconda3/envs/cuda92/bin/nvcc  "--expt-relaxed-constexpr"    -shared -dlink CMakeFiles/cmTC_cd192.dir/main.cu.o -o CMakeFiles/cmTC_cd192.dir/cmake_device_link.o 
Linking CUDA executable cmTC_cd192
/home/gye/.local/lib/python3.6/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cd192.dir/link.txt --verbose=1
""   CMakeFiles/cmTC_cd192.dir/main.cu.o CMakeFiles/cmTC_cd192.dir/cmake_device_link.o -o cmTC_cd192 
Error running link command: No such file or directory
CMakeFiles/cmTC_cd192.dir/build.make:105: recipe for target 'cmTC_cd192' failed
make[1]: *** [cmTC_cd192] Error 2
make[1]: 离开目录“/home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp”
Makefile:121: recipe for target 'cmTC_cd192/fast' failed
make: *** [cmTC_cd192/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/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
See also "/home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 103, in
zip_safe=False,
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/site-packages/setuptools/init.py", line 163, in setup
return distutils.core.setup(**attrs)
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 290, in run
self.run_command('build')
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/gye/anaconda3/envs/spconv/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 71, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/home/gye/anaconda3/envs/spconv/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/gye/PointCloud/objectDetection/spconv_8da6f96', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/gye/PointCloud/objectDetection/spconv_8da6f96/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_PREFIX_PATH=/home/gye/anaconda3/envs/spconv/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_CUDA_COMPILER:FILEPATH=/home/gye/anaconda3/envs/cuda92/bin/nvcc']' returned non-zero exit status 1.

@MartinHahner
Copy link

MartinHahner commented Oct 20, 2020

Have you tried the instructions mentioned in #152?

I hope the Titan V with its Volta architecture (quite rare - see here) is not the issue.

@GYE19970220
Copy link
Author

Have you tried the instructions mentioned in #152?

I hope the Titan V with its Volta architecture (quite rare - see here) is not the issue.
Thanks for your reply, I have tried. But it still doesn't work

@MartinHahner
Copy link

Do you have the possibility to try and run python setup.py bdist_wheel on a different GPU?
As I said, I don't know if the Titan V with its Volta architecture could be also an issue.

@GYE19970220
Copy link
Author

您是否有可能尝试python setup.py bdist_wheel在其他GPU上运行?
如我所说,我不知道带有Volta架构的Titan V是否也会成为问题。

Probably not, our lab only have TITAN V.

@GYE19970220
Copy link
Author

GYE19970220 commented Oct 20, 2020

Do you have the possibility to try and run python setup.py bdist_wheel on a different GPU?
As I said, I don't know if the Titan V with its Volta architecture could be also an issue.

Besides Titan V with its Volta architecture,Any other problems?
Like my cuda installation path is /home/gye/anaconda3/envs/cuda92,but the step CUDA_ROOT=<path_to_your_conda_installation>/envs/spconv python setup.py bdist_wheel includes "../envs/spconv"
where does not exist cuda.

@MartinHahner
Copy link

If you named your conda environment cuda92, you have to run

CUDA_ROOT=/home/gye/anaconda3/envs/cuda92 python setup.py bdist_wheel
instead of
CUDA_ROOT=/home/gye/anaconda3/envs/spconv python setup.py bdist_wheel

Which command did you run?

@GYE19970220
Copy link
Author

If you named your conda environment cuda92, you have to run

CUDA_ROOT=/home/gye/anaconda3/envs/cuda92 python setup.py bdist_wheel
instead of
CUDA_ROOT=/home/gye/anaconda3/envs/spconv python setup.py bdist_wheel

Which command did you run?

Yes,I run the first command.But it doesn't work.

@MartinHahner
Copy link

Sorry, I am out of ideas.

@GYE19970220
Copy link
Author

Sorry, I am out of ideas.

It's OK,I will try other ways like change cuda version.Thanks a lot.

@GYE19970220
Copy link
Author

GYE19970220 commented Oct 20, 2020

Sorry to bother again,I check the file CMakeError.log,found the error g++: error: unrecognized command line option ‘-std=c++14’,The full content is as follows,Could it be related to this?@MartinHahner
`Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler: /home/gye/anaconda3/envs/cuda92/bin/nvcc
Build flags:
Id flags: -v;--keep;--keep-dir;tmp

The output was:
1
#$ SPACE=
#$ CUDART=cudart
#$ HERE=/home/gye/anaconda3/envs/cuda92/bin
#$ THERE=/home/gye/anaconda3/envs/cuda92/bin
#$ TARGET_SIZE=
#$ TARGET_DIR=
#$ TARGET_SIZE=64
#$ TOP=/home/gye/anaconda3/envs/cuda92/bin/..
#$ NVVMIR_LIBRARY_DIR=/home/gye/anaconda3/envs/cuda92/bin/../nvvm/libdevice
#$ LD_LIBRARY_PATH=/home/gye/anaconda3/envs/cuda92/bin/../lib:/home/gye/anaconda3/envs/cuda92/lib:
#$ PATH=/home/gye/anaconda3/envs/cuda92/bin/../nvvm/bin:/home/gye/anaconda3/envs/cuda92/bin:/home/gye/.local/bin:/home/gye/anaconda3/envs/cuda92/bin:/home/gye/anaconda3/envs/spconv-1.0/bin:/home/gye/anaconda3/condabin:/home/city945/software/libtorch-cxx11-abi-shared-with-deps-1.4.0/libtorch/lib:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
#$ INCLUDES="-I/home/gye/anaconda3/envs/cuda92/bin/..//include"
#$ LIBRARIES= "-L/home/gye/anaconda3/envs/cuda92/bin/..//lib64/stubs" "-L/home/gye/anaconda3/envs/cuda92/bin/..//lib64"
#$ CUDAFE_FLAGS=
#$ PTXAS_FLAGS=
#$ rm tmp/a_dlink.reg.c
#$ gcc -std=c++14 -D__CUDA_ARCH__=300 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__ "-I/home/gye/anaconda3/envs/cuda92/bin/..//include" -D"CUDACC_VER_BUILD=148" -D"CUDACC_VER_MINOR=2" -D"CUDACC_VER_MAJOR=9" -include "cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" > "tmp/CMakeCUDACompilerId.cpp1.ii"
#$ cicc --c++14 --gnu_version=70500 --allow_managed -arch compute_30 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "CMakeCUDACompilerId.fatbin.c" -tused -nvvmir-library "/home/gye/anaconda3/envs/cuda92/bin/../nvvm/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "tmp/CMakeCUDACompilerId.module_id" --orig_src_file_name "CMakeCUDACompilerId.cu" --gen_c_file_name "tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name "tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name "tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o "tmp/CMakeCUDACompilerId.ptx"
#$ ptxas -arch=sm_30 -m64 "tmp/CMakeCUDACompilerId.ptx" -o "tmp/CMakeCUDACompilerId.sm_30.cubin"
#$ fatbinary --create="tmp/CMakeCUDACompilerId.fatbin" -64 "--image=profile=sm_30,file=tmp/CMakeCUDACompilerId.sm_30.cubin" "--image=profile=compute_30,file=tmp/CMakeCUDACompilerId.ptx" --embedded-fatbin="tmp/CMakeCUDACompilerId.fatbin.c" --cuda
#$ gcc -std=c++14 -E -x c++ -D__CUDACC__ -D__NVCC__ "-I/home/gye/anaconda3/envs/cuda92/bin/..//include" -D"CUDACC_VER_BUILD=148" -D"CUDACC_VER_MINOR=2" -D"CUDACC_VER_MAJOR=9" -include "cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" > "tmp/CMakeCUDACompilerId.cpp4.ii"
#$ cudafe++ --c++14 --gnu_version=70500 --allow_managed --m64 --parse_templates --gen_c_file_name "tmp/CMakeCUDACompilerId.cudafe1.cpp" --stub_file_name "CMakeCUDACompilerId.cudafe1.stub.c" --module_id_file_name "tmp/CMakeCUDACompilerId.module_id" "tmp/CMakeCUDACompilerId.cpp4.ii"
#$ gcc -std=c++14 -D__CUDA_ARCH__=300 -c -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS "-I/home/gye/anaconda3/envs/cuda92/bin/..//include" -m64 -o "tmp/CMakeCUDACompilerId.o" "tmp/CMakeCUDACompilerId.cudafe1.cpp"
#$ nvlink --arch=sm_30 --register-link-binaries="tmp/a_dlink.reg.c" -m64 "-L/home/gye/anaconda3/envs/cuda92/bin/..//lib64/stubs" "-L/home/gye/anaconda3/envs/cuda92/bin/..//lib64" -cpu-arch=X86_64 "tmp/CMakeCUDACompilerId.o" -o "tmp/a_dlink.sm_30.cubin"
#$ fatbinary --create="tmp/a_dlink.fatbin" -64 -link "--image=profile=sm_30,file=tmp/a_dlink.sm_30.cubin" --embedded-fatbin="tmp/a_dlink.fatbin.c"
#$ gcc -std=c++14 -c -x c++ -DFATBINFILE=""tmp/a_dlink.fatbin.c"" -DREGISTERLINKBINARYFILE=""tmp/a_dlink.reg.c"" -I. -D__NV_EXTRA_INITIALIZATION= -D__NV_EXTRA_FINALIZATION= "-I/home/gye/anaconda3/envs/cuda92/bin/..//include" -D"CUDACC_VER_BUILD=148" -D"CUDACC_VER_MINOR=2" -D"CUDACC_VER_MAJOR=9" -m64 -o "tmp/a_dlink.o" "/home/gye/anaconda3/envs/cuda92/bin/crt/link.stub"
#$ g++ -m64 -o "a.out" -std=c++14 -Wl,--start-group "tmp/a_dlink.o" "tmp/CMakeCUDACompilerId.o" "-L/home/gye/anaconda3/envs/cuda92/bin/..//lib64/stubs" "-L/home/gye/anaconda3/envs/cuda92/bin/..//lib64" -lcudadevrt -lcudart_static -lrt -lpthread -ldl -Wl,--end-group
g++: error: unrecognized command line option ‘-std=c++14’

--error 0x1 --

Determining if the CUDA compiler works failed with the following output:
Change Dir: /home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f8316/fast"
/usr/bin/make -f CMakeFiles/cmTC_f8316.dir/build.make CMakeFiles/cmTC_f8316.dir/build
make[1]: 进入目录“/home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp”
Building CUDA object CMakeFiles/cmTC_f8316.dir/main.cu.o
/home/gye/anaconda3/envs/cuda92/bin/nvcc "--expt-relaxed-constexpr" -x cu -c /home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_f8316.dir/main.cu.o
Linking CUDA device code CMakeFiles/cmTC_f8316.dir/cmake_device_link.o
/home/gye/.local/lib/python3.6/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f8316.dir/dlink.txt --verbose=1
/home/gye/anaconda3/envs/cuda92/bin/nvcc "--expt-relaxed-constexpr" -shared -dlink CMakeFiles/cmTC_f8316.dir/main.cu.o -o CMakeFiles/cmTC_f8316.dir/cmake_device_link.o
Linking CUDA executable cmTC_f8316
/home/gye/.local/lib/python3.6/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f8316.dir/link.txt --verbose=1
"" CMakeFiles/cmTC_f8316.dir/main.cu.o CMakeFiles/cmTC_f8316.dir/cmake_device_link.o -o cmTC_f8316
Error running link command: No such file or directory
CMakeFiles/cmTC_f8316.dir/build.make:105: recipe for target 'cmTC_f8316' failed
make[1]: *** [cmTC_f8316] Error 2
make[1]: 离开目录“/home/gye/PointCloud/objectDetection/spconv_8da6f96/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp”
Makefile:121: recipe for target 'cmTC_f8316/fast' failed
make: *** [cmTC_f8316/fast] Error 2
`

@MartinHahner
Copy link

Compiler: /usr/local/cuda-10.0/bin/nvcc

This does not reflect the path from above:
CUDA_ROOT=/home/gye/anaconda3/envs/cuda92

On a more general note, it is hard to make sense out of your last post. Perhaps it would be helpful to have more context.

Maybe you can try to make a more structured post, such as this one for example. It seems very related to the issue mentioned there, so please make sure you followed all the steps mentioned there correctly. Maybe you also have to adjust other things (as pointed out further down in that thread).

@GYE19970220
Copy link
Author

Sorry,I changed the cuda version to have a try.I have updated my last post which reflects the path CUDA_ROOT=/home/gye/anaconda3/envs/cuda92.
My gcc version is 7.5.0,but g++ version is 4.8.5.It looks like the g++ version is too low.
I will continue to try it.
image

@GYE19970220
Copy link
Author

It is caused by the version of g++.When I change the g++ version from 4.8.5 to 7,it was solved.So the error that "g++: error: unrecognized command line option ‘-std=c++14’" means the version of g++ is too low,because -std=c++14 requires g++5.2 or more.

@sidml
Copy link

sidml commented Nov 9, 2021

Putting my solution for reference.

File "/opt/conda/lib/python3.7/site-packages/spconv/conv.py", line 181, in forward
use_hash=self.use_hash)
File "/opt/conda/lib/python3.7/site-packages/spconv/ops.py", line 95, in get_indice_pairs
int(use_hash))
ValueError: /home/sid/spconv/src/spconv/spconv_ops.cc 87
unknown device type

I got this error because I had previously compiled a different version of spconv and was reusing the build folder. Removing the build folder and building the wheel again from scratch solved the issue.

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

3 participants