onnxruntime
de99059e - Fix build pipeline for CUDA 13.0 (#26983)

Commit
1 day ago
Fix build pipeline for CUDA 13.0 (#26983) This PR fixes the build pipeline failures observed with CUDA 13.0. ### Changes: 1. **Compiler Flags**: Fixed check_nvcc_compiler_flag macro in adjust_global_compile_flags.cmake to correctly pass flags to the host compiler using -Xcompiler, preventing 'nvcc fatal' errors. Added cmake/empty.c for this check. 2. **Node.js Bindings**: Fixed warn_unused_result warnings in session_options_helper.cc by wrapping CreateCUDAProviderOptions calls with Ort::ThrowOnError. 3. **CCCL Header Location**: Updated `onnxruntime_providers_cuda.cmake` to handle the relocation of CCCL headers in CUDA 13.0. It now adds the `cccl` subdirectory to include paths when detected, ensuring headers like `<cuda/std/utility>` are correctly found. 4. Update nuget pipeline to pass cudnn home to build command line for cuda 13. See "cudnn not found" issue below. 5. Diable a step 'Test C API application for GPU package' in nuget pipeline, since "Onnxruntime-Linux-GPU-A10" pool has old cuda driver which cannot run cuda 13. This is a temporary walkaround to unblock the pipeline before we have a pool with new cuda driver. #### Issue: cuda/std/utility not found See https://github.com/microsoft/onnxruntime/issues/26362. I tried two ways to fix it, one is to change CMAKE_CUDA_COMPILER_FRONTEND_VARIANT, another is to add include cccl path for cuda 13. Both can fix the error in build pipeline. Since the second approach more straightforward, it is kept. #### Issue: cudnn not found The Windows packaging builds ("Windows_Packaging_CUDA" and "Windows_Packaging_TensorRT") were failing for CUDA 13.0 because the --cudnn_home argument was missing from the build.py command line. Note that CUDA 12.8 build has no such problem, since we put cudnn with cuda togother. For cuda 13, we separate cuda and cudnn to two directories, so we need add --cudnn_home in build commands for CUDA 13. Fix: * Defined win_cudnn_home in c-api-noopenmp-packaging-pipelines.yml and cuda-packaging-pipeline.yml (set to $(Agent.TempDirectory)\9.14.0.64_cuda13 for CUDA 13.0). * Propagated this variable through nuget-combine-cuda-stage.yml to nuget-win-cuda-packaging-stage.yml * Updated nuget-win-cuda-packaging-stage.yml to conditionally add --cudnn_home=${{ parameters.win_cudnn_home }} to the build parameters when the variable is set.
Author
Parents
Loading