Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static L0 Loader Support #224

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Conversation

nrspruit
Copy link
Contributor

@nrspruit nrspruit commented Oct 25, 2024

Static Loader Support.

This support has a few conditions:

  1. zes/ze driver split is not supported without this version of the loader so backwards compatibility for different lists of drivers for ze/zes init is not supported if using the static lib due to needing to modify the loader's context. zes/ze driver list will be the same.
  2. As of this version of the loader, all symbols read between the static loader and the dynamic loader must remain ABI compatible ie all apis exported in source/loader/ze_loader_api.h now must be abi compatible.

@nrspruit
Copy link
Contributor Author

example output:
scss_dev@nuc612dut2:~/level-zero-tests/build$ ./output/test_init_sysman
Context created static
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SysmanInitTests
[ RUN ] SysmanInitTests.GivenCoreNotInitializedWhenSysmanInitializedThenzesDriverGetWorks
Context created context lib dynamic
Context created dynamic
loader created context lib dynamic
calling loader init static
ZE_LOADER_DEBUG_TRACE:Using Loader Library Path:
ZE_LOADER_DEBUG_TRACE:Loading Driver libze_intel_gpu.so.1
ZE_LOADER_DEBUG_TRACE:Loading Driver libze_intel_gpu_legacy1.so.1
ZE_LOADER_DEBUG_TRACE:Load Library of libze_intel_gpu_legacy1.so.1 failed with libze_intel_gpu_legacy1.so.1: cannot open shared object file: No such file or directory
ZE_LOADER_DEBUG_TRACE:Loading Driver libze_intel_vpu.so.1
ZE_LOADER_DEBUG_TRACE:Load Library of libze_intel_vpu.so.1 failed with libze_intel_vpu.so.1: cannot open shared object file: No such file or directory
ZE_LOADER_DEBUG_TRACE:Loading Driver libze_intel_npu.so.1
ZE_LOADER_DEBUG_TRACE:Load Library of libze_intel_npu.so.1 failed with libze_intel_npu.so.1: cannot open shared object file: No such file or directory
ZE_LOADER_DEBUG_TRACE:Tracing Layer Library Path: libze_tracing_layer.so.1
done loading functions
zelLoaderGetContext
calling static loader ddi init
ZE_LOADER_DEBUG_TRACE:check_drivers(flags=0(ZE_INIT_ALL_DRIVER_TYPES_ENABLED))
ZE_LOADER_DEBUG_TRACE:init driver libze_intel_gpu.so.1 zesInit(0(ZE_INIT_ALL_DRIVER_TYPES_ENABLED)) returning ZE_RESULT_SUCCESS
[ OK ] SysmanInitTests.GivenCoreNotInitializedWhenSysmanInitializedThenzesDriverGetWorks (29 ms)
[----------] 1 test from SysmanInitTests (29 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (29 ms total)
[ PASSED ] 1 test.
loader destroyed context lib dynamic
Context destroyed context lib dynamic
scss_dev@nuc612dut2:~/level-zero-tests/build$ ldd ./output/test_init_sysman
linux-vdso.so.1 (0x00007ffc7d5d8000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1d4a200000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1d4a519000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1d4a922000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1d49e00000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1d4a958000)

Copy link
Contributor

@lisanna-dettwyler lisanna-dettwyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple small comments from looking at it briefly

source/CMakeLists.txt Outdated Show resolved Hide resolved
source/lib/ze_lib.cpp Outdated Show resolved Hide resolved
@nrspruit nrspruit changed the title [DO_NOT_MERGE] Static L0 Loader Support Static L0 Loader Support Nov 15, 2024
@nrspruit nrspruit requested a review from aravindksg November 15, 2024 19:59
@nrspruit nrspruit force-pushed the static_loader branch 2 times, most recently from 62860db to 0397704 Compare November 15, 2024 21:40
@ilya-lavrenov
Copy link
Contributor

Issue #141

Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
- Added support for older dii tables such that the version of the apis
  supported by that dynamic loader are requested and not newer versions.
- Added check for backwards compatability for older init apis.

Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants