-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Comments
Try upgrade cmake to 3.31.4 and Install cudnn 9.x. Example build comand:
|
Thank you for your answer, @tianleiwu . after cmake update and cudnn download, i run:
but other errors occur. Below the output of my compilation: 2025-01-16 09:36:52,061 build [DEBUG] - Command line arguments: [notice] A new release of pip is available: 24.0 -> 24.3.1 The cmake-policies(7) manual explains that the OLD behaviors of all -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
is not able to compile a simple test program. It fails with the following output:
CMake will not be able to correctly generate this project. -- Configuring incomplete, errors occurred! |
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:
InitializeBuildStatus:
AddCudaCompileDeps:
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:
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]
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) ->
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:
InitializeBuildStatus:
AddCudaCompileDeps:
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:
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]
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) ->
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
The text was updated successfully, but these errors were encountered: