-
Notifications
You must be signed in to change notification settings - Fork 73
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
Debug GPU assembly of level zero kernels #108
Comments
Hi, stepping into ZeCommandQueueExecuteCommandLists will go into ze_loader and L0 driver implementation of that function. This will not step directly into the kernel. What format is the module input you are using? SPIRV or native? You will need to set a breakpoint inside kernel before execution to debug it |
I am generating |
Hello, it is possible to debug level zero kernels. For that setup environment has to be setup similarly to what is done for SYCL application debugging (https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-debugging-dpcpp-linux/top.html), especially: export ZET_ENABLE_PROGRAM_DEBUGGING=1 Then, start application under gdb.
Continue execution on HOST, when module is created - message should be printed:
Now, dump memory :
Read elf to find out entry point address:
Elf file should list entries in symbol table, something similar to:
The address to set BP from above is 0x8000fff400c0:
continue Now debugger should stop in the kernel
When stopped on GPU thread - it is possible to disassemble binary and single step. Regards, |
seems our address might be wrong
set BP at
set BP at
@HoppeMateusz @bmyates any advices? |
@airMeng - do you see gdb event like this one: Stopped due to shared library event: it is only possible to set BP after zeModuleCreate() creates and loads module binary to GPU. Have you tried breaking just before zeCommandQueueExecuteCommandLists() and setting BP in the GPU module at that point ? |
Hi, I learned from here about how to debug sycl application even per assembly lines based on
gdb-oneapi
. I wonder there is any way to debug level zero kernels similarly.The following pictures shows I tried to stop at where level zero execute kernels but I can't step in or get any thread information.
BTW, I found
gdb-oneapi
say only the Intel® oneAPI Level Zero (Level Zero) backend is supported for debug so I think debugging assembly in level zero is possible.The text was updated successfully, but these errors were encountered: