安装apex报错
安装apex时,按照github上的步骤进行安装
git clone https://github.com/NVIDIA/apex.git
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
报了错误:
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f06yeyog/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f06yeyog/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-8eqqkhah/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ytikewk/.local/include/python3.8/apex Check the logs for full command output.
看起来不知所措,其实主要的错误是没找到nvcc
FileNotFoundError: [Errno 2] No such file or directory: ':/usr/local/cuda/bin/nvcc'
在github上有关于这个问题的讨论,设置cuda home的路径就好
export CUDA_HOME=/usr/local/cuda
之后继续安装
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./