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

Add a way to translate from/to ZES/ZE device handle when using zesInit() #153

Open
bgoglin opened this issue May 29, 2024 · 5 comments
Open
Labels

Comments

@bgoglin
Copy link
Contributor

bgoglin commented May 29, 2024

Followup to intel/compute-runtime#686 (comment)

We need a way to translate from/to ZE/ZES device handles when using zesInit(). This is needed to be able to query some device info from ZES and combine it with ZE info. It was reported under work but I still cannot find it and couldn't get a reply on the specification/implementation status.

@saik-intel
Copy link

hi @bgoglin we have added APIs to map based on UUID of device in spec 1.9 https://spec.oneapi.io/level-zero/latest/sysman/api.html#sysmandevicemapping and implementation is under work in progress and will expect to avaliable by June 2024 end

@bgoglin
Copy link
Contributor Author

bgoglin commented Sep 2, 2024

hi @bgoglin we have added APIs to map based on UUID of device in spec 1.9 https://spec.oneapi.io/level-zero/latest/sysman/api.html#sysmandevicemapping and implementation is under work in progress and will expect to avaliable by June 2024 end

Hello. Can you update me regarding the implementation status? If done, which releases started having it?

@saik-intel
Copy link

saik-intel commented Oct 22, 2024

hi @bgoglin based on UUID , we could map from core device handle to sysman device handle but its not directly casting from core device to sysman device, we are not planning to support casting from core to sysman and vice versa which is not possible. Please read Sysman Initialization https://github.com/intel/compute-runtime/blob/master/programmers-guide/SYSMAN.md

@saik-intel
Copy link

@bgoglin also please go through https://oneapi-src.github.io/level-zero-spec/level-zero/latest/sysman/api.html#sysmandevicemapping-functions APIs for mapping from core device handle -> sysman device handle

@AshwinKumarKulkarni
Copy link

please find below some steps about mapping core device handle to sysman device handle and vice versa when using zesInit().

Mapping core handle to sysman handle:

  1. Get UUID of core handle from "zeDeviceGetProperties(ze_device_handle_t hDevice, ze_device_properties_t *pDeviceProperties)".
    (note down ze_device_properties_t.uuid)

2.please pass UUID along with sysman driver handle to "zesDriverGetDeviceByUuidExp(zes_driver_handle_t hDriver, zes_uuid_t uuid, zes_device_handle_t *phDevice, ze_bool_t *onSubdevice, uint32_t *subdeviceId)" to get sysman handle as "phDevice" equivalent to core handle.
Note: hDriver should be got from zesDriverGet().

Mapping sysman handle to core handle:

  1. Get UUID of the sysman device handle from "zesDeviceGetProperties(zes_device_handle_t hDevice, zes_device_properties_t *pProperties)" for sysman device
    and if zes_device_properties_t.numSubdevices > 0, then get UUIDs of sub devices using "zesDeviceGetSubDevicePropertiesExp(zes_device_handle_t hDevice, uint32_t *pCount, zes_subdevice_exp_properties_t *pSubdeviceProps)".

  2. Using the UUID of sysman device handle of interest, it is possible to compare UUIDs of the core device handles got from "zeDeviceGetProperties(ze_device_handle_t hDevice, ze_device_properties_t *pDeviceProperties)" to get the mapping core device handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants