apex
apex copied to clipboard
nvcc fatal : Unknown option '--threads'
Hello! I am unsure if this is related to the new code released "Add --threads 4 to extra_compile_args["nvcc"] (#1251)". Installed successfully two days ago, but while attempting to install apex this morning I am getting the following error:
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-Y7dWVB/python3.7-3.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -g -fdebug-prefix-map=/build/python3.7-Y7dWVB/python3.7-3.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.7/dist-packages/torch/include -I/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.7/dist-packages/torch/include/TH -I/usr/local/lib/python3.7/dist-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/usr/include/python3.7m -c csrc/amp_C_frontend.cpp -o build/temp.linux-x86_64-3.7/csrc/amp_C_frontend.o -O3 -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
/usr/local/cuda-11.1/bin/nvcc -I/usr/local/lib/python3.7/dist-packages/torch/include -I/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.7/dist-packages/torch/include/TH -I/usr/local/lib/python3.7/dist-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/usr/include/python3.7m -c csrc/multi_tensor_sgd_kernel.cu -o build/temp.linux-x86_64-3.7/csrc/multi_tensor_sgd_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_60,code=compute_60 -gencode=arch=compute_60,code=sm_60 -std=c++14
nvcc fatal : Unknown option '--threads'
error: command '/usr/local/cuda-11.1/bin/nvcc' failed with exit status 1
Running setup.py install for apex ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f9ikijau/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f9ikijau/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-9creo9o0/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/apex Check the logs for full command output.
Any help or assistance resolving would be sincerely appreciated.
Same error here. We got this build error since 12/14 12:10 PM (and it worked on 12/14 11:08 AM). We are using cuda 11.1 which means we shouldn't get this flag error. I believe it is related to this commit. Can you fix this ASAP?
[1/14] /usr/local/cuda/bin/nvcc -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/conda/envs/TorchStable/include/python3.6m -c -c /tmp/pip-req-build-1wml3dzl/csrc/multi_tensor_sgd_kernel.cu -o /tmp/pip-req-build-1wml3dzl/build/temp.linux-x86_64-3.6/csrc/multi_tensor_sgd_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_52,code=compute_52 -gencode=arch=compute_52,code=sm_52 -std=c++14
FAILED: /tmp/pip-req-build-1wml3dzl/build/temp.linux-x86_64-3.6/csrc/multi_tensor_sgd_kernel.o
/usr/local/cuda/bin/nvcc -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/envs/TorchStable/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/conda/envs/TorchStable/include/python3.6m -c -c /tmp/pip-req-build-1wml3dzl/csrc/multi_tensor_sgd_kernel.cu -o /tmp/pip-req-build-1wml3dzl/build/temp.linux-x86_64-3.6/csrc/multi_tensor_sgd_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_52,code=compute_52 -gencode=arch=compute_52,code=sm_52 -std=c++14
nvcc fatal : Unknown option '--threads'
the conversation in https://github.com/NVIDIA/cuda-samples/issues/57 seems to suggest that the --threads
option was added in CUDA 11.2.
Maybe it's worth creating a tag on the previous commit from #1251 to be able to checkout an 11.1 compatible version if needed.
@crcrpar would it be possible to guard this option for nvcc>=11.2?
@LBNord @xiaoyu-work @Mortimerp9 Apologize for bothering you I've added a guard in #1253. Also, thank you for reporting this.
Windows 11 could help