Skip to content

Commit

Permalink
Add support for GPU reset SMI events
Browse files Browse the repository at this point in the history
Add handling for both pre GPU reset and post GPU reset SMI
events.

Change-Id: I64d5e006bef58cb28b1c580c75f482a4590427da
  • Loading branch information
mukjoshi authored and hkasivis committed Oct 22, 2020
1 parent 0dec51f commit 99a335f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/rocm_smi/kfd_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ enum kfd_smi_event {
KFD_SMI_EVENT_NONE = 0, /* not used */
KFD_SMI_EVENT_VMFAULT = 1, /* event start counting at 1 */
KFD_SMI_EVENT_THERMAL_THROTTLE = 2,
KFD_SMI_EVENT_GPU_PRE_RESET = 3,
KFD_SMI_EVENT_GPU_POST_RESET = 4,
};

#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
Expand Down
4 changes: 3 additions & 1 deletion include/rocm_smi/rocm_smi.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,10 @@ typedef enum {
RSMI_EVT_NOTIF_VMFAULT = KFD_SMI_EVENT_VMFAULT, //!< VM page fault
RSMI_EVT_NOTIF_FIRST = RSMI_EVT_NOTIF_VMFAULT,
RSMI_EVT_NOTIF_THERMAL_THROTTLE = KFD_SMI_EVENT_THERMAL_THROTTLE,
RSMI_EVT_NOTIF_GPU_PRE_RESET = KFD_SMI_EVENT_GPU_PRE_RESET,
RSMI_EVT_NOTIF_GPU_POST_RESET = KFD_SMI_EVENT_GPU_POST_RESET,

RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_THERMAL_THROTTLE
RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_GPU_POST_RESET
} rsmi_evt_notification_type_t;

/*
Expand Down
2 changes: 2 additions & 0 deletions tests/rocm_smi_test/test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ static const std::map<rsmi_evt_notification_type_t, const char *>
kEvtNotifEvntNameMap = {
{RSMI_EVT_NOTIF_VMFAULT, "RSMI_EVT_NOTIF_VMFAULT"},
{RSMI_EVT_NOTIF_THERMAL_THROTTLE, "RSMI_EVT_NOTIF_THERMAL_THROTTLE"},
{RSMI_EVT_NOTIF_GPU_PRE_RESET, "RSMI_EVT_NOTIF_GPU_PRE_RESET"},
{RSMI_EVT_NOTIF_GPU_POST_RESET, "RSMI_EVT_NOTIF_GPU_POST_RESET"},
};
const char *
NameFromEvtNotifType(rsmi_evt_notification_type_t evt) {
Expand Down

0 comments on commit 99a335f

Please sign in to comment.