Skip to content

[AMD-SMI] Clean up UALoE/IFoE public header layout#6611

Open
marifamd wants to merge 3 commits into
developfrom
users/marifamd/ualoe_public_headers
Open

[AMD-SMI] Clean up UALoE/IFoE public header layout#6611
marifamd wants to merge 3 commits into
developfrom
users/marifamd/ualoe_public_headers

Conversation

@marifamd
Copy link
Copy Markdown
Contributor

@marifamd marifamd commented May 30, 2026

  • Stop leaking ualoe_lib.h through the public install headers: drop the include from impl/amd_smi_gpu_device.h (keep only the forward typedef), move ctors/dtor out-of-line into amd_smi_gpu_device.cc, and remove the install(DIRECTORY ualoe_lib) rule so the vendored headers stop landing in /opt/rocm/include/ualoe_lib/.
  • Polyfill __kernel_timespec for pre-5.1 kernel headers: <linux/time_types.h> arrived in kernel 5.1 (Aug 2019), so guard the include behind LINUX_VERSION_CODE and supply the matching struct for targets like Debian 10 (kernel 4.19) that ship older sanitized UAPI headers.
  • Move smi_nic_interface.h into the public include tree at include/amd_smi/impl/nic/amdsmi_unified/interface/ so the source layout mirrors the install layout, switch the three consumers (amd_smi_system.h, amd_smi_common.h, amd_smi.cc) to the fully-qualified path, repoint the amdsminic static lib's include search, and drop the duplicate install rule and now-unneeded BUILD_INTERFACE entry.

Signed-off-by: Maisam Arif Maisam.Arif@amd.com

marifamd added 3 commits May 29, 2026 19:00
The public-facing impl/amd_smi_gpu_device.h pulled in ualoe_lib/ualoe_lib.h
via extern "C", then immediately contradicted that include with a local
'typedef int ualoe_handle_t;'. This forced the vendored ualoe_lib headers
to be installed under /opt/rocm/include/ualoe_lib/ to keep downstream
consumers compiling.

Drop the include from the public header (keep only the forward typedef),
move the ctors/dtor out-of-line into amd_smi_gpu_device.cc where the real
ualoe_lib.h is included, and remove the now-unneeded install(DIRECTORY
ualoe_lib) rule.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
<linux/time_types.h> was introduced in kernel 5.1 (Aug 2019). Targets
shipping older sanitized UAPI headers (e.g. Debian 10 with kernel 4.19)
fail to build ualoe_lib's cbl_cfg/uapi.h. Guard the include behind
LINUX_VERSION_CODE and supply the matching struct definition for older
targets.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Public impl/ header amd_smi_system.h included <amdsmi_unified/interface/
smi_nic_interface.h> as a bare path. The source actually lived under
src/nic/ai-nic/amdsmi_unified/interface/ and installed at /opt/rocm/
include/amd_smi/impl/nic/amdsmi_unified/interface/, so a second install
rule had to drop a duplicate copy at /opt/rocm/include/amdsmi_unified/
interface/ purely to make the bare include resolve for downstream
consumers.

Relocate the header to include/amd_smi/impl/nic/amdsmi_unified/interface/
so the source layout mirrors the install layout, switch all three consumers
(amd_smi_system.h, amd_smi_common.h, amd_smi.cc) to the fully-qualified
amd_smi/impl/nic/amdsmi_unified/interface/ path, point the amdsminic
static lib's include search at the new location, and drop the duplicate
install rule and the now-unneeded BUILD_INTERFACE entry.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant