amdgpu_amdkf...t_bo_to_gart(9)
π amdgpu_amdkf...t_bo_to_gart(9) π
okay so this is a page straight out of the Kernel API Manual (yes, the kernel has a manual, and yes it's iconic), and today's main character is amdgpu_amdkfd_map_gtt_bo_to_gart. buckle up bestie, it's short but it matters π«Ά
β¨ NAME β¨
amdgpu_amdkfd_map_gtt_bo_to_gart β literally maps a BO to GART and bumps the reference count. two jobs, one function, no cap π
πΈ SYNOPSIS πΈ
int amdgpu_amdkfd_map_gtt_bo_to_gart (struct amdgpu_bo *bo , struct
amdgpu_bo **bo_gart );
that's the whole signature, copy it exactly, don't get cute with it π
π¦ ARGUMENTS π¦
boβ the buffer object that's getting mapped. that's the one you're handing over πbo_gartβ the returnboreference. it comes back out through here, so heads up β¨
π₯ DESCRIPTION π₯
so before this function returns, the bo reference count gets incremented. that's the little detail that'll bite you later if you forget it π
and here's the part where you listen: to release that reference and unpin/unmap the BO, you call amdgpu_amdkfd_free_kernel_mem. that's the cleanup, that's the vibes, that's the whole deal. don't just walk away from the reference you created, that's not main character energy, that's a leak π
π SEE ALSO π
the kernel file that lives at ./drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c β go read it, iykyk π
and the whole friend group, in this exact order:
reuse_dmamap(9)amdgpu_amdkfd_reserve_mem_limit(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)
real talk: the reference count increment is the whole trap here. increment it, then release it with amdgpu_amdkfd_free_kernel_mem, and unpin/unmap while you're at it. slay responsibly π§
and that's the page, bestie!! this lil gem lives in ./drivers/gpu/drm/amd/amdgpu, dated October 2026, and it answers to the name amdgpu_amdkf...t_bo_to_gart(9) β yes the truncation is canon, we don't question it π bye bye, go free your BOs πβ
π¦ 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