- Notifications
You must be signed in to change notification settings - Fork 3.5k
[CUDA] Fix cuda 13 build #26153
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
Merged
Merged
[CUDA] Fix cuda 13 build #26153
+93 −40
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
hariharans29 approved these changes Sep 25, 2025
| How to solve this problem: CUDA 13 runtime crash: Concat kernel missing symbol on Jetson Thor (#26212) |
fs-eire pushed a commit that referenced this pull request Oct 24, 2025
Fix cuda 13 build errors and warnings. Related: #25936 I've verified the build in Linux and Windows using the following test settings: ### Build command line You may need change cuda_home and cudnn_home to your installation directories, also update CMAKE_CUDA_ARCHITECTURES according to your GPU. #### Linux Build ``` pip install cmake ninja packaging numpy sh build.sh --config Release --build_dir build/cuda13 --parallel --use_cuda \ --cuda_version 12.8 --cuda_home /nvida/cuda13.0/ \ --cudnn_home /nvida/cudnn9.12_cu13/ \ --build_wheel --skip_tests \ --cmake_generator Ninja \ --enable_cuda_nhwc_ops \ --use_binskim_compliant_compile_flags \ --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=90-real;90-virtual \ --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON \ --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON ``` #### Windows Build ``` IF "%VCToolsVersion%"=="" call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" build.bat --cmake_generator "Visual Studio 17 2022" --config Release --build_dir build\cuda13 --build_wheel ^ --parallel 4 --nvcc_threads 1 --build_shared_lib ^ --use_cuda --cuda_version "13.0" --cuda_home "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0" ^ --cudnn_home "D:\cudnn\9.13.0.50_cuda13" ^ --skip_tests ^ --use_binskim_compliant_compile_flags ^ --enable_cuda_nhwc_ops ^ --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=native" ^ --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON ^ --cmake_extra_defines FETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER ``` The onnxruntime_test_all.exe is passed for RTX 5060 Ti GPU, so the binary can support blackwell GPU (CUDA_ARCHITECTURES=120) properly with CUDA 13.0: ``` [----------] Global test environment tear-down [==========] 1242 tests from 111 test suites ran. (83468 ms total) [ PASSED ] 1242 tests. ```
3 tasks
naomiOvad pushed a commit to naomiOvad/onnxruntime that referenced this pull request Nov 2, 2025
Fix cuda 13 build errors and warnings. Related: microsoft#25936 I've verified the build in Linux and Windows using the following test settings: ### Build command line You may need change cuda_home and cudnn_home to your installation directories, also update CMAKE_CUDA_ARCHITECTURES according to your GPU. #### Linux Build ``` pip install cmake ninja packaging numpy sh build.sh --config Release --build_dir build/cuda13 --parallel --use_cuda \ --cuda_version 12.8 --cuda_home /nvida/cuda13.0/ \ --cudnn_home /nvida/cudnn9.12_cu13/ \ --build_wheel --skip_tests \ --cmake_generator Ninja \ --enable_cuda_nhwc_ops \ --use_binskim_compliant_compile_flags \ --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=90-real;90-virtual \ --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON \ --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON ``` #### Windows Build ``` IF "%VCToolsVersion%"=="" call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" build.bat --cmake_generator "Visual Studio 17 2022" --config Release --build_dir build\cuda13 --build_wheel ^ --parallel 4 --nvcc_threads 1 --build_shared_lib ^ --use_cuda --cuda_version "13.0" --cuda_home "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0" ^ --cudnn_home "D:\cudnn\9.13.0.50_cuda13" ^ --skip_tests ^ --use_binskim_compliant_compile_flags ^ --enable_cuda_nhwc_ops ^ --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=native" ^ --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON ^ --cmake_extra_defines FETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER ``` The onnxruntime_test_all.exe is passed for RTX 5060 Ti GPU, so the binary can support blackwell GPU (CUDA_ARCHITECTURES=120) properly with CUDA 13.0: ``` [----------] Global test environment tear-down [==========] 1242 tests from 111 test suites ran. (83468 ms total) [ PASSED ] 1242 tests. ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Fix cuda 13 build errors and warnings.
Related: #25936
I've verified the build in Linux and Windows using the following test settings:
Build command line
You may need change cuda_home and cudnn_home to your installation directories, also update CMAKE_CUDA_ARCHITECTURES according to your GPU.
Linux Build
Windows Build
The onnxruntime_test_all.exe is passed for RTX 5060 Ti GPU, so the binary can support blackwell GPU (CUDA_ARCHITECTURES=120) properly with CUDA 13.0: