STRUCT HL_INFO_ARGS(9)
π struct hl_info_args(9) β the main character of getting device info π
Hey bestie, welcome to the glow-up of struct hl_info_args(9), the main structure you use to retrieve device related information. It's giving "kernel API manual" but make it fashion, and I'm here to walk you through every single field so you literally can't miss. β¨
πΈ SYNOPSIS πΈ
struct hl_info_args {
__u64 return_pointer;
__u32 return_size;
__u32 op;
union {
__u32 dcore_id;
__u32 ctx_id;
__u32 period_ms;
__u32 pll_index;
__u32 eventfd;
__u32 user_buffer_actual_size;
__u32 sec_attest_nonce;
__u32 array_size;
__u32 fw_sub_opcode;
};
__u32 pad;
};
π¦ Members π¦
Ok so let's go field by field, no skips, periodt. π
return_pointerβ this is the user space address of the relevant structure that goes with whateverHL_INFO_*operation you put inop. Like, it's where the kernel drops the info you asked for. π«Άreturn_sizeβ size of the structure you're pointing at withreturn_pointer. Think of it like"size"in"snprintf": it caps how many bytes the kernel is allowed to write. Ngl that's the whole vibe. π₯ For thehw_eventsarray specifically, the size should behl_info_hw_ip_info.num_of_events * sizeof(__u32). Don't forget that math bestie.opβ this defines which type of information you're trying to retrieve. Refer toHL_INFO_*for the deets. It's literally the "what am I even asking for" field. π{unnamed_union}β anonymous. Just an unnamed union doing unnamed union things. πdcore_idβ the DCORE id for which the information is relevant. For Gaudi, refer toenum gaudi_dcores. Iconic little enum moment. πctx_idβ context ID of the user. Currently not in use. So like, it's there but it's not the main character rn. πperiod_msβ period value in milliseconds, for utilization rate, in range100ms - 1000msin100 msresolution. Currently not in use. Same energy asctx_idβ present but not active. πpll_indexβ index as defined in thehl_<asic type>_pll_indexenumeration. Note the placeholder<asic type>β keep it exactly like that, bestie, don't go renaming it. βeventfdβ event file descriptor for event notifications. It's the fd that's gonna ping you when events go down. πuser_buffer_actual_sizeβ the actual data size that was copied to the user allocated buffer by the driver. Here's the tea: you're allowed to allocate a buffer larger than needed, so the kernel updates this variable so you know the exact amount of bytes it copied into your buffer. Literally so you're not out here guessing. πsec_attest_nonceβ nonce number used for attestation report. Security vibes. πarray_sizeβ number of array members copied to user buffer. Relevant for theHL_INFO_USER_MAPPINGSinfo ioctl. Two things to remember: array members, and that exact ioctl name. πfw_sub_opcodeβ generic requests sub opcodes. Short and sweet. π§padβ padding to 64 bit. Gotta keep it aligned, no cap. β¨
π SEE ALSO π
Kernel file ./include/uapi/drm/habanalabs_accel.h enum, plus the whole friend group of related structs β every single one, bestie, I'm not skipping a single reference:
hl_goya_dma_direction(9)enum hl_device_status(9)struct hl_info_hw_ip_info(9)struct hl_info_pci_counters(9)struct hl_info_clk_throttle(9)struct hl_info_energy(9)struct hl_open_stats_info(9)struct hl_power_info(9)struct hl_info_sync_manager(9)struct hl_info_cs_counters(9)struct hl_info_last_err_open_dev_time(9)struct hl_info_cs_timeout_event(9)struct hl_info_razwi_event(9)struct hl_info_undefined_opcode_event(9)struct hl_info_hw_err_event(9)struct hl_info_fw_err_event(9)struct hl_info_engine_err_event(9)struct hl_info_dev_memalloc_page_sizes(9)struct hl_page_fault_info(9)struct hl_user_mapping(9)
Okay that's the whole page, bestie. Every field, every reference, every little detail. You're welcome. π
And that's a wrap on struct hl_info_args(9)! This page comes from ./include/uapi/drm and it's dated October 2026 β so yes, future girlie energy, slay. Go forth and retrieve that device info. ππ«Άπ
π¦ 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