STRUCT AMDXDNA_DRM_BO_USAGE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct amdxdna_drm_bo_usage(9) β€” the kernel API manual, but make it make sense

okay bestie, so this is struct amdxdna_drm_bo_usage from the kernel API manual, and it's genuinely not that deep once you see it. it's literally just a lil struct that holds all types of BO usage πŸ“Š. and the whole vibe is: BOs managed by XRT/SHIM/driver get counted as internal, and everything else gets counted as external β€” those are the ones managed by applications, iykyk. 🫢


✨ SYNOPSIS ✨

look at her. four fields. iconic behavior:

struct amdxdna_drm_bo_usage {
    __s64 pid;
    __u64 total_usage;
    __u64 internal_usage;
    __u64 heap_usage;
 };

πŸŽ€ Members πŸŽ€

  • pid β€” the ID of the process you wanna query from. that's the whole personality of this field fr.
  • total_usage β€” total BO size used by the process πŸ’–
  • internal_usage β€” total internal BO size used by the process 🌸
  • heap_usage β€” total device BO size used by the process πŸ”₯

🌈 Description 🌈

okay so among all the types of BOs, here's the whole breakdown, no cap:

  • AMDXDNA_BO_DEV_HEAP β€” counted for internal.
  • AMDXDNA_BO_SHARE β€” counted for external.
  • AMDXDNA_BO_CMD β€” counted for internal.
  • AMDXDNA_BO_DEV β€” counted by heap_usage only, not internal or external.

and the important part, bestie, listen: AMDXDNA_BO_DEV does not add to the total memory footprint, because its mem comes from the heap which is already counted as internal. so don't double-count her, she's already on the list πŸ’…


πŸ’œ SEE ALSO πŸ’œ

kernel file ./include/uapi/drm/amdxdna_accel.h, plus the whole friend group:

struct amdxdna_drm_create_hwctx(9), struct amdxdna_drm_destroy_hwctx(9), struct amdxdna_cu_config(9), struct amdxdna_hwctx_param_config_cu(9), struct amdxdna_drm_config_hwctx(9), struct amdxdna_drm_va_entry(9), struct amdxdna_drm_va_tbl(9), struct amdxdna_drm_create_bo(9), struct amdxdna_drm_get_bo_info(9), struct amdxdna_drm_sync_bo(9), struct amdxdna_drm_exec_cmd(9), struct amdxdna_drm_wait_cmd(9), struct amdxdna_drm_query_aie_status(9), struct amdxdna_drm_query_aie_version(9), struct amdxdna_drm_query_aie_tile_metadata(9), struct amdxdna_drm_query_aie_metadata(9), struct amdxdna_drm_query_clock(9), struct amdxdna_drm_query_clock_metadata(9), struct amdxdna_drm_query_sensor(9), struct amdxdna_drm_query_hwctx(9), struct amdxdna_drm_get_power_mode(9), struct amdxdna_drm_query_firmware_version(9), struct amdxdna_drm_get_resource_info(9), struct amdxdna_drm_attribute_state(9), struct amdxdna_drm_query_telemetry_header(9), struct amdxdna_drm_get_info(9), struct amdxdna_drm_hwctx_entry(9), struct amdxdna_async_error(9), struct amdxdna_drm_get_array(9), struct amdxdna_drm_set_state(9), struct amdxdna_drm_set_power_mode(9)


lowkey a whole squad, and yes, you do need to know them. go read them. i'll wait. πŸ“

and that's the page, bestie πŸŽ€βœ¨ this one lives in ./include/uapi/drm, dated October 2026, filed under struct amdxdna_drm_bo_usage(9) β€” mwah, go slay your BO accounting πŸ’…πŸ‘‘

πŸ“¦ where this page comes from