intel / compute-runtime

Intel® Graphics Compute Runtime for oneAPI Level Zero and OpenCL™ Driver
MIT License
1.1k stars 229 forks source link

zeCommandListHostSynchronize throws unexpected error code #670

Closed pvelesko closed 10 months ago

pvelesko commented 10 months ago

Saw this new feature and wanted to try it.

Possible return codes: ZE_RESULT_SUCCESS

ZE_RESULT_ERROR_UNINITIALIZED

ZE_RESULT_ERROR_DEVICE_LOST

ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY

ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY

ZE_RESULT_ERROR_INVALID_NULL_HANDLE

nullptr == hCommandList

ZE_RESULT_NOT_READY

timeout expired

ZE_RESULT_ERROR_INVALID_ARGUMENT

handle does not correspond to an immediate command list

Actual result:

Using regular command list
Device   : Intel(R) Arc(TM) A380 Graphics
Type     : GPU
Vendor ID: 8086
#Queue Groups: 2
Launching Kernel
Kernel Launched
Closing Command List ... complete
Host Synchronize ...Error at zeCommandListHostSynchronize(cmdList, std::numeric_limits<uint64_t>::max()): main: 105
Exit with Error Code: 0x78000003
Error Description: ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
terminate called without an active exception
[1]    98025 IOT instruction (core dumped)  ./driver

Driver Version 23.17.26241.22

BartoszDunajski commented 10 months ago

Hi, zeCommandListHostSynchronize can be used only on immediate command lists. According to attached log, you are using "regular" command list, which is not allowed. You are right, error code should be different (ZE_RESULT_ERROR_INVALID_ARGUMENT), but this feature is still under development - this is why you see ZE_RESULT_ERROR_UNSUPPORTED_FEATURE.

https://spec.oneapi.io/level-zero/latest/core/api.html#zecommandlisthostsynchronize "Synchronizes an immediate command list by waiting on the host for the completion of all commands previously submitted to it."

pvelesko commented 10 months ago

Opps, forgot to uncomment the line that enables imm lists. Just tested and it works. Keep it open to track the return code or close. Thanks. @BartoszDunajski