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

RuntimeError: Error building extension '_prroi_pooling' #74

Open
wangqiangJN opened this issue Jun 22, 2022 · 2 comments
Open

RuntimeError: Error building extension '_prroi_pooling' #74

wangqiangJN opened this issue Jun 22, 2022 · 2 comments

Comments

@wangqiangJN
Copy link

/home/c506plus/anaconda3/envs/transt/bin/python3.7 /home/c506plus/wq/TransT/AlphaRefine/demo.py
Select a ROI and then press SPACE or ENTER button!
Cancel the selection process by pressing c button!
pumping /home/c506plus/wq/datasets/OTB2015/Basketball/img/0001.jpg
/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/nn/functional.py:2506: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
Using /tmp/torch_extensions as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /tmp/torch_extensions/prroi_pooling/build.ninja...
Building extension module prroi_pooling...
[1/3] :/usr/local/cuda-10.0/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/TH -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.0/include -isystem /home/c506plus/anaconda3/envs/transt/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
_ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_60,code=sm_60 --compiler-options '-fPIC' -std=c++11 -c /home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
FAILED: prroi_pooling_gpu_impl.cuda.o
:/usr/local/cuda-10.0/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/TH -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.0/include -isystem /home/c506plus/anaconda3/envs/transt/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_60,code=sm_60 --compiler-options '-fPIC' -std=c++11 -c /home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
/bin/sh: :/usr/local/cuda-10.0/bin/nvcc: 没有那个文件或目录
[2/3] c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/TH -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.0/include -isystem /home/c506plus/anaconda3/envs/transt/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
FAILED: prroi_pooling_gpu.o
c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/TH -isystem /home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.0/include -isystem /home/c506plus/anaconda3/envs/transt/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
In file included from /home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c:15:0:
/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/include/ATen/cuda/CUDAContext.h:5:30: fatal error: cuda_runtime_api.h: 没有那个文件或目录
compilation terminated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1066, in _build_extension_module
check=True)
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/c506plus/wq/TransT/AlphaRefine/demo.py", line 171, in
demo(base_path, ar_path, data_dir)
File "/home/c506plus/wq/TransT/AlphaRefine/demo.py", line 117, in demo
tracker = get_dimp(img, init_box, base_path)
File "/home/c506plus/wq/TransT/AlphaRefine/demo.py", line 93, in get_dimp
tracker.initialize(img, init_info)
File "/home/c506plus/wq/TransT/AlphaRefine/pytracking/tracker/dimp/dimp.py", line 84, in initialize
self.init_classifier(init_backbone_feat)
File "/home/c506plus/wq/TransT/AlphaRefine/pytracking/tracker/dimp/dimp.py", line 574, in init_classifier
compute_losses=plot_loss)
File "/home/c506plus/wq/TransT/AlphaRefine/ltr/models/target_classifier/linear_filter.py", line 97, in get_filter
weights = self.filter_initializer(feat, bb)
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/c506plus/wq/TransT/AlphaRefine/ltr/models/target_classifier/initializer.py", line 164, in forward
weights = self.filter_pool(feat, bb)
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/c506plus/wq/TransT/AlphaRefine/ltr/models/target_classifier/initializer.py", line 45, in forward
return self.prroi_pool(feat, roi1)
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/prroi_pool.py", line 28, in forward
return prroi_pool2d(features, rois, self.pooled_height, self.pooled_width, self.spatial_scale)
File "/home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 44, in forward
_prroi_pooling = _import_prroi_pooling()
File "/home/c506plus/wq/TransT/AlphaRefine/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 33, in _import_prroi_pooling
verbose=True
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 680, in load
is_python_module)
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 866, in _jit_compile
with_cuda=with_cuda)
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 919, in _write_ninja_file_and_build
_build_extension_module(name, build_directory, verbose)
File "/home/c506plus/anaconda3/envs/transt/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1079, in _build_extension_module
raise RuntimeError(message)
RuntimeError: Error building extension '_prroi_pooling'

Enviorment:cuda10.0,torch1.2.From previous issuse,I use git clone but not work.How can I fix this bug?

@vacancy
Copy link
Owner

vacancy commented Jun 24, 2022

error: cuda_runtime_api.h: 没有那个文件或目录
compilation terminated.

Can you check your cuda installation?

For example, can the examples in https://pytorch.org/tutorials/advanced/cpp_extension.html this tutorial compile?

@noreenanwar
Copy link

I am facing the same error.How to solve this?

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