Commit 6034901
committed
fix: handle amdsmi load failures when libamd_smi is missing
When the amdsmi Python package is installed without ROCm (e.g. on macOS),
import can raise KeyError while resolving libamd_smi.so. Treat AttributeError,
OSError, and KeyError like a broken install: disable AMD metrics and warn
instead of crashing the CodeCarbon CLI on import.1 parent 7000cd4 commit 6034901
1 file changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
0 commit comments