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

make.sh #10

Closed
lhlm1994 opened this issue Dec 10, 2020 · 18 comments
Closed

make.sh #10

lhlm1994 opened this issue Dec 10, 2020 · 18 comments

Comments

@lhlm1994
Copy link

when I run sh ./make.sh, I got this message:

Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/3] :/home1/hli/cuda10.2/bin/nvcc -DWITH_CUDA -I/home1/hli/Deformable-DETR/models/ops/src -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/TH -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/THC -I:/home1/hli/cuda10.2/include -I/home1/hli/anaconda3/envs/detr/include/python3.7m -c -c /home1/hli/Deformable-DETR/models/ops/src/cuda/ms_deform_attn_cuda.cu -o /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cuda/ms_deform_attn_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14
FAILED: /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cuda/ms_deform_attn_cuda.o
:/home1/hli/cuda10.2/bin/nvcc -DWITH_CUDA -I/home1/hli/Deformable-DETR/models/ops/src -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/TH -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/THC -I:/home1/hli/cuda10.2/include -I/home1/hli/anaconda3/envs/detr/include/python3.7m -c -c /home1/hli/Deformable-DETR/models/ops/src/cuda/ms_deform_attn_cuda.cu -o /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cuda/ms_deform_attn_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14
/bin/sh: 1: :/home1/hli/cuda10.2/bin/nvcc: not found
[2/3] c++ -MMD -MF /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.o.d -pthread -B /home1/hli/anaconda3/envs/detr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home1/hli/Deformable-DETR/models/ops/src -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/TH -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/THC -I:/home1/hli/cuda10.2/include -I/home1/hli/anaconda3/envs/detr/include/python3.7m -c -c /home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.cpp -o /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.o
c++ -MMD -MF /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.o.d -pthread -B /home1/hli/anaconda3/envs/detr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home1/hli/Deformable-DETR/models/ops/src -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/TH -I/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/THC -I:/home1/hli/cuda10.2/include -I/home1/hli/anaconda3/envs/detr/include/python3.7m -c -c /home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.cpp -o /home1/hli/Deformable-DETR/models/ops/build/temp.linux-x86_64-3.7/home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home1/hli/Deformable-DETR/models/ops/src/cpu/ms_deform_attn_cpu.cpp:14:0:
/home1/hli/anaconda3/envs/detr/lib/python3.7/site-packages/torch/include/ATen/cuda/CUDAContext.h:5:30: fatal error: cuda_runtime_api.h: No such file or directory
compilation terminated.

my Cuda version is 10.2.89, the other settings are the same as yours, torch 1.5.1 python3.7. Can you help me? thanks

@jackroos
Copy link
Member

Hi @lhlm1994

Could you check whether your PyTorch is successfully installed with CUDA support by running the following scripts in python:

import torch
print(torch.cuda.is_available())

@lhlm1994
Copy link
Author

Hi @lhlm1994

Could you check whether your PyTorch is successfully installed with CUDA support by running the following scripts in python:

import torch
print(torch.cuda.is_available())

yes, it is available, maybe only cuda9.2 works?

@jackroos
Copy link
Member

Do you add CUDA 'lib64' path to $LD_LIBRARY_PATH? And do you add CUDA 'bin' path to $PATH?
You can check by:

echo $PATH
echo $LD_LIBRARY_PATH

@lhlm1994
Copy link
Author

```shell
echo $LD_LIBRARY_PATH

echo $LD_LIBRARY_PATH
/home1/hli/cuda10.2/lib64:/usr/local/cuda-10.0/lib64:/home1/hli/cuda10.2/lib64

(detr) hli@miracle:~/Deformable-DETR/models/ops$ echo $PATH
/home1/hli/cuda10.2/bin:/home1/hli/bin:/home1/hli/.local/bin:/home1/hli/cuda10.2/bin:/home1/hli/anaconda3/envs/detr/bin:/home1/hli/anaconda3/condabin:/usr/local/cuda-10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

yes, I added. >_<!

@lhlm1994
Copy link
Author

icant find these files :/cpu/ms_deform_attn_cpu.o and /ops/src/cuda/ms_deform_attn_cuda.o: can you add them?

@jackroos
Copy link
Member

The .o file is generated in the compiling stage.

@yunren
Copy link

yunren commented Dec 15, 2020

Do you solve it? How? I met same problem too

@JarintotionDin
Copy link

JarintotionDin commented Dec 22, 2020

I met this problem too, and I solved it by changing 'CUDA_HOME=CUDA_HOME:/usr/local/cuda-11.0' to 'export CUDA_HOME=/usr/local/cuda-11.0'.
if torch.cuda.is_available() and CUDA_HOME is not None:
extension = CUDAExtension
sources += source_cuda
define_macros += [("WITH_CUDA", None)]
extra_compile_args["nvcc"] = [
"-DCUDA_HAS_FP16=1",
"-D__CUDA_NO_HALF_OPERATORS__",
"-D__CUDA_NO_HALF_CONVERSIONS__",
"-D__CUDA_NO_HALF2_OPERATORS__",
]
else:
raise NotImplementedError('Cuda is not availabel')

When I use 'CUDA_HOME=CUDA_HOME:/usr/local/cuda-11.0' , the CUDA_HOME is None!

@yunren
Copy link

yunren commented Dec 23, 2020

I met this problem too, and I solved it by changing 'CUDA_HOME=CUDA_HOME:/usr/local/cuda-11.0' to 'export CUDA_HOME=/usr/local/cuda-11.0'.
if torch.cuda.is_available() and CUDA_HOME is not None:
extension = CUDAExtension
sources += source_cuda
define_macros += [("WITH_CUDA", None)]
extra_compile_args["nvcc"] = [
"-DCUDA_HAS_FP16=1",
"-D__CUDA_NO_HALF_OPERATORS__",
"-D__CUDA_NO_HALF_CONVERSIONS__",
"-D__CUDA_NO_HALF2_OPERATORS__",
]
else:
raise NotImplementedError('Cuda is not availabel')

When I use 'CUDA_HOME=CUDA_HOME:/usr/local/cuda-11.0' , the CUDA_HOME is None!

So nice!
my problem is also solved just as you do.

@jackroos
Copy link
Member

@JarintotionDin Thank you for sharing the solution. Since the problem is solved, I will close this issue.

@kuiran
Copy link

kuiran commented Mar 6, 2021

Great! It works.

@wsz912
Copy link

wsz912 commented Apr 26, 2021

It works.

@ts-kim
Copy link

ts-kim commented May 22, 2021

export CUDA_HOME=/usr/local/cuda-11.0
sh make.sh

It works! Thank you for nice solution.

@makabakasu
Copy link

export CUDA_HOME=/usr/local/cuda-11.0
sh make.sh
it works~ Thanks!

@everRoc
Copy link

everRoc commented Aug 31, 2021

thank you so much!

@XDhughie
Copy link

XDhughie commented Jun 9, 2022

g++: error: /home/lh/trackformer-main/src/trackformer/models/ops/build/temp.linux-x86_64-3.7/home/lh/trackformer-main/src/trackformer/models/ops/src/cpu/ms_deform_attn_cpu.o: No such file or directory
g++: error: /home/lh/trackformer-main/src/trackformer/models/ops/build/temp.linux-x86_64-3.7/home/lh/trackformer-main/src/trackformer/models/ops/src/vision.o: No such file or directory

still error,how to do with that?

@MichaelWangl
Copy link

it works!thank you~

@FocusGZL
Copy link

g++: error: /home/lh/trackformer-main/src/trackformer/models/ops/build/temp.linux-x86_64-3.7/home/lh/trackformer-main/src/trackformer/models/ops/src/cpu/ms_deform_attn_cpu.o: No such file or directory g++: error: /home/lh/trackformer-main/src/trackformer/models/ops/build/temp.linux-x86_64-3.7/home/lh/trackformer-main/src/trackformer/models/ops/src/vision.o: No such file or directory

still error,how to do with that?

have you resolved the problem?

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