Error ：nvcc fatal : Unknown option '-generate-dependencies-with-compile' ninja: build stopped: subcommand failed

username: DOUBLE
cooked: <p>When i follow the <a href="https://github.com/Turoad/CLRNet#readme" rel="noopener nofollow ugc">README.md</a>,<br>
Try : python setup.py build develop.<br>
Then i got some erros , which i could not overcome for a few weeks . The main erro have been described in the tittle of the issue. Otherwise all these attempts are under Windows not linux .<br>
ALL logs has been displayed as follows:</p>
<p>(clrnet) D:\Li_Yong_Hang\CLRNet-main\CLRNet-main&gt;python setup.py build develop<br>
running build<br>
running build_py<br>
running egg_info<br>
writing clrnet.egg-info\PKG-INFO<br>
writing dependency_links to clrnet.egg-info\dependency_links.txt<br>
writing requirements to clrnet.egg-info\requires.txt<br>
writing top-level names to clrnet.egg-info\top_level.txt<br>
reading manifest file ‘clrnet.egg-info\SOURCES.txt’<br>
adding license file ‘LICENSE’<br>
writing manifest file ‘clrnet.egg-info\SOURCES.txt’<br>
running build_ext<br>
C:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\utils\cpp_extension.py:311: UserWarning:</p>
<pre><code class="lang-auto">                           !! WARNING !!
</code></pre>
<p>!!!<br>
Your compiler (cl 19.00.24210) may be ABI-incompatible with PyTorch!<br>
Please use a compiler that is ABI-compatible with GCC 5.0 and above.<br>
See <a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html" class="inline-onebox" rel="noopener nofollow ugc">ABI Policy and Guidelines</a>.</p>
<p>See <a href="https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6" class="inline-onebox" rel="noopener nofollow ugc">Instructions for installing GCC &gt;= 4.9 for PyTorch Extensions · GitHub</a><br>
for instructions on how to install GCC 5 or higher.<br>
!!!</p>
<pre><code class="lang-auto">                          !! WARNING !!
</code></pre>
<p>warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))<br>
building ‘clrnet.ops.nms_impl’ extension<br>
C:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\cuda_<em>init</em>_.py:104: UserWarning:<br>
NVIDIA GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch installation.<br>
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.<br>
If you want to use the NVIDIA GeForce RTX 3080 GPU with PyTorch, please check the instructions at <a href="https://pytorch.org/get-started/locally/" class="inline-onebox" rel="noopener nofollow ugc">Start Locally | PyTorch</a></p>
<p>warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))<br>
Emitting ninja build file D:\Li_Yong_Hang\CLRNet-main\CLRNet-main\build\temp.win-amd64-3.8\Release\build.ninja…<br>
Compiling objects…<br>
Allowing ninja to set a default number of workers… (overridable by setting the environment variable MAX_JOBS=N)<br>
[1/1] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc --generate-dependencies-with-compile --dependency-output D:\Li_Yong_Hang\CLRNet-main\CLRNet-main\build\temp.win-amd64-3.8\Release\clrnet/ops/csrc\nms_kernel.obj.d --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include\TH -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include\THC “-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -IC:\Users\ps.conda\envs\clrnet\include -IC:\Users\ps.conda\envs\clrnet\include “-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include” “-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt” -c D:\Li_Yong_Hang\CLRNet-main\CLRNet-main\clrnet\ops\csrc\nms_kernel.cu -o D:\Li_Yong_Hang\CLRNet-main\CLRNet-main\build\temp.win-amd64-3.8\Release\clrnet/ops/csrc\nms_kernel.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_impl -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75<br>
FAILED: D:/Li_Yong_Hang/CLRNet-main/CLRNet-main/build/temp.win-amd64-3.8/Release/clrnet/ops/csrc/nms_kernel.obj<br>
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc --generate-dependencies-with-compile --dependency-output D:\Li_Yong_Hang\CLRNet-main\CLRNet-main\build\temp.win-amd64-3.8\Release\clrnet/ops/csrc\nms_kernel.obj.d --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include\TH -IC:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\include\THC “-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -IC:\Users\ps.conda\envs\clrnet\include -IC:\Users\ps.conda\envs\clrnet\include “-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include” “-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt” -c D:\Li_Yong_Hang\CLRNet-main\CLRNet-main\clrnet\ops\csrc\nms_kernel.cu -o D:\Li_Yong_Hang\CLRNet-main\CLRNet-main\build\temp.win-amd64-3.8\Release\clrnet/ops/csrc\nms_kernel.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_impl -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75<br>
nvcc fatal : Unknown option ‘-generate-dependencies-with-compile’<br>
ninja: build stopped: subcommand failed.<br>
Traceback (most recent call last):<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\utils\cpp_extension.py”, line 1667, in _run_ninja_build<br>
subprocess.run(<br>
File “C:\Users\ps.conda\envs\clrnet\lib\subprocess.py”, line 516, in run<br>
raise CalledProcessError(retcode, process.args,<br>
subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.</p>
<p>The above exception was the direct cause of the following exception:</p>
<p>Traceback (most recent call last):<br>
File “setup.py”, line 100, in<br>
setup(name=‘clrnet’,<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\setuptools_<em>init</em>_.py”, line 153, in setup<br>
return distutils.core.setup(**attrs)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\core.py”, line 148, in setup<br>
dist.run_commands()<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\dist.py”, line 966, in run_commands<br>
self.run_command(cmd)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\dist.py”, line 985, in run_command<br>
cmd_obj.run()<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\command\build.py”, line 135, in run<br>
self.run_command(cmd_name)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\cmd.py”, line 313, in run_command<br>
self.distribution.run_command(command)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\dist.py”, line 985, in run_command<br>
cmd_obj.run()<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\setuptools\command\build_ext.py”, line 79, in run<br>
_build_ext.run(self)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\command\build_ext.py”, line 340, in run<br>
self.build_extensions()<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\utils\cpp_extension.py”, line 708, in build_extensions<br>
build_ext.build_extensions(self)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\command\build_ext.py”, line 449, in build_extensions<br>
self._build_extensions_serial()<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\command\build_ext.py”, line 474, in _build_extensions_serial<br>
self.build_extension(ext)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\setuptools\command\build_ext.py”, line 202, in build_extension<br>
_build_ext.build_extension(self, ext)<br>
File “C:\Users\ps.conda\envs\clrnet\lib\distutils\command\build_ext.py”, line 528, in build_extension<br>
objects = self.compiler.compile(sources,<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\utils\cpp_extension.py”, line 681, in win_wrap_ninja_compile<br>
_write_ninja_file_and_compile_objects(<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\utils\cpp_extension.py”, line 1354, in _write_ninja_file_and_compile_objects<br>
_run_ninja_build(<br>
File “C:\Users\ps.conda\envs\clrnet\lib\site-packages\torch\utils\cpp_extension.py”, line 1683, in _run_ninja_build<br>
raise RuntimeError(message) from e<br>
RuntimeError: Error compiling objects for extension</p>

username: eqy
cooked: <p>It looks like you installed a version of PyTorch that was built with CUDA &lt; 11.0, which would not be compatible with an RTX 3080, which is an sm86 GPU that requires CUDA &gt;= 11.0. It looks like the CUDA extension is also being compiled with an <code>nvcc</code> that is packaged with CUDA 10.1, which could also be too old (hence the <code>Unknown option</code> error).</p>
<p>I would recommend upgrading both your version of PyTorch e.g., via <code>pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118</code> and also upgrading e.g., to CUDA 11.8 on your system.</p>

username: DOUBLE
cooked: <p>Hi Eqy, thank you for your reply and professional recomments. Indeed, i noticed the version of CUDA is too old , i also want to update my CUDA and pytorch as you said.<br>
But the project on the github requires CUDA 10.2，（ <a href="https://github.com/Turoad/CLRNet" rel="noopener nofollow ugc">Turoad/CLRNet: Pytorch implementation of our paper “CLRNet: Cross Layer Refinement Network for Lane Detection” (CVPR2022 Acceptance). (github.com)</a>）<br>
So, under this kind of situation , if i install the new version of CUDA and pytorch ,i am afraid the project can not be tested correctly . On the other hand , if i follow the <a href="https://github.com/Turoad/CLRNet#readme" rel="noopener nofollow ugc">README.md</a>, which means keep the CUDA 10.2 ,it would not be compatible with an RTX 3080.<br>
I am so confused， could you give me some advice ? I really need someone likes you to tell me how  to take both sides into account.<br>
I am looking forward to your reply .<br>
Best wishes</p>

username: eqy
cooked: <p>The README of the repository only states that it was tested with CUDA 10.2, but does not say that it is a <em>strict</em> requirement. I would not expect any real incompatibility of the github repo you linked with CUDA 11+, as the only CUDA code appears to be some custom kernels implementing nms (nonmaximum suppression?). However, CUDA 10.x will definitely not work with an RTX 3080, so from my perspective the only option is to upgrade to CUDA 11+ and check for any compatibility issues afterward (which should be minor if any).</p>

username: DOUBLE
cooked: <p>Thank you eqy for your useful advice, i followed your steps and the truble is solved.</p>