microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.1k stars 2.84k forks source link

[Build] Getting issue with ONNX Runtime library name #21763

Open mc-nv opened 4 weeks ago

mc-nv commented 4 weeks ago

Describe the issue

Trying to compile ONNX Runtime using rel-1.19.0 vs rel-1.18.0 Getting successful compilation results but link chain of binaries is different rel-1.18.0:

root@50b647a109ef:/opt/onnxruntime# ll /workspace/build/Release/libonnxruntime.so*
lrwxrwxrwx 1 root root       24 Jun 24 16:17 /workspace/build/Release/libonnxruntime.so -> libonnxruntime.so.1.18.0*
-rwxr-xr-x 1 root root 24707248 Jun 24 16:17 /workspace/build/Release/libonnxruntime.so.1.18.0*

rel-1.19.0:

root@ec9d237bd43b:/opt/onnxruntime# ll /workspace/build/Release/libonnxruntime.so*
lrwxrwxrwx 1 root root       19 Aug 13 23:12 /workspace/build/Release/libonnxruntime.so -> libonnxruntime.so.1*
lrwxrwxrwx 1 root root       24 Aug 13 23:12 /workspace/build/Release/libonnxruntime.so.1 -> libonnxruntime.so.1.19.0*
-rwxr-xr-x 1 root root 25694920 Aug 13 23:12 /workspace/build/Release/libonnxruntime.so.1.19.0*

Urgency

Suppose it need to be fixed before release.

Target platform

LINUX

Build script

./build.sh --config Release --skip_submodule_sync --parallel --build_shared_lib     --build_dir /workspace/build --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES='60;61;70;75;80;86;90'  --update --build --use_cuda --cuda_home "/usr/local/cuda" --cudnn_home "/usr/local/cudnn-9.3/cuda" --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_home "/usr/src/tensorrt" --allow_running_as_root --use_openvino CPU

in our scenario libonnxruntime.so will be copy out to /tmp/tritonbuild/onnxruntime/build/onnxruntime/lib and application will be linked against that folder:

[100%] Linking CXX shared library libtriton_onnxruntime.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/triton-onnxruntime-backend.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O3 -DNDEBUG -Wl,--version-script libtriton_onnxruntime.ldscript -shared -Wl,-soname,libtriton_onnxruntime.so -o libtriton_onnxruntime.so "CMakeFiles/triton-onnxruntime-backend.dir/src/onnxruntime.cc.o" "CMakeFiles/triton-onnxruntime-backend.dir/src/onnxruntime_loader.cc.o" "CMakeFiles/triton-onnxruntime-backend.dir/src/onnxruntime_utils.cc.o"   -L/tmp/tritonbuild/onnxruntime/build/onnxruntime/lib  -Wl,-rpath,"\${ORIGIN}" _deps/repo-core-build/libtritonserver.so _deps/repo-backend-build/libtritonbackendutils.a -lonnxruntime /usr/local/cuda-12.6/targets/x86_64-linux/lib/libcudart.so -lopenvino _deps/repo-common-build/src/libtritonasyncworkqueue.a /usr/local/cuda-12.6/targets/x86_64-linux/lib/libcudart.so _deps/repo-backend-build/libkernel_library_new.a /usr/local/cuda-12.6/targets/x86_64-linux/lib/libcupti.so 
gmake[2]: Leaving directory '/tmp/tritonbuild/onnxruntime/build'

Error / output

Linking against directory will pick the names out of file header and if it not present application won't be running properly. Could you please standardize link chain for artifact.

rel-1.18.0:

root@50b647a109ef:/opt/onnxruntime# readelf -V /workspace/build/Release/libonnxruntime.so.1.18.0 | grep libonnxr*
  000000: Rev: 1  Flags: BASE  Index: 1  Cnt: 1  Name: libonnxruntime.so.1.18.0

rel-1.19.0:

root@3fd42308d0cd:/opt/onnxruntime# readelf -V /workspace/build/Release/libonnxruntime.so.1.19.0 | grep libonnxr*
  000000: Rev: 1  Flags: BASE  Index: 1  Cnt: 1  Name: libonnxruntime.so.1

Visual Studio Version

No response

GCC / Compiler Version

No response

mc-nv commented 4 weeks ago

cc: @pranavsharma , @yf711

yf711 commented 4 weeks ago

@prathikr @MaanavD