oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

zeKernelSetGroupSize exception when setting wrong dimensions #62

Closed jjfumero closed 3 years ago

jjfumero commented 3 years ago

Playing a bit with the thread scheduler I noticed that the following call throws an exception when setting a wrong block size:

uint32_t groupSizeX = 32u;
uint32_t groupSizeY = 32u;
uint32_t groupSizeZ = 1u;
zeKernelSetGroupSize(kernel, groupSizeX, groupSizeY, groupSizeZ);

The exception is as follows:

Error at zeKernelSetGroupSize(kernel, groupSizeX, groupSizeY, groupSizeZ): main: 161
terminate called without an active exception
Aborted (core dumped)

From my understanding, following the spec (https://spec.oneapi.com/level-zero/latest/core/api.html#zekernelsetgroupsize), we should get the error code ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION.

https://spec.oneapi.com/level-zero/latest/core/api.html#ze__api_8h_1a3ea791bcf22ddfc1d413579b12c22767ade51cf698db72dacd34378a5c33d45cf

Is this the expected behaviour?

I am using level zero: https://github.com/oneapi-src/level-zero/commit/ae10adce3668158072f89cf511581bd48300ad36 compute-runtime: 21.20.19883

jandres742 commented 3 years ago

@jjfumero : The segfault you are showing doesn't seem to come from either the driver or the loader, but from the application (it says main:161). Which test are you using? Does the test have an abort condition if ZE_RESULT_SUCCESS is not returned?

jjfumero commented 3 years ago

Hi @jandres742 . Sorry, my fault, you are right. I had changed the error control and I missed printing the right error code. I actually get ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION with value: 0x78000013 as expected.

So, I can confirm it works. This issue can be closed.