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

[DO_NOT_MERGE] Static L0 Loader Support #224

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

Conversation

nrspruit
Copy link
Contributor

Very early draft of the static Loader.

This works with the current version of the loader, but there is some versioning checks we will want to do.

Posting this to start the development process and start feedback.

Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
@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

""
${CMAKE_CURRENT_BINARY_DIR}/ZeLoaderVersion.rc
)
if (DYNAMIC_LOAD_LOADER)
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommend the top level cmake option be named after the result rather than the behavior, like BUILD_STATIC

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, that would differentiate.

auto loaderTracingLayerInit = reinterpret_cast<zelLoaderTracingLayerInit_t>(
GET_FUNCTION_PTR(loader, "zelLoaderTracingLayerInit") );
if (loaderTracingLayerInit == nullptr) {
printf("missing loaderTracingLayerInit\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these should be going to stderr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, I was going to convert the printfs to debug trace logs for the ones we determine useful.

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.

2 participants