Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a build error when CUDA is enabled and onnxruntime_DISABLE_CONTRI…
…B_OPS is ON (#21285) Resolve #21204 To reproduce the issue, build the code with ``` python3 tools/ci_build/build.py --build_dir /tmp/build13 --config Debug --skip_submodule_sync --build_shared_lib --parallel --use_binskim_compliant_compile_flags --build_csharp --enable_onnx_tests --update --build --build_wheel --use_cuda --cuda_home /usr/local/cuda --cudnn_home /usr/local/cuda --cmake_extra_defines onnxruntime_DISABLE_CONTRIB_OPS=ON onnxruntime_BUILD_UNIT_TESTS=OFF --skip_tests ``` Then run the following python script: ```python #!/usr/bin/python3 import onnxruntime as ort providers = [("CUDAExecutionProvider")] ort_sess = ort.InferenceSession('/data/onnx/opset17/test_gemm_default_no_bias/model.onnx', providers=providers) ``` Without this fix, you will see an error: Failed to load library libonnxruntime_providers_cuda.so with error: /tmp/build18/Debug/onnxruntime/capi/libonnxruntime_providers_cuda.so: undefined symbol: _ZN11onnxruntime4cuda21BuildKernelCreateInfoINS0_57kCudaExecutionProvider_GridSample_kOnnxDomain_ver16_floatEEENS_16KernelCreateInfoEv
- Loading branch information