MhLiao / MaskTextSpotterV3

The code of "Mask TextSpotter v3: Segmentation Proposal Network for Robust Scene Text Spotting"
Other
622 stars 122 forks source link

error: command '/usr/bin/nvcc' failed with exit status 1 #42

Open ily-R opened 3 years ago

ily-R commented 3 years ago

Hello,

When running apex command python setup.py install --cuda_ext --cpp_ext I get the following error error: command '/usr/bin/nvcc' failed with exit status 1

I checked some solutions and I removed the cpp part and only did python setup.py install it worked and I got through.

Now when I try to build Masktextspotter with python setup.py build develop I get the same error again error: command '/usr/bin/nvcc' failed with exit status 1

I tried:

def line_prepender(filename, line):
    with open(filename, 'r+') as f:
        content = f.read()
        f.seek(0, 0)
        f.write(line.rstrip('\r\n') + '\n' + content)

file1 = r"MaskTextSpotterV3/maskrcnn_benchmark/csrc/cuda/deform_conv_cuda.cu"
file2 = r"MaskTextSpotterV3/maskrcnn_benchmark/csrc/cuda/deform_pool_cuda.cu"

to_add = """#ifndef AT_CHECK
#define AT_CHECK TORCH_CHECK 
#endif"""

line_prepender(filename=file1, line=to_add)
line_prepender(filename=file2, line=to_add)

But didnt solve the issue.

Here's my system details:

cudatoolkit: 10.0.130
Pytorch: 1.4.0
Python: 3.6.9
GCC: 7.3.0
$which gcc
/usr/bin/gcc
$which nvcc
/usr/bin/nvcc
$nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
$which g++
/usr/bin/g++
$which make
/usr/bin/make
vendor   : NVIDIA Corporation
model    : GP107M [GeForce GTX 1050 Mobile]
driver   : nvidia-driver-450

I also should mention that I was having this error raised when I was trying to install apex:

"Cuda extensions are being compiled with a version of Cuda that does " +
                           "not match the version used to compile Pytorch binaries.  " +
                           "Pytorch binaries were compiled with Cuda {}.\n".format(torch.version.cuda) +
                           "In some cases, a minor-version mismatch will not cause later errors:  " +
                           "https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  "
                           "You can try commenting out this check (at your own risk)."

So I just commented the check to avoid this. if (bare_metal_major != torch_binary_major) or (bare_metal_minor != torch_binary_minor):

Any ideas on the source of this error error: command '/usr/bin/nvcc' failed with exit status 1 ?

Thank you

TuanBC commented 3 years ago

The nvcc is not depend on the cudatoolkit package from conda. In this case, I highly suspect that nvcc is from CUDA 9, which is not compatible to build the Masktextspotter. Try reinstalling the CUDA 10.0 to you system (or even 10.2 is ok, just make sure to match the pytorch version you are using)

https://developer.nvidia.com/cuda-10.0-download-archive