amdgpu_amdkf...t_bo_to_gart(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 return bo reference. 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:


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