Hanqer / deep-hough-transform

Jittor and Pytorch code for paper "Deep Hough Transform for Semantic Line Detection" (ECCV 2020, PAMI 2021)
344 stars 71 forks source link

python setup.py build error #16

Closed arhken666 closed 3 years ago

arhken666 commented 3 years ago

When I run python setup.py build to install deep_hough, it got a error problem, what should i do to this ,the error is below. thank you.

deep_hough_cuda_kernel.cu(77): error: calling a constexpr __host__ function("round") from a __global__ function("line_accum_forward_kernel") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

deep_hough_cuda_kernel.cu(148): error: calling a constexpr __host__ function("round") from a __global__ function("line_accum_backward_kernel") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00009123_00000000-6_deep_hough_cuda_kernel.cpp1.ii".
error: command '/usr/local/cuda-9.0/bin/nvcc' failed with exit status 1`
zeakey commented 3 years ago

Please provide your environment. You can get it by running the command below and copy the output.

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
arhken666 commented 3 years ago
PyTorch version: 1.0.1.post2
Is debug build: False
CUDA used to build PyTorch: 9.0.176
ROCM used to build PyTorch: N/A

OS: Ubuntu 16.04.4 LTS (x86_64)
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Clang version: Could not collect
CMake version: version 3.5.1
Libc version: glibc-2.17

Python version: 3.6.13 |Anaconda, Inc.| (default, Jun  4 2021, 14:25:59)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-4.15.0-142-generic-x86_64-with-debian-stretch-sid
Is CUDA available: True
CUDA runtime version: 9.0.176
GPU models and configuration: 
GPU 0: GeForce GTX 1080 Ti
GPU 1: GeForce GTX 1080 Ti

Nvidia driver version: 450.80.02
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.0.5
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn.so.8.0.4
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.0.4
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.0.4
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.0.4
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.0.4
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.0.4
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.0.4
/usr/local/cuda-8.0/lib64/libcudnn.so.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.17.0
[pip3] torch==1.0.1.post2
[pip3] torchvision==0.2.2
[conda] cudatoolkit               9.0                  h13b8566_0  
[conda] mkl                       2021.2.0           h06a4308_296  
[conda] numpy                     1.17.0           py36h99e49ec_0  
[conda] numpy-base                1.17.0           py36h2f8d375_0  
[conda] pytorch                   1.0.1           py3.6_cuda9.0.176_cudnn7.4.2_2    pytorch
[conda] torchvision               0.2.2                      py_3    pytorch

the above result from running python collect_env.py. thank you

zeakey commented 3 years ago

@Hanqer any suggestions? One possible problem is that your cuda runtime version is low. Here I successfully compiled with CUDA11. I think CUDA10 is also ok.

Hanqer commented 3 years ago

I think this error occurs because of the different CUDA versions. But I haven't met this problem. Maybe it can be solved by add '--expt-relaxed-constexpr' to the NVCC compiler.

arhken666 commented 3 years ago

I think this error occurs because of the different CUDA versions. But I haven't met this problem. Maybe it can be solved by add '--expt-relaxed-constexpr' to the NVCC compiler.

thank you ,I solve it by upgrading Cuda version to 10.2 and pytorch to 1.6, it finally run success.

HassanBinHaroon commented 2 years ago

Take a look at the following repository too.

https://github.com/HassanBinHaroon/deep-hough-transform