STRUCT AMDXDNA_DRM_BO_USAGE(9)
π 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 byheap_usageonly, 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
- 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