amdgpu_amdk...ve_mem_limit(9)
π amdgpu_amdkfd_reserve_mem_limit β the Kernel API Manual era β¨
okay so bestie, we're in the Kernel API Manual rn and today's main character is amdgpu_amdkfd_reserve_mem_limit(9). yes the header is literally amdgpu_amdk...ve_mem_limit(9) and yes they truncated it, don't @ me, that's just how the page shipped. no cap.
β¨ NAME β¨
amdgpu_amdkfd_reserve_mem_limit β it decreases the available memory by the size of the buffer. that's the whole vibe. shrinking the bag, but make it kernel π
π SYNOPSIS π
int amdgpu_amdkfd_reserve_mem_limit (struct amdgpu_device *adev ,
uint64_t size , u32 alloc_flag , int8_t xcp_id );
π¦ ARGUMENTS π¦
adevβ the device that the allocated BO belongs to π«Ά like, whose BO is this anywaysizeβ the size of the buffer, in bytes, that's encapsulated by B0. it should be equivalent toamdgpu_bo_size(BO)β yes literally that, keep them matching bestie π―alloc_flagβ the flag used in allocating a BO "as noted above" (iykyk, it's the flag, use it π)xcp_idβxcp_idis used to get the xcp from the xcp manager! one xcp is managed as one compute node in the driver for the app π so like, this little number is doing a lot of work fr fr
π₯ RETURN π₯
it returns -ENOMEM in case of error, and ZERO otherwise. so yeah: bad news = -ENOMEM, everything slayed = ZERO β¨
π SEE ALSO π
kernel file ./drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c β that's the home base bestie π
and the whole friend group (they all go together, periodt):
reuse_dmamap(9)create_dmamap_sg_bo(9)amdgpu_amdkfd_remove_all_eviction_fences(9)create_sg_table(9)kfd_mem_dmamap_sg_bo(9)kfd_mem_dmaunmap_sg_bo(9)reserve_bo_and_vm(9)reserve_bo_and_cond_vms(9)unreserve_bo_and_vms(9)amdgpu_amdkfd_gpuvm_pin_bo(9)amdgpu_amdkfd_gpuvm_unpin_bo(9)amdgpu_amdkfd_map_gtt_bo_to_gart(9)
that's the whole page babes, nothing skipped, every single flag and function name intact π§
πΈ okay that's a wrap!! this lil gem lives in ./drivers/gpu/drm/amd/amdgpu, it's dated October 2026, and the page itself answers to amdgpu_amdk...ve_mem_limit(9). mwah π go reserve some memory responsibly bestie, ily π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms