oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

Loader versioning #67

Open Kerilk opened 3 years ago

Kerilk commented 3 years ago

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.

bmyates commented 3 years ago

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?

Kerilk commented 3 years ago

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.

eero-t commented 10 months ago

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