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

xe: jit: enable kernel debug information #2297

Merged
merged 2 commits into from
Jan 3, 2025
Merged

Conversation

rjoursler
Copy link
Contributor

@rjoursler rjoursler commented Dec 19, 2024

Downstreams new nGEN code. In particular downstreams support for DWARF debug information. The basic debug information was originally implemented in #2227, and was further extended to include a line table. The line table is only enabled in DNNL_DEV_MODE to avoid overhead in release builds (potentially this condition should be removed to improve the information collected by profiling tools) and under C++20 builds (due to a dependency on std::source_location.) This line table works with gdb-onapi as can be seen with the following picture:

image

Sample usage (requires using SYCL gpu runtime for gdb to work):

$ cat env/gdb-oneapi_env.sh
source ~/intel/gdb-oneapi/setvars.sh --force
export ZET_ENABLE_PROGRAM_DEBUGGING=1

for f in /sys/class/drm/card*/prelim_enable_eu_debug; do
    val=$(cat $f)
    if [ $val == 0 ]; then
        sudo sh -c "echo 1 > $f"
    fi
done
$ source env/gdb-oneapi_env.sh

:: initializing oneAPI environment ...
   -bash: BASH_VERSION = 5.1.16(1)-release
   args: Using "$@" for setvars.sh arguments:
:: debugger -- latest
:: oneAPI environment initialized ::
$ gdb-oneapi --args ~/dnnl/build/tests/benchdnn/benchdnn --matmul --engine=gpu 2048x13:13x512
...
(gdb) break _entry
Function "_entry" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (_entry) pending.
(gdb) r
...
Thread 2.1414 hit Breakpoint 1, with SIMD lanes [0-15], gemm_kernel ()
    at ~/dnnl/src/gpu/intel/jit/gemm/generator/pieces/common.cxx:42
42          or_(1, cr0, cr0, cr0Enable);
(gdb)

@rjoursler rjoursler requested a review from a team as a code owner December 19, 2024 19:25
@github-actions github-actions bot added the platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel label Dec 19, 2024
@rjoursler rjoursler force-pushed the rjoursle/ngen_dwarf branch 2 times, most recently from 55c873a to 5c1ff1e Compare December 19, 2024 22:21
@rjoursler rjoursler force-pushed the rjoursle/ngen_dwarf branch 2 times, most recently from 61b1add to cac7865 Compare January 2, 2025 21:04
@rjoursler
Copy link
Contributor Author

make test
disable device_cpu
enable device_gpu

@rjoursler rjoursler force-pushed the rjoursle/ngen_dwarf branch from cac7865 to 23b13fc Compare January 3, 2025 15:52
@rjoursler rjoursler force-pushed the rjoursle/ngen_dwarf branch from 23b13fc to 5360740 Compare January 3, 2025 15:53
@rjoursler
Copy link
Contributor Author

make test
disable device_cpu
enable device_gpu

@rjoursler rjoursler merged commit 12a660a into main Jan 3, 2025
5 checks passed
@rjoursler rjoursler deleted the rjoursle/ngen_dwarf branch January 3, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants