NVIDIA / NVIDIA/apex

Compile error with CUDA10.1 and Pytorch 1.4.0

Open
#705 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.5k
Avg merge
2d 4h
Merged PRs (30d)
3

Description

Hello, I met this error when I try to run the command "pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .":

I only show you the parts at the start and the end because the ignored part are very similar.

Non-user install because site-packages writeable^M Created temporary directory: /tmp/pip-ephem-wheel-cache-35u048z4^M Created temporary directory: /tmp/pip-req-tracker-o_dho7t1^M Initialized build tracking at /tmp/pip-req-tracker-o_dho7t1^M Created build tracker: /tmp/pip-req-tracker-o_dho7t1^M Entered build tracker: /tmp/pip-req-tracker-o_dho7t1^M Created temporary directory: /tmp/pip-install-lcb6uyn6^M Processing /home/guangrui/apex^M Created temporary directory: /tmp/pip-req-build-_dh7ztxj^M Added file:///home/guangrui/apex to build tracker '/tmp/pip-req-tracker-o_dho7t1'^M Running setup.py (path:/tmp/pip-req-build-_dh7ztxj/setup.py) egg_info for package from file:///home/guangrui/apex^M Running command python setup.py egg_info^M torch.__version__ = 1.4.0^M running egg_info^M creating /tmp/pip-req-build-_dh7ztxj/pip-egg-info/apex.egg-info^M writing /tmp/pip-req-build-_dh7ztxj/pip-egg-info/apex.egg-info/PKG-INFO^M writing dependency_links to /tmp/pip-req-build-_dh7ztxj/pip-egg-info/apex.egg-info/dependency_links.txt^M writing top-level names to /tmp/pip-req-build-_dh7ztxj/pip-egg-info/apex.egg-info/top_level.txt^M writing manifest file '/tmp/pip-req-build-_dh7ztxj/pip-egg-info/apex.egg-info/SOURCES.txt'^M reading manifest file '/tmp/pip-req-build-_dh7ztxj/pip-egg-info/apex.egg-info/SOURCES.txt'^M writing manifest file '/tmp/pip-req-build-_dh7ztxj/pip-egg-info/apex.egg-info/SOURCES.txt'^M /tmp/pip-req-build-_dh7ztxj/setup.py:43: UserWarning: Option --pyprof not specified. Not installing PyProf dependencies!^M warnings.warn("Option --pyprof not specified. Not installing PyProf dependencies!")^M Source in /tmp/pip-req-build-_dh7ztxj has version 0.1, which satisfies requirement apex==0.1 from file:///home/guangrui/apex^M Removed apex==0.1 from file:///home/guangrui/apex from build tracker '/tmp/pip-req-tracker-o_dho7t1'^M Skipping wheel build for apex, due to binaries being disabled for it.^M Installing collected packages: apex^M Attempting uninstall: apex^M Found existing installation: apex 0.1^M Uninstalling apex-0.1:^M Created temporary directory: /tmp/pip-uninstall-v72mrjmz^M Removing file or directory /home/guangrui/anaconda3/lib/python3.7/site-packages/apex-0.1-py3.7.egg^M Removing pth entries from /home/guangrui/anaconda3/lib/python3.7/site-packages/easy-install.pth:^M Removing entry: ./apex-0.1-py3.7.egg^M Successfully uninstalled apex-0.1^M Created temporary directory: /tmp/pip-record-gcgz29ft^M Running command /home/guangrui/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-_dh7ztxj/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-_dh7ztxj/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-gcgz29ft/install-record.txt --single-version-externally-managed --compile --install-headers /home/guangrui/anaconda3/include/python3.7m/apex^M torch.__version__ = 1.4.0^M /tmp/pip-req-build-_dh7ztxj/setup.py:43: UserWarning: Option --pyprof not specified. Not installing PyProf dependencies!^M warnings.warn("Option --pyprof not specified. Not installing PyProf dependencies!")^M ^M Compiling cuda extensions with^M nvcc: NVIDIA (R) Cuda compiler driver^M Copyright (c) 2005-2019 NVIDIA Corporation^M Built on Sun_Jul_28_19:07:16_PDT_2019^M Cuda compilation tools, release 10.1, V10.1.243^M from /opt/cuda/bin^M ^M running install^M running build^M onda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/TH -I/home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/THC -I/home/guangrui/anaconda3/include/python3.7m -c csrc/flatten_unflatten.cpp -o build/temp.linux-x86_64-3.7/csrc/flatten_unflatten.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=apex_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11^M cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++^M In file included from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/TensorMethods.h:10,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/Tensor.h:12,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/Context.h:4,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4,^M from /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/torch/extension.h:4,^M from csrc/flatten_unflatten.cpp:1:^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h: In instantiation of ‘Return c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = void; Args = {const at::Tensor&, const at::Tensor&, bool, bool}]’:^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:201:114: required from ‘Return c10::Dispatcher::callUnboxedOnly(const c10::OperatorHandle&, Args ...) const [with Return = void; Args = {const at::Tensor&, const at::Tensor&, bool, bool}]’^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/TensorMethods.h:66:75: required from here^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘const at::Tensor& args#0’^M 211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);^M | ^~~~^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘const at::Tensor& args#0’ previously declared here^M 209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);^M | ^~~~^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘const at::Tensor& args#1’^M 211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);^M | ^~~~^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘const at::Tensor& args#1’ previously declared here^M 209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);^M | ^~~~^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘bool& args#2’^M 211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);^M | ^~~~^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘bool& args#2’ previously declared here^M 209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);^M | ^~~~^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘bool& args#3’^M 211 | return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);^M | ^~~~^M /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:209:115: note: ‘bool& args#3’ previously declared here^M 209 | c10::optional<TensorTypeId> dispatchKey = dispatchTable.dispatchKeyExtractor().getDispatchKeyUnboxed<Args...>(args...);^M

At the end:
` /home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/c10/util/LeftRight.h:67:10: error: ‘typename std::result_of<F(const T&)>::type c10::LeftRight::read(F&&) const [with F = c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor; Args = {const at::Tensor&, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>; T = ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>; typename std::result_of<F(const T&)>::type = at::Tensor]’, declared using local type ‘c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor; Args = {const at::Tensor&, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>’, is used but never defined [-fpermissive]^M
/home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/c10/util/LeftRight.h:67:10: error: ‘typename std::result_of<F(const T&)>::type c10::LeftRight::read(F&&) const [with F = c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor&; Args = {at::Tensor&, const at::Tensor&, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>; T = ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>; typename std::result_of<F(const T&)>::type = at::Tensor&]’, declared using local type ‘c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor&; Args = {at::Tensor&, const at::Tensor&, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>’, is used but never defined [-fpermissive]^M
/home/guangrui/anaconda3/lib/python3.7/site-packages/torch/include/c10/util/LeftRight.h:67:10: error: ‘typename std::result_of<F(const T&)>::type c10::LeftRight::read(F&&) const [with F = c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor; Args = {const at::Tensor&, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>; T = ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>; typename std::result_of<F(const T&)>::type = at::Tensor]’, declared using local type ‘c10::Dispatcher::doCallUnboxedOnly(const c10::DispatchTable&, const c10::LeftRight<ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction> >&, Args ...) const [with Return = at::Tensor; Args = {const at::Tensor&, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef, c10::ArrayRef}]::<lambda(const ska::flat_hash_map<c10::TensorTypeId, c10::KernelFunction>&)>’, is used but never defined [-fpermissive]^M
error: command 'gcc' failed with exit status 1^M
Running setup.py install for apex ... ^[[?25l^[[?25herror^M
Rolling back uninstall of apex^M
Moving to /home/guangrui/anaconda3/lib/python3.7/site-packages/apex-0.1-py3.7.egg^M
from /tmp/pip-uninstall-v72mrjmz/apex-0.1-py3.7.egg^M
Replacing /home/guangrui/anaconda3/lib/python3.7/site-packages/apex-0.1-py3.7.egg from /tmp/pip-uninstall-v72mrjmz/apex-0.1-py3.7.egg^M
Rolling /home/guangrui/anaconda3/lib/python3.7/site-packages/easy-install.pth back to previous state^M
Cleaning up...^M
Removing source in /tmp/pip-req-build-_dh7ztxj^M
Removed build tracker: '/tmp/pip-req-tracker-o_dho7t1'^M
^[[31mERROR: Command errored out with exit status 1: /home/guangrui/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-_dh7ztxj/setup.py'"'"'; file='"'"'/tmp/pip-req-build-_dh7ztxj/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-gcgz29ft/install-record.txt --single-version-externally-managed --compile --install-headers /home/guangrui/anaconda3/include/python3.7m/apex Check the logs for full command output.^[[0m^M
Exception information:^M
Traceback (most recent call last):^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 186, in _main^M
status = self.run(options, args)^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 404, in run^M
use_user_site=options.use_user_site,^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/req/init.py", line 71, in install_given_reqs^M
**kwargs^M
use_user_site=options.use_user_site,^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/req/init.py", line 71, in install_given_reqs^M
**kwargs^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 829, in install^M
scheme=scheme,^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/operations/install/legacy.py", line 72, in install^M
cwd=install_req.unpacked_source_directory,^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/utils/subprocess.py", line 275, in runner^M
spinner=spinner,^M
File "/home/guangrui/anaconda3/lib/python3.7/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess^M
raise InstallationError(exc_msg)^M
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /home/guangrui/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-_dh7ztxj/setup.py'"'"'; file='"'"'/tmp/pip-req-build-_dh7ztxj/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-gcgz29ft/install-record.txt --single-version-externally-managed --compile --install-headers /home/guangrui/anaconda3/include/python3.7m/apex Check the logs for full command output.^M
1 location(s) to search for versions of pip:^M

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the pip install command and inspect setup.py, csrc/flatten_unflatten.cpp, and the PyTorch headers named in the compiler output. Compare the build configuration for PyTorch 1.4.0 and CUDA 10.1; done means the Apex extensions compile and install without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python, pytorch
Domain
build-system, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.