Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Error trying to build ORT with Tensorrt EP on Windows #23378

Open
davave1693 opened this issue Jan 15, 2025 · 3 comments
Open

[Build] Error trying to build ORT with Tensorrt EP on Windows #23378

davave1693 opened this issue Jan 15, 2025 · 3 comments
Labels
api:Java issues related to the Java API build build issues; typically submitted using template ep:TensorRT issues related to TensorRT execution provider .NET Pull requests that update .net code platform:windows issues related to the Windows platform

Comments

@davave1693
Copy link

Describe the issue

I am trying to build onnxruntime with tensorrt EP, but following the documentation an error occurs.

Below the version of the adopted libraries:

TensorRT Version: 10.5.0.18

NVIDIA GPU: Quadro T1000

NVIDIA Driver Version: 553.50

CUDA Version: 12.2

CUDNN Version: 8.9

Operating System: Windows 11 Pro 23H2

Thank you for your help.

Urgency

An important project for my company is blocked because of this problem

Target platform

x64 - Windows

Build script

.\build.bat --cudnn_home "C:\Program Files\NVIDIA\CUDNN\v8.9" --cuda_home "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2" --use_tensorrt --tensorrt_home "E:\Libraries\TensorRT-10.5.0.18" --cmake_generator "Visual Studio 17 2022"

Error / output

1>Checking Build System
1>
Building Custom Rule E:/repository/onnxruntime/build/Windows/Debug/_deps/microsoft_wil-subbuild/CMakeLists.txt
Building Custom Rule E:/repository/onnxruntime/build/Windows/Debug/_deps/microsoft_wil-subbuild/CMakeLists.txt
-- cudnn found at C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn.lib.
-- cuDNN: C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn.lib
-- cuDNN: C:/Program Files/NVIDIA/CUDNN/v8.9/include
-- cudnn_adv_infer found at C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn_adv_infer.lib.
-- cudnn_adv_train found at C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn_adv_train.lib.
-- cudnn_cnn_infer found at C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn_cnn_infer.lib.
-- cudnn_cnn_train found at C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn_cnn_train.lib.
-- cudnn_ops_infer found at C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn_ops_infer.lib.
-- cudnn_ops_train found at C:/Program Files/NVIDIA/CUDNN/v8.9/lib/cudnn_ops_train.lib.
-- Finished fetching external dependencies
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeDetermineCompilerId.cmake:780 (message):
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.

Compiler: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2/bin/nvcc

Build flags: -allow-unsupported-compiler

Id flags: --keep;--keep-dir;tmp -v

The output was:

1

MSBuild version 17.11.9+a69bbaaf5 for .NET Framework

Build started 15/01/2025 10:02:24.

Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
on node 1 (default targets).

PrepareForBuild:

Creating directory "Debug\".
Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
Creating directory "Debug\CompilerIdCUDA.tlog\".

InitializeBuildStatus:

Creating "Debug\CompilerIdCUDA.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
Touching "Debug\CompilerIdCUDA.tlog\unsuccessfulbuild".

AddCudaCompileDeps:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D__CUDACC_VER_MAJOR__=12 /D__CUDACC_VER_MINOR__=2 /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" /IE:\repository\vcpkg\installed\x64-windows\include /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" /I. /FIcuda_runtime.h /c E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu

Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(1) is building
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(1:2) on node 1 (CudaBuildCore target(s)).

CudaBuildCore:

Compiling CUDA source file CMakeCUDACompilerId.cu...
Creating directory "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug".
cmd.exe /C "C:\Users\Zbook\AppData\Local\Temp\tmpd7d1d42e87d449d38a818af24588bcae.cmd"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu   -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"  -G   --keep-dir CompilerIdCUDA\x64\Debug  -maxrregcount=0   --machine 64 --compile -cudart static -v -g  -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/FdDebug\vc143.pdb" -o E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu"

E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu   -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"  -G   --keep-dir CompilerIdCUDA\x64\Debug  -maxrregcount=0   --machine 64 --compile -cudart static -v -g  -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/FdDebug\vc143.pdb" -o E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu"
#$ _NVVM_BRANCH_=nvvm
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin
#$ _THERE_=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_SIZE_=64
#$ _WIN_PLATFORM_=x64
#$ TOP=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/..
#$ NVVMIR_LIBRARY_DIR=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../nvvm/libdevice
#$ PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../nvvm/bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../lib;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86;;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ide;C:\Program Files (x86)\HTML Help Workshop;;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\;;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x86;C:\Program Files (x86)\Windows Kits\10\bin\\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;E:\Libraries\TensorRT-10.5.0.18\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\libnvvp;C:\Program Files\NVIDIA\CUDNN\v8.9\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp;E:\Libraries\opencv\build\x64\vc16\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\libnvvp;C:\ffmpeg\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\VMware\VMware Player\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Zbook\AppData\Local\Microsoft\WindowsApps;C:\Users\Zbook\.dotnet\tools;C:\Users\Zbook\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Zbook\Ap;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\CMake\bin;E:\Libraries\opencv\build\x64\vc16\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA\CUDNN\v8.7\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Users\Zbook\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Netwide Assembler 2.16.01;C;C:\Program Files\Microsoft Network Monitor 3\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\PowerShell\7\;C:\Program Files\dotnet\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2024.3.0\;E:\Libraries\TensorRT-10.5.0.18\bin;C:\Program Files\Conan\conan;C:\Users\Zbook\AppData\Local\Microsoft\WindowsApps;C:\Users\Zbook\.dotnet\tools;C:\Users\Zbook\AppData\Local\gitkraken\bin;C:\Users\Zbook\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Zbook\AppData\Local\InfoCert\GoSign Desktop\RAO;C:\Users\Zbook\AppData\Roaming\npm;C:\Users\Zbook\.dotnet\tools;;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg;
#$ INCLUDES="-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../include"
#$ LIBRARIES=  "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../lib/x64"
#$ CUDAFE_FLAGS=--sdk_dir "C:\Program Files (x86)\Windows Kits\10"
#$ PTXAS_FLAGS=
CMakeCUDACompilerId.cu
#$ resource file C:\Users\Zbook\AppData\Local\Temp/tmpxft_00002478_00000000-8.res: [-D__CUDA_ARCH_LIST__=520 -nologo -E -TP -EHsc -D__CUDACC__ -D__NVCC__ -D__CUDACC_DEBUG__  /EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd /FdDebug\vc143.pdb -I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.2/include" -I"E:/repository/vcpkg/installed/x64-windows/include" -I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.2/include" "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../include"    -D "_MBCS" -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=2 -D__CUDACC_VER_BUILD__=91 -D__CUDA_API_VER_MAJOR__=12 -D__CUDA_API_VER_MINOR__=2 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1 -FI "cuda_runtime.h" -Zi "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu" ]
#$ cl.exe @"C:\Users\Zbook\AppData\Local\Temp/tmpxft_00002478_00000000-8.res" > "C:/Users/Zbook/AppData/Local/Temp/tmpxft_00002478_00000000-6_CMakeCUDACompilerId.cpp4.ii"
CMakeCUDACompilerId.cu

C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\v12.2\include\crt/host_config.h(157): fatal error C1189:
#error: -- unsupported Microsoft Visual Studio version! Only the versions
between 2017 and 2022 (inclusive) are supported! The nvcc flag
'-allow-unsupported-compiler' can be used to override this version check;
however, using an unsupported host compiler may cause compilation failure
or incorrect run time execution. Use at your own risk.
[E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

# --error 0x2 --

C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\v12.2\extras\visual_studio_integration\MSBuildExtensions\CUDA
12.2.targets(799,9): error MSB3721: The command ""C:\Program Files\NVIDIA
GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe"
-gencode=arch=compute_52,code="sm_52,compute_52" --use-local-env -ccbin
"C:\Program Files\Microsoft Visual
Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"
-I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -G --keep-dir
CompilerIdCUDA\x64\Debug -maxrregcount=0 --machine 64 --compile -cudart
static -v -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd "
-Xcompiler "/FdDebug\vc143.pdb" -o
E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu""
exited with code 2.
[E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

Done Building Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(CudaBuildCore target(s)) -- FAILED.

Done Building Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(default targets) -- FAILED.

Build FAILED.

"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(default target) (1) ->

"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(CudaBuildCore target) (1:2) ->

(CudaBuildCore target) ->

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include\crt/host_config.h(157): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. [E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\extras\visual_studio_integration\MSBuildExtensions\CUDA 12.2.targets(799,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu   -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"  -G   --keep-dir CompilerIdCUDA\x64\Debug  -maxrregcount=0   --machine 64 --compile -cudart static -v -g  -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/FdDebug\vc143.pdb" -o E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 2. [E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]



  0 Warning(s)
  2 Error(s)

Time Elapsed 00:00:00.70

Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.

Compiler: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2/bin/nvcc

Build flags:

Id flags: --keep;--keep-dir;tmp -v

The output was:

1

MSBuild version 17.11.9+a69bbaaf5 for .NET Framework

Build started 15/01/2025 10:02:25.

Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
on node 1 (default targets).

PrepareForBuild:

Creating directory "Debug\".
Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
Creating directory "Debug\CompilerIdCUDA.tlog\".

InitializeBuildStatus:

Creating "Debug\CompilerIdCUDA.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
Touching "Debug\CompilerIdCUDA.tlog\unsuccessfulbuild".

AddCudaCompileDeps:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D__CUDACC_VER_MAJOR__=12 /D__CUDACC_VER_MINOR__=2 /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" /IE:\repository\vcpkg\installed\x64-windows\include /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" /I. /FIcuda_runtime.h /c E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu

Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(1) is building
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(1:2) on node 1 (CudaBuildCore target(s)).

CudaBuildCore:

Compiling CUDA source file CMakeCUDACompilerId.cu...
Creating directory "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug".
cmd.exe /C "C:\Users\Zbook\AppData\Local\Temp\tmpfffaabf56c5445ffae12ba89b3b46f67.cmd"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu   -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"  -G   --keep-dir CompilerIdCUDA\x64\Debug  -maxrregcount=0   --machine 64 --compile -cudart static -v -g  -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/FdDebug\vc143.pdb" -o E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu"

E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu   -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"  -G   --keep-dir CompilerIdCUDA\x64\Debug  -maxrregcount=0   --machine 64 --compile -cudart static -v -g  -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/FdDebug\vc143.pdb" -o E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu"
#$ _NVVM_BRANCH_=nvvm
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin
#$ _THERE_=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_SIZE_=64
#$ _WIN_PLATFORM_=x64
#$ TOP=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/..
#$ NVVMIR_LIBRARY_DIR=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../nvvm/libdevice
#$ PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../nvvm/bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../lib;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86;;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ide;C:\Program Files (x86)\HTML Help Workshop;;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\;;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x86;C:\Program Files (x86)\Windows Kits\10\bin\\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;E:\Libraries\TensorRT-10.5.0.18\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\libnvvp;C:\Program Files\NVIDIA\CUDNN\v8.9\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp;E:\Libraries\opencv\build\x64\vc16\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\libnvvp;C:\ffmpeg\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\VMware\VMware Player\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Zbook\AppData\Local\Microsoft\WindowsApps;C:\Users\Zbook\.dotnet\tools;C:\Users\Zbook\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Zbook\Ap;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\CMake\bin;E:\Libraries\opencv\build\x64\vc16\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA\CUDNN\v8.7\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Users\Zbook\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Netwide Assembler 2.16.01;C;C:\Program Files\Microsoft Network Monitor 3\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\PowerShell\7\;C:\Program Files\dotnet\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2024.3.0\;E:\Libraries\TensorRT-10.5.0.18\bin;C:\Program Files\Conan\conan;C:\Users\Zbook\AppData\Local\Microsoft\WindowsApps;C:\Users\Zbook\.dotnet\tools;C:\Users\Zbook\AppData\Local\gitkraken\bin;C:\Users\Zbook\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Zbook\AppData\Local\InfoCert\GoSign Desktop\RAO;C:\Users\Zbook\AppData\Roaming\npm;C:\Users\Zbook\.dotnet\tools;;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg;
#$ INCLUDES="-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../include"
#$ LIBRARIES=  "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../lib/x64"
#$ CUDAFE_FLAGS=--sdk_dir "C:\Program Files (x86)\Windows Kits\10"
#$ PTXAS_FLAGS=
CMakeCUDACompilerId.cu
#$ resource file C:\Users\Zbook\AppData\Local\Temp/tmpxft_000086c4_00000000-8.res: [-D__CUDA_ARCH_LIST__=520 -nologo -E -TP -EHsc -D__CUDACC__ -D__NVCC__ -D__CUDACC_DEBUG__  /EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd /FdDebug\vc143.pdb -I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.2/include" -I"E:/repository/vcpkg/installed/x64-windows/include" -I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.2/include" "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin/../include"    -D "_MBCS" -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=2 -D__CUDACC_VER_BUILD__=91 -D__CUDA_API_VER_MAJOR__=12 -D__CUDA_API_VER_MINOR__=2 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1 -FI "cuda_runtime.h" -Zi "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu" ]
#$ cl.exe @"C:\Users\Zbook\AppData\Local\Temp/tmpxft_000086c4_00000000-8.res" > "C:/Users/Zbook/AppData/Local/Temp/tmpxft_000086c4_00000000-6_CMakeCUDACompilerId.cpp4.ii"
CMakeCUDACompilerId.cu

C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\v12.2\include\crt/host_config.h(157): fatal error C1189:
#error: -- unsupported Microsoft Visual Studio version! Only the versions
between 2017 and 2022 (inclusive) are supported! The nvcc flag
'-allow-unsupported-compiler' can be used to override this version check;
however, using an unsupported host compiler may cause compilation failure
or incorrect run time execution. Use at your own risk.
[E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

# --error 0x2 --

C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\v12.2\extras\visual_studio_integration\MSBuildExtensions\CUDA
12.2.targets(799,9): error MSB3721: The command ""C:\Program Files\NVIDIA
GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe"
-gencode=arch=compute_52,code="sm_52,compute_52" --use-local-env -ccbin
"C:\Program Files\Microsoft Visual
Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"
-I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -G --keep-dir
CompilerIdCUDA\x64\Debug -maxrregcount=0 --machine 64 --compile -cudart
static -v -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd "
-Xcompiler "/FdDebug\vc143.pdb" -o
E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu""
exited with code 2.
[E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

Done Building Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(CudaBuildCore target(s)) -- FAILED.

Done Building Project
"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(default targets) -- FAILED.

Build FAILED.

"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(default target) (1) ->

"E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj"
(CudaBuildCore target) (1:2) ->

(CudaBuildCore target) ->

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include\crt/host_config.h(157): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. [E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\extras\visual_studio_integration\MSBuildExtensions\CUDA 12.2.targets(799,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" -x cu   -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" -I"E:\repository\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include"  -G   --keep-dir CompilerIdCUDA\x64\Debug  -maxrregcount=0   --machine 64 --compile -cudart static -v -g  -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/FdDebug\vc143.pdb" -o E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA\x64\Debug\CMakeCUDACompilerId.cu.obj "E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 2. [E:\repository\onnxruntime\build\Windows\Debug\CMakeFiles\3.28.0-rc2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]



  0 Warning(s)
  2 Error(s)

Time Elapsed 00:00:00.68

Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeDetermineCUDACompiler.cmake:135 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:770 (enable_language)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 3019, in
sys.exit(main())
^^^^^^
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 2882, in main
generate_build_tree(
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 1711, in generate_build_tree
run_subprocess(
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 868, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\repository\onnxruntime\tools\python\util\run.py", line 49, in run
completed_process = subprocess.run(
^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\Program Files\CMake\bin\cmake.EXE', 'E:\repository\onnxruntime\cmake', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-DPython_EXECUTABLE=C:\Users\Zbook\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe', '-DPYTHON_EXECUTABLE=C:\Users\Zbook\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe', '-Donnxruntime_USE_VCPKG=OFF', '-Donnxruntime_USE_MIMALLOC=OFF', '-Donnxruntime_ENABLE_PYTHON=OFF', '-Donnxruntime_BUILD_CSHARP=OFF', '-Donnxruntime_BUILD_JAVA=OFF', '-Donnxruntime_BUILD_NODEJS=OFF', '-Donnxruntime_BUILD_OBJC=OFF', '-Donnxruntime_BUILD_SHARED_LIB=OFF', '-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_NNAPI_BUILTIN=OFF', '-Donnxruntime_USE_VSINPU=OFF', '-Donnxruntime_USE_RKNPU=OFF', '-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF', '-Donnxruntime_USE_VITISAI=OFF', '-Donnxruntime_USE_TENSORRT=ON', '-Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON', '-Donnxruntime_USE_MIGRAPHX=OFF', '-Donnxruntime_DISABLE_CONTRIB_OPS=OFF', '-Donnxruntime_DISABLE_ML_OPS=OFF', '-Donnxruntime_DISABLE_RTTI=OFF', '-Donnxruntime_DISABLE_EXCEPTIONS=OFF', '-Donnxruntime_MINIMAL_BUILD=OFF', '-Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF', '-Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF', '-Donnxruntime_REDUCED_OPS_BUILD=OFF', '-Donnxruntime_USE_DML=OFF', '-Donnxruntime_USE_WINML=OFF', '-Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF', '-Donnxruntime_USE_TELEMETRY=OFF', '-Donnxruntime_ENABLE_LTO=OFF', '-Donnxruntime_USE_ACL=OFF', '-Donnxruntime_USE_ARMNN=OFF', '-Donnxruntime_ARMNN_RELU_USE_CPU=ON', '-Donnxruntime_ARMNN_BN_USE_CPU=ON', '-Donnxruntime_USE_JSEP=OFF', '-Donnxruntime_USE_WEBGPU=OFF', '-Donnxruntime_USE_EXTERNAL_DAWN=OFF', '-Donnxruntime_ENABLE_NVTX_PROFILE=OFF', '-Donnxruntime_ENABLE_TRAINING=OFF', '-Donnxruntime_ENABLE_TRAINING_OPS=OFF', '-Donnxruntime_ENABLE_TRAINING_APIS=OFF', '-Donnxruntime_ENABLE_CPU_FP16_OPS=OFF', '-Donnxruntime_USE_NCCL=OFF', '-Donnxruntime_BUILD_BENCHMARKS=OFF', '-Donnxruntime_USE_ROCM=OFF', '-Donnxruntime_GCOV_COVERAGE=OFF', '-Donnxruntime_USE_MPI=OFF', '-Donnxruntime_ENABLE_MEMORY_PROFILE=OFF', '-Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF', '-Donnxruntime_USE_CUDA_NHWC_OPS=ON', '-Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON', '-Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON', '-Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_MEMORY64=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF', '-Donnxruntime_ENABLE_LAZY_TENSOR=OFF', '-Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF', '-Donnxruntime_ENABLE_CUDA_PROFILING=OFF', '-Donnxruntime_ENABLE_ROCM_PROFILING=OFF', '-Donnxruntime_USE_XNNPACK=OFF', '-Donnxruntime_USE_WEBNN=OFF', '-Donnxruntime_USE_CANN=OFF', '-Donnxruntime_USE_TRITON_KERNEL=OFF', '-Donnxruntime_DISABLE_FLOAT8_TYPES=OFF', '-Donnxruntime_DISABLE_SPARSE_TENSORS=OFF', '-Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF', '-Donnxruntime_CUDA_MINIMAL=OFF', '-Donnxruntime_NVCC_THREADS=8', '-DCMAKE_CUDA_COMPILER=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2/bin/nvcc', '-Donnxruntime_TENSORRT_HOME=E:\Libraries\TensorRT-10.5.0.18', '-DCMAKE_VS_GLOBALS=UseMultiToolTask=true;EnforceProcessCountAcrossBuilds=true', '-DCMAKE_TLS_VERIFY=ON', '-DFETCHCONTENT_QUIET=OFF', '-Donnxruntime_USE_CUDA=ON', '-Donnxruntime_CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2', '-Donnxruntime_CUDNN_HOME=C:\Program Files\NVIDIA\CUDNN\v8.9', '-DONNX_USE_MSVC_STATIC_RUNTIME=OFF', '-Dprotobuf_MSVC_STATIC_RUNTIME=OFF', '-DABSL_MSVC_STATIC_RUNTIME=OFF', '-Dgtest_force_shared_crt=ON', '-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase', '-A', 'x64', '-T', 'host=x64,cuda=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2', '-G', 'Visual Studio 17 2022', '-DCMAKE_CUDA_FLAGS_INIT=-allow-unsupported-compiler', '-DCMAKE_BUILD_TYPE=Debug', '-DCMAKE_PREFIX_PATH=E:\repository\onnxruntime\\build\Windows/Debug/installed']' returned non-zero exit status 1.

Visual Studio Version

2022

GCC / Compiler Version

No response

@davave1693 davave1693 added the build build issues; typically submitted using template label Jan 15, 2025
@github-actions github-actions bot added ep:TensorRT issues related to TensorRT execution provider platform:windows issues related to the Windows platform .NET Pull requests that update .net code api:Java issues related to the Java API platform:web issues related to ONNX Runtime web; typically submitted using template labels Jan 15, 2025
@guschmue guschmue removed the platform:web issues related to ONNX Runtime web; typically submitted using template label Jan 15, 2025
@tianleiwu
Copy link
Contributor

tianleiwu commented Jan 15, 2025

Try upgrade cmake to 3.31.4 and Install cudnn 9.x.

Example build comand:

call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
pip install cmake
build.bat --cmake_generator "Visual Studio 17 2022" --config Release --build_wheel ^
          --parallel 4 --nvcc_threads 1 --build_shared_lib ^
          --use_cuda --cuda_version "12.6" --cuda_home "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6" ^
          --cudnn_home "C:\CuDNN\9.6.0.74_cuda12" ^
          --use_tensorrt --tensorrt_home "C:\TensorRT\10.5.0.18_cuda12"
          --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;90" ^
          --skip_tests --compile_no_warning_as_error ^
          --use_binskim_compliant_compile_flags

@davave1693
Copy link
Author

Thank you for your answer, @tianleiwu .

after cmake update and cudnn download, i run:

build.bat --cmake_generator "Visual Studio 17 2022" --config Release --build_wheel ^
          --parallel 4 --nvcc_threads 1 --build_shared_lib ^
          --use_cuda --cuda_version "12.6" --cuda_home "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6" ^
          --cudnn_home "C:\Program Files\NVIDIA\CUDNN\v9.6" ^
          --use_tensorrt --tensorrt_home "E:\Libraries\TensorRT-10.5.0.18" ^
          --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;90" ^
          --skip_tests --compile_no_warning_as_error ^
          --use_binskim_compliant_compile_flags

but other errors occur. Below the output of my compilation:

2025-01-16 09:36:52,061 build [DEBUG] - Command line arguments:
--build_dir 'E:\repository\onnxruntime\build\Windows' --cmake_generator 'Visual Studio 17 2022' --config Release --build_wheel --parallel 4 --nvcc_threads 1 --build_shared_lib --use_cuda --cuda_version 12.6 --cuda_home 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6' --cudnn_home 'C:\Program Files\NVIDIA\CUDNN\v9.6' --use_tensorrt --tensorrt_home 'E:\Libraries\TensorRT-10.5.0.18' --cmake_extra_defines 'CMAKE_CUDA_ARCHITECTURES=75;80;90' --skip_tests --compile_no_warning_as_error --use_binskim_compliant_compile_flags
Namespace(build_dir='E:\repository\onnxruntime\\build\Windows', config=['Release'], update=False, build=False, clean=False, parallel=4, nvcc_threads=1, test=False, skip_tests=True, compile_no_warning_as_error=True, enable_nvtx_profile=False, enable_memory_profile=False, enable_training=False, enable_training_apis=False, enable_training_ops=False, enable_nccl=False, mpi_home=None, nccl_home=None, use_mpi=False, enable_onnx_tests=False, path_to_protoc_exe=None, fuzz_testing=False, enable_symbolic_shape_infer_tests=False, gen_doc=None, gen_api_doc=False, use_cuda=True, cuda_version='12.6', cuda_home='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6', cudnn_home='C:\Program Files\NVIDIA\CUDNN\v9.6', enable_cuda_line_info=False, enable_cuda_nhwc_ops=False, disable_cuda_nhwc_ops=False, enable_cuda_minimal_build=False, enable_pybind=False, build_wheel=True, wheel_name_suffix=None, skip_keras_test=False, build_csharp=False, build_nuget=False, msbuild_extra_options=None, build_java=False, build_nodejs=False, build_objc=False, build_shared_lib=True, build_apple_framework=False, cmake_extra_defines=[['CMAKE_CUDA_ARCHITECTURES=75;80;90']], target=None, x86=False, rv64=False, arm=False, arm64=False, arm64ec=False, buildasx=False, riscv_toolchain_root='', riscv_qemu_path='', msvc_toolset=None, windows_sdk_version=None, android=False, android_abi='arm64-v8a', android_api=27, android_sdk_path='', android_ndk_path='', android_cpp_shared=False, android_run_emulator=False, use_gdk=False, gdk_edition='.', gdk_platform='Scarlett', enable_wasm_memory64=False, ios=False, visionos=False, macos=None, apple_sysroot='', ios_toolchain_file='', visionos_toolchain_file='', xcode_code_signing_team_id='', xcode_code_signing_identity='', cmake_generator='Visual Studio 17 2022', osx_arch='x86_64', apple_deploy_target=None, enable_address_sanitizer=False, use_binskim_compliant_compile_flags=True, disable_memleak_checker=False, use_vcpkg=False, build_wasm=False, build_wasm_static_lib=False, emsdk_version='3.1.59', enable_wasm_simd=False, enable_wasm_threads=False, disable_wasm_exception_catching=False, enable_wasm_api_exception_catching=False, enable_wasm_exception_throwing_override=True, wasm_run_tests_in_browser=False, enable_wasm_profiling=False, enable_wasm_debug_info=False, wasm_malloc=None, emscripten_settings=None, use_extensions=False, extensions_overridden_path=None, cmake_path='cmake', ctest_path='ctest', skip_submodule_sync=False, use_mimalloc=False, use_dnnl=False, dnnl_gpu_runtime='', dnnl_opencl_root='', use_openvino=None, dnnl_aarch64_runtime='', dnnl_acl_root='', use_coreml=False, use_webnn=False, use_snpe=False, snpe_root=None, use_nnapi=False, use_vsinpu=False, nnapi_min_api=None, use_jsep=False, use_webgpu=False, use_external_dawn=False, use_qnn=False, qnn_home=None, use_rknpu=False, use_preinstalled_eigen=False, eigen_path=None, enable_msinternal=False, use_vitisai=False, use_tensorrt=True, use_tensorrt_builtin_parser=True, use_tensorrt_oss_parser=False, tensorrt_home='E:\Libraries\TensorRT-10.5.0.18', test_all_timeout='10800', use_migraphx=False, migraphx_home=None, use_full_protobuf=False, skip_onnx_tests=False, skip_winml_tests=False, skip_nodejs_tests=False, enable_msvc_static_runtime=False, use_dml=False, dml_path='', use_winml=False, winml_root_namespace_override=None, dml_external_project=False, use_telemetry=False, enable_wcos=False, enable_lto=False, enable_transformers_tool_test=False, use_acl=False, acl_home=None, acl_libs=None, use_armnn=False, armnn_relu=False, armnn_bn=False, armnn_home=None, armnn_libs=None, build_micro_benchmarks=False, minimal_build=None, include_ops_by_config=None, enable_reduced_operator_type_support=False, disable_contrib_ops=False, disable_ml_ops=False, disable_rtti=False, disable_types=[], disable_exceptions=False, rocm_version=None, use_rocm=False, rocm_home=None, code_coverage=False, enable_lazy_tensor=False, ms_experimental=False, enable_external_custom_op_schemas=False, external_graph_transformer_path=None, enable_cuda_profiling=False, use_cann=False, cann_home=None, enable_rocm_profiling=False, use_xnnpack=False, use_avx512=False, use_azure=False, use_cache=False, use_triton_kernel=False, use_lock_free_queue=False)
2025-01-16 09:36:52,086 build [DEBUG] - Defaulting to running update, build [and test for native builds].
2025-01-16 09:36:52,095 build [INFO] - Build started
2025-01-16 09:36:52,095 build [INFO] - git submodule sync --recursive
Synchronizing submodule url for 'cmake/external/emsdk'
Synchronizing submodule url for 'cmake/external/libprotobuf-mutator'
Synchronizing submodule url for 'cmake/external/onnx'
Synchronizing submodule url for 'cmake/external/onnx/third_party/pybind11'
2025-01-16 09:36:52,563 build [INFO] - git submodule update --init --recursive
2025-01-16 09:36:53,030 build [INFO] - E:\repository\onnxruntime.venv\Scripts\python.exe -m pip install -r requirements/pybind/requirements.txt
Requirement already satisfied: setuptools in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 1)) (65.5.0)
Requirement already satisfied: wheel in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 2)) (0.45.1)
Requirement already satisfied: pytest in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 3)) (8.3.4)
Requirement already satisfied: numpy>=1.19.0 in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 4)) (2.2.1)
Requirement already satisfied: sympy>=1.10 in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 5)) (1.13.3)
Requirement already satisfied: packaging in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 6)) (24.2)
Requirement already satisfied: cerberus in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 7)) (1.3.7)
Requirement already satisfied: psutil in e:\repository\onnxruntime.venv\lib\site-packages (from -r requirements/pybind/requirements.txt (line 8)) (6.1.1)
Requirement already satisfied: colorama in e:\repository\onnxruntime.venv\lib\site-packages (from pytest->-r requirements/pybind/requirements.txt (line 3)) (0.4.6)
Requirement already satisfied: iniconfig in e:\repository\onnxruntime.venv\lib\site-packages (from pytest->-r requirements/pybind/requirements.txt (line 3)) (2.0.0)
Requirement already satisfied: pluggy<2,>=1.5 in e:\repository\onnxruntime.venv\lib\site-packages (from pytest->-r requirements/pybind/requirements.txt (line 3)) (1.5.0)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in e:\repository\onnxruntime.venv\lib\site-packages (from sympy>=1.10->-r requirements/pybind/requirements.txt (line 5)) (1.3.0)

[notice] A new release of pip is available: 24.0 -> 24.3.1
[notice] To update, run: E:\repository\onnxruntime.venv\Scripts\python.exe -m pip install --upgrade pip
2025-01-16 09:36:53,856 build [INFO] - Generating CMake build tree
2025-01-16 09:36:53,857 build [INFO] - C:\Program Files\CMake\bin\cmake.EXE E:\repository\onnxruntime\cmake --compile-no-warning-as-error -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON -DPython_EXECUTABLE=E:\repository\onnxruntime.venv\Scripts\python.exe -DPYTHON_EXECUTABLE=E:\repository\onnxruntime.venv\Scripts\python.exe -Donnxruntime_USE_VCPKG=OFF -Donnxruntime_USE_MIMALLOC=OFF -Donnxruntime_ENABLE_PYTHON=ON -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_BUILD_JAVA=OFF -Donnxruntime_BUILD_NODEJS=OFF -Donnxruntime_BUILD_OBJC=OFF -Donnxruntime_BUILD_SHARED_LIB=ON -Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF -Donnxruntime_USE_DNNL=OFF -Donnxruntime_USE_NNAPI_BUILTIN=OFF -Donnxruntime_USE_VSINPU=OFF -Donnxruntime_USE_RKNPU=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_VITISAI=OFF -Donnxruntime_USE_TENSORRT=ON -Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON -Donnxruntime_USE_MIGRAPHX=OFF -Donnxruntime_DISABLE_CONTRIB_OPS=OFF -Donnxruntime_DISABLE_ML_OPS=OFF -Donnxruntime_DISABLE_RTTI=OFF -Donnxruntime_DISABLE_EXCEPTIONS=OFF -Donnxruntime_MINIMAL_BUILD=OFF -Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF -Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF -Donnxruntime_REDUCED_OPS_BUILD=OFF -Donnxruntime_USE_DML=OFF -Donnxruntime_USE_WINML=OFF -Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF -Donnxruntime_USE_TELEMETRY=OFF -Donnxruntime_ENABLE_LTO=OFF -Donnxruntime_USE_ACL=OFF -Donnxruntime_USE_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_USE_JSEP=OFF -Donnxruntime_USE_WEBGPU=OFF -Donnxruntime_USE_EXTERNAL_DAWN=OFF -Donnxruntime_ENABLE_NVTX_PROFILE=OFF -Donnxruntime_ENABLE_TRAINING=OFF -Donnxruntime_ENABLE_TRAINING_OPS=OFF -Donnxruntime_ENABLE_TRAINING_APIS=OFF -Donnxruntime_ENABLE_CPU_FP16_OPS=OFF -Donnxruntime_USE_NCCL=OFF -Donnxruntime_BUILD_BENCHMARKS=OFF -Donnxruntime_USE_ROCM=OFF -Donnxruntime_GCOV_COVERAGE=OFF -Donnxruntime_USE_MPI=OFF -Donnxruntime_ENABLE_MEMORY_PROFILE=OFF -Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF -Donnxruntime_USE_CUDA_NHWC_OPS=ON -Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON -Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON -Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_MEMORY64=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF -Donnxruntime_ENABLE_LAZY_TENSOR=OFF -Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF -Donnxruntime_ENABLE_CUDA_PROFILING=OFF -Donnxruntime_ENABLE_ROCM_PROFILING=OFF -Donnxruntime_USE_XNNPACK=OFF -Donnxruntime_USE_WEBNN=OFF -Donnxruntime_USE_CANN=OFF -Donnxruntime_USE_TRITON_KERNEL=OFF -Donnxruntime_DISABLE_FLOAT8_TYPES=OFF -Donnxruntime_DISABLE_SPARSE_TENSORS=OFF -Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF -Donnxruntime_CUDA_MINIMAL=OFF -Donnxruntime_NVCC_THREADS=1 -DCMAKE_CUDA_COMPILER=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6/bin/nvcc -Donnxruntime_TENSORRT_HOME=E:\Libraries\TensorRT-10.5.0.18 -DCMAKE_VS_GLOBALS=UseMultiToolTask=true;EnforceProcessCountAcrossBuilds=true -DCMAKE_CUDA_ARCHITECTURES=75;80;90 -DCMAKE_TLS_VERIFY=ON -DFETCHCONTENT_QUIET=OFF -Donnxruntime_USE_CUDA=ON -Donnxruntime_CUDA_VERSION=12.6 -Donnxruntime_CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6 -Donnxruntime_CUDNN_HOME=C:\Program Files\NVIDIA\CUDNN\v9.6 -DONNX_USE_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -DABSL_MSVC_STATIC_RUNTIME=OFF -Dgtest_force_shared_crt=ON -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase -A x64 -T host=x64,cuda=12.6 -G Visual Studio 17 2022 -DCMAKE_C_FLAGS=/MP4 /guard:cf /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Qspectre /O2 /Ob2 /DNDEBUG -DCMAKE_CXX_FLAGS=/MP4 /guard:cf /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Qspectre /O2 /Ob2 /DNDEBUG -DCMAKE_CUDA_FLAGS_INIT=-allow-unsupported-compiler -allow-unsupported-compiler /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /DNDEBUG -Xcompiler=" /MP4 /guard:cf /Qspectre /O2 /Ob2" -DCMAKE_EXE_LINKER_FLAGS_INIT=/profile /DYNAMICBASE -DCMAKE_MODULE_LINKER_FLAGS_INIT=/profile /DYNAMICBASE -DCMAKE_SHARED_LINKER_FLAGS_INIT=/profile /DYNAMICBASE -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=E:\repository\onnxruntime\build\Windows/Release/installed
Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
CMake Deprecation Warning at CMakeLists.txt:15 (cmake_policy):
The OLD behavior for policy CMP0104 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.42.34436.0
-- The CXX compiler identification is MSVC 19.42.34436.0
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler

"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'E:/repository/onnxruntime/build/Windows/Release/CMakeFiles/CMakeScratch/TryCompile-ogqfe7'

Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_c9b66.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n
MSBuild version 17.12.12+1cce77968 for .NET Framework
Build started 16/01/2025 09:37:01.

Project "E:\repository\onnxruntime\build\Windows\Release\CMakeFiles\CMakeScratch\TryCompile-ogqfe7\cmTC_c9b66.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "cmTC_c9b66.dir\Debug\".
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(504,5): error MSB8040: Spectre-mitigated libraries are required for this project. Install them from the Visual Studio installer (Individual components tab) for any toolsets and architectures being used. Learn more: https://aka.ms/Ofhn4c [E:\repository\onnxruntime\build\Windows\Release\CMakeFiles\CMakeScratch\TryCompile-ogqfe7\cmTC_c9b66.vcxproj]
Done Building Project "E:\repository\onnxruntime\build\Windows\Release\CMakeFiles\CMakeScratch\TryCompile-ogqfe7\cmTC_c9b66.vcxproj" (default targets) -- FAILED.

Build FAILED.

"E:\repository\onnxruntime\build\Windows\Release\CMakeFiles\CMakeScratch\TryCompile-ogqfe7\cmTC_c9b66.vcxproj" (default target) (1) ->
(PrepareForBuild target) ->
  C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(504,5): error MSB8040: Spectre-mitigated libraries are required for this project. Install them from the Visual Studio installer (Individual components tab) for any toolsets and architectures being used. Learn more: https://aka.ms/Ofhn4c [E:\repository\onnxruntime\build\Windows\Release\CMakeFiles\CMakeScratch\TryCompile-ogqfe7\cmTC_c9b66.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.88

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:21 (project)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 3021, in
sys.exit(main())
^^^^^^
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 2884, in main
generate_build_tree(
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 1713, in generate_build_tree
run_subprocess(
File "E:\repository\onnxruntime\tools\ci_build\build.py", line 868, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\repository\onnxruntime\tools\python\util\run.py", line 49, in run
completed_process = subprocess.run(
^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\Program Files\CMake\bin\cmake.EXE', 'E:\repository\onnxruntime\cmake', '--compile-no-warning-as-error', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-DPython_EXECUTABLE=E:\repository\onnxruntime\.venv\Scripts\python.exe', '-DPYTHON_EXECUTABLE=E:\repository\onnxruntime\.venv\Scripts\python.exe', '-Donnxruntime_USE_VCPKG=OFF', '-Donnxruntime_USE_MIMALLOC=OFF', '-Donnxruntime_ENABLE_PYTHON=ON', '-Donnxruntime_BUILD_CSHARP=OFF', '-Donnxruntime_BUILD_JAVA=OFF', '-Donnxruntime_BUILD_NODEJS=OFF', '-Donnxruntime_BUILD_OBJC=OFF', '-Donnxruntime_BUILD_SHARED_LIB=ON', '-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_NNAPI_BUILTIN=OFF', '-Donnxruntime_USE_VSINPU=OFF', '-Donnxruntime_USE_RKNPU=OFF', '-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF', '-Donnxruntime_USE_VITISAI=OFF', '-Donnxruntime_USE_TENSORRT=ON', '-Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON', '-Donnxruntime_USE_MIGRAPHX=OFF', '-Donnxruntime_DISABLE_CONTRIB_OPS=OFF', '-Donnxruntime_DISABLE_ML_OPS=OFF', '-Donnxruntime_DISABLE_RTTI=OFF', '-Donnxruntime_DISABLE_EXCEPTIONS=OFF', '-Donnxruntime_MINIMAL_BUILD=OFF', '-Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF', '-Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF', '-Donnxruntime_REDUCED_OPS_BUILD=OFF', '-Donnxruntime_USE_DML=OFF', '-Donnxruntime_USE_WINML=OFF', '-Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF', '-Donnxruntime_USE_TELEMETRY=OFF', '-Donnxruntime_ENABLE_LTO=OFF', '-Donnxruntime_USE_ACL=OFF', '-Donnxruntime_USE_ARMNN=OFF', '-Donnxruntime_ARMNN_RELU_USE_CPU=ON', '-Donnxruntime_ARMNN_BN_USE_CPU=ON', '-Donnxruntime_USE_JSEP=OFF', '-Donnxruntime_USE_WEBGPU=OFF', '-Donnxruntime_USE_EXTERNAL_DAWN=OFF', '-Donnxruntime_ENABLE_NVTX_PROFILE=OFF', '-Donnxruntime_ENABLE_TRAINING=OFF', '-Donnxruntime_ENABLE_TRAINING_OPS=OFF', '-Donnxruntime_ENABLE_TRAINING_APIS=OFF', '-Donnxruntime_ENABLE_CPU_FP16_OPS=OFF', '-Donnxruntime_USE_NCCL=OFF', '-Donnxruntime_BUILD_BENCHMARKS=OFF', '-Donnxruntime_USE_ROCM=OFF', '-Donnxruntime_GCOV_COVERAGE=OFF', '-Donnxruntime_USE_MPI=OFF', '-Donnxruntime_ENABLE_MEMORY_PROFILE=OFF', '-Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF', '-Donnxruntime_USE_CUDA_NHWC_OPS=ON', '-Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON', '-Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON', '-Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_MEMORY64=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF', '-Donnxruntime_ENABLE_LAZY_TENSOR=OFF', '-Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF', '-Donnxruntime_ENABLE_CUDA_PROFILING=OFF', '-Donnxruntime_ENABLE_ROCM_PROFILING=OFF', '-Donnxruntime_USE_XNNPACK=OFF', '-Donnxruntime_USE_WEBNN=OFF', '-Donnxruntime_USE_CANN=OFF', '-Donnxruntime_USE_TRITON_KERNEL=OFF', '-Donnxruntime_DISABLE_FLOAT8_TYPES=OFF', '-Donnxruntime_DISABLE_SPARSE_TENSORS=OFF', '-Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF', '-Donnxruntime_CUDA_MINIMAL=OFF', '-Donnxruntime_NVCC_THREADS=1', '-DCMAKE_CUDA_COMPILER=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6/bin/nvcc', '-Donnxruntime_TENSORRT_HOME=E:\Libraries\TensorRT-10.5.0.18', '-DCMAKE_VS_GLOBALS=UseMultiToolTask=true;EnforceProcessCountAcrossBuilds=true', '-DCMAKE_CUDA_ARCHITECTURES=75;80;90', '-DCMAKE_TLS_VERIFY=ON', '-DFETCHCONTENT_QUIET=OFF', '-Donnxruntime_USE_CUDA=ON', '-Donnxruntime_CUDA_VERSION=12.6', '-Donnxruntime_CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6', '-Donnxruntime_CUDNN_HOME=C:\Program Files\NVIDIA\CUDNN\v9.6', '-DONNX_USE_MSVC_STATIC_RUNTIME=OFF', '-Dprotobuf_MSVC_STATIC_RUNTIME=OFF', '-DABSL_MSVC_STATIC_RUNTIME=OFF', '-Dgtest_force_shared_crt=ON', '-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase', '-A', 'x64', '-T', 'host=x64,cuda=12.6', '-G', 'Visual Studio 17 2022', '-DCMAKE_C_FLAGS=/MP4 /guard:cf /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Qspectre /O2 /Ob2 /DNDEBUG', '-DCMAKE_CXX_FLAGS=/MP4 /guard:cf /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Qspectre /O2 /Ob2 /DNDEBUG', '-DCMAKE_CUDA_FLAGS_INIT=-allow-unsupported-compiler -allow-unsupported-compiler /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /DNDEBUG -Xcompiler=" /MP4 /guard:cf /Qspectre /O2 /Ob2"', '-DCMAKE_EXE_LINKER_FLAGS_INIT=/profile /DYNAMICBASE', '-DCMAKE_MODULE_LINKER_FLAGS_INIT=/profile /DYNAMICBASE', '-DCMAKE_SHARED_LINKER_FLAGS_INIT=/profile /DYNAMICBASE', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_PREFIX_PATH=E:\repository\onnxruntime\\build\Windows/Release/installed']' returned non-zero exit status 1.

@tianleiwu
Copy link
Contributor

tianleiwu commented Jan 16, 2025

You can follow the error message : error MSB8040: Spectre-mitigated libraries are required for this project. Install them from the Visual Studio installer (Individual components tab) for any toolsets and architectures being used.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:Java issues related to the Java API build build issues; typically submitted using template ep:TensorRT issues related to TensorRT execution provider .NET Pull requests that update .net code platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants