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

An error occurred while running setup.py #4

Closed
bring728 opened this issue Feb 24, 2021 · 6 comments
Closed

An error occurred while running setup.py #4

bring728 opened this issue Feb 24, 2021 · 6 comments

Comments

@bring728
Copy link

First of all, thank you for sharing this project code.


python setup.py build_ext --inplace

generate generated/map_to_list_nn_cpu.cpp
generate generated/map_to_list_nn_cuda.cpp
generate generated/map_to_list_nn_kernel.cu
generate generated/map_to_list_bl_cpu.cpp
generate generated/map_to_list_bl_cuda.cpp
generate generated/map_to_list_bl_kernel.cu
generate generated/map_to_list_bl_seq_cpu.cpp
generate generated/map_to_list_bl_seq_cuda.cpp
generate generated/map_to_list_bl_seq_kernel.cu
generate generated/list_to_map_cpu.cpp
generate generated/list_to_map_cuda.cpp
generate generated/list_to_map_kernel.cu
generate generated/ext_cpu.cpp
generate generated/ext_cuda.cpp
generate generated/ext_kernel.cu
generate generated_ext.py
running build_ext
building 'ext_cpu' extension
creating /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build
creating /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8
Emitting ninja build file /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/1] c++ -MMD -MF /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_cpu.o.d -pthread -B /home/vig-titan2/anaconda3/envs/SVS/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/TH -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/THC -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/include -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/generated -I/home/vig-titan2/anaconda3/envs/SVS/include/python3.8 -c -c /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/ext_cpu.cpp -o /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=ext_cpu -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 /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:149:0,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/include/torch_common.h:3,
from /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/ext_cpu.cpp:1:
/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/ATen/ParallelOpenMP.h:84:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
#pragma omp parallel for if ((end - begin) >= grain_size)

creating build/lib.linux-x86_64-3.8
g++ -pthread -shared -B /home/vig-titan2/anaconda3/envs/SVS/compiler_compat -L/home/vig-titan2/anaconda3/envs/SVS/lib -Wl,-rpath=/home/vig-titan2/anaconda3/envs/SVS/lib -Wl,--no-as-needed -Wl,--sysroot=/ /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_cpu.o -L/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -o build/lib.linux-x86_64-3.8/ext_cpu.cpython-38-x86_64-linux-gnu.so
building 'ext_cuda' extension
Emitting ninja build file /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] c++ -MMD -MF /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_cuda.o.d -pthread -B /home/vig-titan2/anaconda3/envs/SVS/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/TH -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-10.1/include -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/include -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/generated -I/home/vig-titan2/anaconda3/envs/SVS/include/python3.8 -c -c /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/ext_cuda.cpp -o /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=ext_cuda -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 /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:149:0,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
from /home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/include/torch_common.h:3,
from /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/ext_cuda.cpp:1:
/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/ATen/ParallelOpenMP.h:84:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
#pragma omp parallel for if ((end - begin) >= grain_size)

[2/2] /usr/local/cuda-10.1/bin/nvcc -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/TH -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-10.1/include -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/include -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/generated -I/home/vig-titan2/anaconda3/envs/SVS/include/python3.8 -c -c /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/ext_kernel.cu -o /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -arch=sm_30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=sm_35 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=ext_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_kernel.o
/usr/local/cuda-10.1/bin/nvcc -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/TH -I/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-10.1/include -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/include -I/home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/generated -I/home/vig-titan2/anaconda3/envs/SVS/include/python3.8 -c -c /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/ext_kernel.cu -o /home/vig-titan2/PycharmProjects/SVS/StableViewSynthesis/ext/mytorch/build/temp.linux-x86_64-3.8/ext_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -arch=sm_30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=sm_35 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=ext_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/ATen/record_function.h(18): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/profiler.h(97): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/profiler.h(126): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/enum.h(187): warning: statement is unreachable

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/ATen/record_function.h(18): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/profiler.h(97): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/profiler.h(126): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/enum.h(187): warning: statement is unreachable

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/ATen/record_function.h(18): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/enum.h(187): warning: statement is unreachable

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/profiler.h(97): warning: attribute "visibility" does not apply here

/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/profiler.h(126): warning: attribute "visibility" does not apply here

/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28: required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5042:20: required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5063:24: required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134: required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6688:95: required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’ without object
__p->_M_set_sharable();
~~~~~~~~~^~
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28: required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5042:20: required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5063:24: required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134: required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6693:95: required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1509, in _run_ninja_build
subprocess.run(
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
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 "setup.py", line 226, in
setup(
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 649, in build_extensions
build_ext.build_extensions(self)
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
_build_ext.build_extension(self, ext)
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
objects = self.compiler.compile(sources,
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 469, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1228, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/vig-titan2/anaconda3/envs/SVS/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1529, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error compiling objects for extension


It's ubuntu 18.04 and cuda 10.1 on pytorch 1.6. I followed the instructions, but I got this error. Can someone help me?

@alexanderbergman7
Copy link

I get the same issue. Have you resolved this?

@bring728
Copy link
Author

bring728 commented Mar 3, 2021

No.. It failed on my local ubuntu, so I just made a docker and tried it and it worked.

@NSavov
Copy link

NSavov commented Mar 4, 2021

@bring728 Thanks! On my ubuntu ninja fails with a different compile error, but setting it up in docker also worked for me. In the docker no ninja was available so setup happened "the slow way" which may have something to do with why it was successful. It may be useful if a working conda environment is shared in the repo through a yml file for an easier setup.

To make it easier for others here are my docker files:

Dockerfile

FROM nvidia/cuda:10.1-cudnn7-devel

ENV DEBIAN_FRONTEND=noninteractive
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main" | tee -a /etc/apt/sources.list
RUN apt-get update --fix-missing
RUN apt-get install -y build-essential wget sudo tmux cmake cmake-curses-gui git python3-pip libeigen3-dev python3-dev libzip-dev ffmpeg

## install sources
WORKDIR /src

ENV SOURCE_DIR "/src"
ENV NVIDIA_COMPUTE_CAPABILITY "7.5"


RUN git clone https://github.com/opencv/opencv.git \
    && cd opencv \
    && git checkout 3.3.1 \
    && mkdir build \
    && cd build \
    && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
    && make -j 12 \
    && make install && rm -rf /src/opencv

COPY ./requirements.txt /src/
RUN pip3 install --upgrade pip
RUN pip3 install scikit-build gpustat
RUN pip3 install -r requirements.txt
RUN pip3 install torch==1.6.0+cu101 torchvision==0.7+cu101 -f https://download.pytorch.org/whl/torch_stable.html
RUN pip3 install torch-scatter torch-sparse torch-geometric -f https://pytorch-geometric.com/whl/torch-1.6.0+cu101.html

RUN ln -s /usr/bin/python3 /usr/bin/python & \
    ln -s /usr/bin/pip3 /usr/bin/pip

WORKDIR /src

requirements.txt

numpy==1.19.1
scikit-image==0.15.0
pillow==7.2.0
open3d==0.11.2
matplotlib==3.2
pandas==1.0
opencv-python

docker_run.sh (The tag used when building is svs)

docker run -d \
  -it \
  --name svs \
  -v "$(realpath ..)":/src \
  --runtime=nvidia -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all \
  --ipc=host \
  svs

docker exec -it svs bash

@griegler
Copy link
Contributor

@bring728 Maybe the error is related to pytorch/vision#1893 ?

@bring728
Copy link
Author

Thanks~! I will try

@bring728
Copy link
Author

bring728 commented Oct 1, 2021

It's been a while, but I'll leave a comment for those who get the same error as me.
in mytorch/setup.py

nvcc_args = [
"-arch=sm_60",
"-gencode=arch=compute_60,code=sm_60",
]

After fixing this, the build was successful.

https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

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

4 participants