Skip to content

Commit abc68a5

Browse files
authored
Fix sysman only init to disallow retrieval of loader context due to version compatibility (#334)
- Given the static loader will no longer call the sysman apis directly, but thru the dynamic loader, split sysman drivers will be done by the dynamic loader and assignment in the static loader is not needed. - When the context read from the loader was newer than the context locally, the memory assignment was invalid causing issues. Signed-off-by: Neil R. Spruit <[email protected]>
1 parent bf5a36f commit abc68a5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

source/lib/ze_lib.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,12 @@ namespace ze_lib
174174
// Given zesInit, then zesDrivers needs to be used as the sysmanInstanceDrivers;
175175
bool loaderContextAccessAllowed = true;
176176
#ifdef DYNAMIC_LOAD_LOADER
177+
loaderContextAccessAllowed = false;
177178
loader::context_t *loaderContext = nullptr;
178-
if (loaderGetContext == nullptr) {
179-
loaderContextAccessAllowed = false;
180-
} else {
181-
loaderContext = loaderGetContext();
182-
}
183179
#else
184180
loader::context_t *loaderContext = loader::context;
185181
#endif
186-
if (sysmanOnly && loaderContextAccessAllowed) {
182+
if (sysmanOnly && loaderContextAccessAllowed && loaderContext != nullptr) {
187183
loaderContext->sysmanInstanceDrivers = &loaderContext->zesDrivers;
188184
}
189185

0 commit comments

Comments
 (0)