-
Notifications
You must be signed in to change notification settings - Fork 123
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
[L0] Use zesInit for SysMan API usage #1886
Conversation
1d3b02d
to
e83ec51
Compare
cee662a
to
810cf5d
Compare
-pre-commit PR for oneapi-src/unified-runtime#1886 Signed-off-by: Neil R. Spruit <[email protected]>
- Change to using zesInit and zes data structures for accessing L0 SysMan functionality. - Updated Platform & Devices to store zes handles if sysman support is available. - Given Legacy Environment Variable from user, then fallback to old functionality. - Fixed Return code on error to be consistently unsupported enumeration. Signed-off-by: Neil R. Spruit <[email protected]>
810cf5d
to
dbdc7e7
Compare
-pre-commit PR for oneapi-src/unified-runtime#1886 Signed-off-by: Neil R. Spruit <[email protected]>
-pre-commit PR for oneapi-src/unified-runtime#1886 Signed-off-by: Neil R. Spruit <[email protected]>
uint32_t ZeDriverCount = 0; | ||
ZE2UR_CALL(zeDriverGet, (&ZeDriverCount, nullptr)); | ||
if (ZeDriverCount == 0) { | ||
return UR_RESULT_SUCCESS; | ||
} | ||
|
||
uint32_t ZesDriverCount = 0; | ||
ze_result_t zesDriverGetResult = ZE_RESULT_ERROR_UNINITIALIZED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zesinit/zesDriverGet was introduced from v1.5 onwards IIRC, so do we need a way to check version here before call zesDriverGet?
// then a null sysman driver is associated. The index of the ZE and ZES | ||
// driver should match. | ||
if (I < ZesDrivers.size()) { | ||
zesDriverHandle = ZesDrivers[I]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm how can we be sure the drivers are enumerated in same order? but having said that i see core driver_properties at least provide a a driver_uuid but Sysman does not have that.
@@ -304,14 +304,30 @@ ur_result_t ur_platform_handle_t_::populateDeviceCacheIfNeeded() { | |||
|
|||
uint32_t ZeDeviceCount = 0; | |||
ZE2UR_CALL(zeDeviceGet, (ZeDriver, &ZeDeviceCount, nullptr)); | |||
uint32_t ZesDeviceCount = 0; | |||
if (ZesDriver) { | |||
ZE2UR_CALL(zesDeviceGet, (ZesDriver, &ZesDeviceCount, nullptr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might again need version check before calling zesDeviceGet to make sure we have support?
// then a null sysman device is associated. The index of the ZE and ZES | ||
// devices should match. | ||
if (I < ZesDevices.size()) { | ||
zesDeviceHandle = ZesDevices[I]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to match uuid here between core and sysman devices before association here? or you are not doing that for now since it was a very recent change in UMD?
replaced by #2017 which itself is awaiting a patch for dynamic dependency loading. |
SysMan functionality.
available.
old functionality.