STRUCT HL_INFO_ARGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 whatever HL_INFO_* operation you put in op. Like, it's where the kernel drops the info you asked for. 🫢
  • return_size β€” size of the structure you're pointing at with return_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 the hw_events array specifically, the size should be hl_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 to HL_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 to enum 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 range 100ms - 1000ms in 100 ms resolution. Currently not in use. Same energy as ctx_id β€” present but not active. πŸ’œ
  • pll_index β€” index as defined in the hl_<asic type>_pll_index enumeration. 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 the HL_INFO_USER_MAPPINGS info 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