level-zero icon indicating copy to clipboard operation
level-zero copied to clipboard

Loader versioning

Open Kerilk opened this issue 3 years ago • 3 comments

In 1.5.0 release, the signature of zeLoaderInit was changed, but there does not exist a way currently to determine what version of this symbol the library is exporting.

For reference here are the two versions of this symbol somebody might encounter:

ZE_DLLEXPORT ze_result_t ZE_APICALL zeLoaderInit();

ZE_DLLEXPORT ze_result_t ZE_APICALL zeLoaderInit(ze_init_flags_t flags);

There should exist a zeLoaderGetVersion API call to programmatically determine the loader version to ensure a correct call with the right signature can be made.

Kerilk avatar Sep 14 '21 17:09 Kerilk

zeLoaderInit is not really intended to be an externally visible symbol. It's called from within the loader and isn't currently intended to be called from an external application. There was some consideration of different future use cases that would require external visibility which is why ZE_DLLEXPORT and ZE_APICALL are added, but they aren't fully supported right now. Those attributes should probably be removed.

Do you have an application that's calling zeLoaderInit directly?

bmyates avatar Sep 14 '21 18:09 bmyates

I remember having to add it to THAPI/iprof because of one of the Intel runtime calling it through dlopen/dlsym (if I remember correctly).

edit: or it could have been due to https://github.com/oneapi-src/level-zero/issues/39 I will try to see if we still find the symbol called in our traces.

edit2: apparently not since https://github.com/oneapi-src/level-zero/commit/7349a2306bb5174252b3e47bb939a1aaae107fdc, so changing it may be safe, even if, for the sake of certainty, you could consider creating a zeLoaderInitEx, use it internally, and make zeLoaderInit a wrapper around it.

Kerilk avatar Sep 14 '21 18:09 Kerilk

@Kerilk Is this still an issue, or can close it? (I cannot)

eero-t avatar Nov 21 '23 11:11 eero-t