Skip to content

[AMDGPU] comgr: Add ElfView::getKernelLdsSize helper#2583

Merged
xintin merged 3 commits into
ROCm:amd-stagingfrom
xintin:hotswap-elf-getkernellsdsize
May 20, 2026
Merged

[AMDGPU] comgr: Add ElfView::getKernelLdsSize helper#2583
xintin merged 3 commits into
ROCm:amd-stagingfrom
xintin:hotswap-elf-getkernellsdsize

Conversation

@xintin
Copy link
Copy Markdown

@xintin xintin commented May 18, 2026

Adds a small ElfView helper that reads group_segment_fixed_size from the kernel descriptor symbol <KernelName>.kd. Returns std::nullopt when the descriptor symbol is missing.

Split out as a precursor to the ds_*_addtid_b32 trampoline patch (PR #2302). That patch will use the helper to gate a diagnostic for kernels with LDS allocations larger than the A0 16-bit M0 truncation limit.

Unit test ElfView.GetKernelLdsSizeReturnsNulloptWhenKdMissing covers the missing-descriptor path with a hand-crafted minimal ELF; the positive path will be exercised through lit once a consumer lands.

@xintin xintin requested review from chinmaydd and lamb-j as code owners May 18, 2026 11:45
@xintin xintin added comgr Related to Code Object Manager hotswap Related to the Comgr Hotswap feature labels May 18, 2026
@xintin xintin requested a review from jmmartinez May 18, 2026 11:45
Comment thread amd/comgr/src/comgr-hotswap-elf.cpp
Comment thread amd/comgr/src/comgr-hotswap-elf.cpp Outdated
Comment thread amd/comgr/src/comgr-hotswap-elf.cpp Outdated
Comment thread amd/comgr/test-unit/HotswapElfTest.cpp Outdated
Comment thread amd/comgr/test-unit/HotswapElfTest.cpp Outdated
Adds a small ElfView helper that reads group_segment_fixed_size from
the kernel descriptor symbol "<KernelName>.kd". Returns std::nullopt
when the descriptor symbol is missing.

Assisted-by: Cursor
Signed-off-by: xintin <gaurav.verma@amd.com>
@xintin xintin force-pushed the hotswap-elf-getkernellsdsize branch from 8390027 to a3b936b Compare May 18, 2026 13:29
@xintin xintin requested a review from jmmartinez May 18, 2026 13:30
Signed-off-by: xintin <gaurav.verma@amd.com>
Comment thread amd/comgr/src/comgr-hotswap-elf.cpp Outdated
Comment thread amd/comgr/src/comgr-hotswap-elf.cpp
Signed-off-by: xintin <gaurav.verma@amd.com>
@xintin xintin force-pushed the hotswap-elf-getkernellsdsize branch from d7ad58b to 1dbca97 Compare May 20, 2026 06:47
@xintin xintin requested a review from jmmartinez May 20, 2026 06:49
@xintin xintin merged commit 4e092e8 into ROCm:amd-staging May 20, 2026
147 of 153 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comgr Related to Code Object Manager hotswap Related to the Comgr Hotswap feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants