-
Notifications
You must be signed in to change notification settings - Fork 822
Set RUNPATH for libur_adapter_* #21650
Description
Describe the bug
libur_adapter_level_zero.so (and all other UR Adapters as well) now depend on libufm.so. Deployed SYCL applications need to redistribute at least libsycl.so.8, libur_loader.so.0, libufm.so, and e.g. libur_adatper_level_zero.so to be able to run. However, those app still won't start when LD_LIBRARY_PATH does not point to the folder containing above libs, because libur_adapter_level_zero.so will fail to find libufm.so.
To remedy, set RUNPATH for libur_adapter_* to $ORIGIN, similar as PR #15850 did for libsycl.so to find libur_loader.so.``
To reproduce
Works: dpcpp_6.3.0/lib > readelf -d ./libsycl.so
Dynamic section at offset 0x455670 contains 35 entries:
Tag Type Name/Value
...
0x0000000000000001 (NEEDED) Shared library: [libur_loader.so.0]
...
0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]
0x000000000000000e (SONAME) Library soname: [libsycl.so.8]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
0x000000000000000c (INIT) 0x79000
Fails: dpcpp_6.3.0/lib > readelf -d ./libur_adapter_level_zero.so
Dynamic section at offset 0x24dd80 contains 36 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libumf.so.1]
...
0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]
0x000000000000000e (SONAME) Library soname: [libur_adapter_level_zero.so.0]
0x000000000000000c (INIT) 0x11000
Note missing (RUNPATH) Library runpath: [$ORIGIN] for libur_adapter_level_zero.so
Symptoms when running SYCL apps without set LD_LIBRARY_PATH are for example
No device of requested type 'info::device_type::gpu' available.
although a GPU is present and although it is working alright when setting LD_LIBRARY_PATH accordingly.
Environment
-
OS: Linux, Ubuntu 24.04
-
Target device and vendor: Intel GPU and others
-
DPC++ version: v6.3.0
-
Dependencies version, the output of
sycl-ls --verbose./sycl-ls: error while loading shared libraries: libsycl.so.8: cannot open shared object file: No such file or directory
(same issue with applications like
sycl-lsthat haveRUNPATHnot set, but this is another story, unrelated to deploying SYCL applications)
Additional context
No response