Repository navigation
Conversation
Previously, the static loader implicitly called zeInit() first. With ZES_ENABLE_SYSMAN=1, this activated legacy Sysman initialization, causing the driver to reject the subsequent explicit zesInit() call. Signed-off-by: Oskar Hubert Weber <oskar.hubert.weber@intel.com>
52bd6dd to
5599055
Compare
|
@shubskmr @joshuaranjan if your team could look into this and see if it works for both OLD and NEW systems, loader has to be backward compatible. |
rwmcguir
left a comment
There was a problem hiding this comment.
The idea looks right to me. In the dynamic loader, zesInit already does not call zeInit, so this change makes the static loader behave the same way. Two requests:
1. zesInit now reaches the dynamic loader two times.
Init() calls initialzesDdiTable.Global.pfnInit (the dynamic loader's exported zesInit). Then the zesInit wrapper in source/lib/zes_libapi.cpp calls zesDdiTable.load()->Global.pfnInit(flags) again after the call_once. The dynamic zesInit calls through to the driver each time, so the driver's zesInit also runs two times. It is probably harmless, but it is not needed. A simpler change is to call nothing in the sysmanOnly branch and let the wrapper make the one real call:
if (sysmanOnly) {
// zesInit wrapper calls the dynamic loader's zesInit after Init() returns.
result = ZE_RESULT_SUCCESS;
} else if (!desc) {2. Behavior change for apps that call only zesInit and then use ze* APIs.
With the static loader, these apps worked before only because of the hidden zeInit. After this PR, they get ZE_RESULT_ERROR_UNINITIALIZED. The spec says this was never a valid use, but we should add a note in the changelog or release notes so users are not surprised.
@shubskmr @joshuaranjan, can your team please check both points? Specifically:
- Is it safe for the driver to get
zesInittwo times, or should we remove the second call as shown above? - Do you know of any apps (tools, validation suites, and so on) that call only
zesInitand then use coreze*APIs through the static loader? - Please confirm that this works on both old and new driver/loader combinations, with and without
ZES_ENABLE_SYSMAN=1. The loader must stay backward compatible.
Previously, the static loader implicitly called zeInit() first. With ZES_ENABLE_SYSMAN=1, this activated legacy Sysman initialization, causing the driver to reject the subsequent explicit zesInit() call.
Signed-off-by: Oskar Hubert Weber oskar.hubert.weber@intel.com