question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nvcc fatal : Unknown option '--threads'

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
crcrparcommented, Dec 16, 2021

@LBNord @xiaoyu-work @Mortimerp9 Apologize for bothering you I’ve added a guard in #1253. Also, thank you for reporting this.

1reaction
Mortimerp9commented, Dec 15, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

make error: nvcc fatal : Unknown option '--threads' #57 - GitHub
the fix is to use cuda 11.2 toolkit, this compiler option "--threads" got introduced from the toolkit version 11.2. else you can use...
Read more >
nvcc fatal : Unknown option '--threads' - Stack Overflow
The --threads option (which controls the number of threads which nvcc will attempt to spawn during compilation) was only added to nvcc 11.3....
Read more >
NVCC fatal : Unknown option 's' - NVIDIA Developer Forums
I downloaded the files: cuda toolkit 4.0.17 64 bits cuda tools ... But, now it wont compile… it says “NVCC fatal: Unknown option...
Read more >
theao install nvcc fatal : Unknown option 'fPIC' - Google Groups
theao install nvcc fatal : Unknown option 'fPIC' ... ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', 1, 'for cmd', ...
Read more >
nvcc fatal: Unknown option '-fopenmp' - Heimdall - SourceForge
nvcc fatal : Unknown option '-fopenmp' ... Hello Everyone,. I am working on getting an install of Heimdall onto our GPU subcluster for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found