Skip to content

Commit

Permalink
Fix a build error when CUDA is enabled and onnxruntime_DISABLE_CONTRI…
Browse files Browse the repository at this point in the history
…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
snnn authored Jul 16, 2024
1 parent 2183014 commit 8568a67
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 0 deletions.

0 comments on commit 8568a67

Please sign in to comment.