Closed
Description
Hi, when I try to build the newest version apex, I met some error like the following info.
" python -u -c "import setuptools, tokenize;file='/tmp/pip-req-build-hq7t6roo/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-ic8t29gs/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-hq7t6roo/ "
I make sure that I follow the readme.md but the error could not be solved. Can you give me some suggestions about how to handle it? Thank you very much!
Activity
Lausannen commentedon Mar 21, 2019
I think I have found the problem. It caused by the wrong CUDA version since my server has multi-CUDA versions. So when I changed CUDA path in .bashrc, apex could be compiled.
mcarilli commentedon Mar 21, 2019
I'm currently adding logic to the setup.py that will print a warning if the version of Cuda that's being used to compile the extensions is different from the version of Cuda that was used to compile the Pytorch binaries present on your system, which should help catch cases like this.
moskomule commentedon Mar 25, 2019
Hi, I have probably the same problem with you...
moskomule commentedon Mar 25, 2019
Update: Without using
tmux
, I could installapex
.It works with AMP but warns as
Warning: multi_tensor_applier fused unscale kernel is unavailable, possibly because apex was installed without --cuda_ext --cpp_ext. Using Python fallback. Original ImportError was: ImportError('/opt/.miniconda/lib/python3.7/site-packages/amp_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __cudaPopCallConfiguration')
.Lausannen commentedon Mar 25, 2019
@moskomule I think install apex with --cuda_ext --cpp_ext is necessary, I guess this problem is related with your cuda setting. Since in my case, firstly I check my path using "nvcc -V", it is CUDA-9.0 but I found the link in ~/.bashrc is invalid. Maybe you should check this.
moskomule commentedon Mar 25, 2019
Thanks, in case of the warning above, I used
--cuda_ext --cpp_ext
to install and the installation itself seemed to finish successfully. But when running AMP, the warning above appeared.mcarilli commentedon Mar 25, 2019
@moskomule You should make sure to use the pip install command
instead of
Also, before reinstalling Apex, you need to make sure any old conflicting installs are removed, and if you installed using the direct setup.py command, you also need to make sure stale
apex/build
andapex.egg-info
are removed. Trymoskomule commentedon Apr 1, 2019
Thank you. So far, I found it fails to build on Ubuntu18.04 but success on Ubuntu16.04.
DangerousY commentedon Sep 26, 2019
I meet with this problem
ERROR: Command errored out with exit status 1: /home/zyx/anaconda3/envs/maskrcnn_benchmark/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-i7tiph4m/setup.py'"'"'; file='"'"'/tmp/pip-req-build-i7tiph4m/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-4x7z98cw/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
ptrblck commentedon Sep 26, 2019
@DangerousY Could you please post the complete stack trace so that we could have a look?
chccgiven commentedon Sep 30, 2019
Hi,I have executed the above command, but the program is reporting following error.
ERROR: You must give at least one requirement to install (see "pip help install")
My Ubuntu version is 18.04, can you help me? Thank you!
ptrblck commentedon Sep 30, 2019
@chccgiven This error is usually thrown, if you forget the folder location at the end of the
pip install
command (the dot at the end or./
alternatively).maschasap commentedon Jun 5, 2020
@ptrblck good afternoon! Try to install apex though always get this error:
error
Cleaning up...
Removing source in /tmp/pip-jp2_qt25-build
Command "/raid/akim/myenv/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-jp2_qt25-build/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-ylohle8g-record/install-record.txt --single-version-externally-managed --compile --install-headers /raid/akim/myenv/include/site/python3.6/apex" failed with error code 1 in /tmp/pip-jp2_qt25-build/
Exception information:
Traceback (most recent call last):
File "/raid/akim/myenv/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/raid/akim/myenv/lib/python3.6/site-packages/pip/commands/install.py", line 360, in run
prefix=options.prefix_path,
File "/raid/akim/myenv/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/raid/akim/myenv/lib/python3.6/site-packages/pip/req/req_install.py", line 878, in install
spinner=spinner,
File "/raid/akim/myenv/lib/python3.6/site-packages/pip/utils/init.py", line 725, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "/raid/akim/myenv/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-jp2_qt25-build/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-ylohle8g-record/install-record.txt --single-version-externally-managed --compile --install-headers /raid/akim/myenv/include/site/python3.6/apex" failed with error code 1 in /tmp/pip-jp2_qt25-build/
Do you know what the issue may be? Thanks in advance!