Bug 2276921 - Unable to build c program including rocm_smi/rocm_smi.h with rocm-smi-devel installed
Summary: Unable to build c program including rocm_smi/rocm_smi.h with rocm-smi-devel i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rocm-smi
Version: 40
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tom Rix
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-24 15:58 UTC by Tim McMullan
Modified: 2024-05-08 03:31 UTC (History)
3 users (show)

Fixed In Version: rocm-smi-6.0.2-1.fc40
Clone Of:
Environment:
Last Closed: 2024-05-08 03:31:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Tim McMullan 2024-04-24 15:58:41 UTC
After upgrading from F39 to F40, rocm-smi was updated to 6.0.0.

$ rpm -q rocm-smi-devel
rocm-smi-devel-6.0.0-4.fc40.x86_64

This version is missing a typedef in rocm_smi/rocm_smi.h causing anything including this header to not compile with the error "error: unknown type name ‘metrics_table_header_t".

This was fixed in a later version of ROCm (The 6.0.2 tag has the fix).

The relevant github issue is https://github.com/ROCm/rocm_smi_lib/issues/147
This was fixed upsteam as part of https://github.com/ROCm/rocm_smi_lib/commit/0d13f6deea

I ran into this trying to build Slurm with the rsmi plugin, but it is easy to show the error simply trying to compile anything including that header though.

Thank you for your help, and let me know if there is any more information I can provide!
--Tim

Reproducible: Always

Steps to Reproduce:
1. echo "#include <rocm_smi/rocm_smi.h>" >test.c
2. gcc ./test.c
Actual Results:  
In file included from ./test.c:1:
/usr/include/rocm_smi/rocm_smi.h:5370:51: error: unknown type name ‘metrics_table_header_t’
 5370 | rsmi_dev_metrics_header_info_get(uint32_t dv_ind, metrics_table_header_t* header_value);

Expected Results:  
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/14/../../../../lib64/crt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status

Comment 1 Tom Rix 2024-04-29 14:59:07 UTC
Can you try out this scratch build ?
https://koji.fedoraproject.org/koji/taskinfo?taskID=117033391

This updates the source to 6.0.2

Comment 2 Tim McMullan 2024-04-29 15:34:06 UTC
I ran a test build with my "test program" and Slurm, everything is building correctly against the scratch build of rsmi 6.0.2.

Thank you!

Comment 3 Fedora Update System 2024-04-30 12:14:15 UTC
FEDORA-2024-169e2b4700 (rocm-smi-6.0.2-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-169e2b4700

Comment 4 Fedora Update System 2024-04-30 22:09:33 UTC
FEDORA-2024-169e2b4700 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-169e2b4700`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-169e2b4700

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2024-05-08 03:31:14 UTC
FEDORA-2024-169e2b4700 (rocm-smi-6.0.2-1.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.