Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

nrspruit
Copy link
Contributor

@nrspruit nrspruit commented Jul 24, 2024

  • 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.

@github-actions github-actions bot added the level-zero L0 adapter specific issues label Jul 24, 2024
@nrspruit nrspruit force-pushed the l0_sysman_default branch from 1d3b02d to e83ec51 Compare July 24, 2024 00:34
@github-actions github-actions bot added the conformance Conformance test suite issues. label Jul 24, 2024
@nrspruit nrspruit force-pushed the l0_sysman_default branch 6 times, most recently from cee662a to 810cf5d Compare July 24, 2024 22:26
nrspruit added a commit to nrspruit/llvm that referenced this pull request Jul 24, 2024
- 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]>
@nrspruit nrspruit force-pushed the l0_sysman_default branch from 810cf5d to dbdc7e7 Compare July 24, 2024 22:51
nrspruit added a commit to nrspruit/llvm that referenced this pull request Jul 24, 2024
nrspruit added a commit to nrspruit/llvm that referenced this pull request Jul 24, 2024
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;

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];

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));

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];

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?

@nrspruit
Copy link
Contributor Author

replaced by #2017 which itself is awaiting a patch for dynamic dependency loading.

@nrspruit nrspruit closed this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conformance Conformance test suite issues. level-zero L0 adapter specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants