Skip to content

Commit

Permalink
Merge pull request #737 from fxzjshm/fix-rocm-v6
Browse files Browse the repository at this point in the history
Fix dynamic loading of ROCm v6
  • Loading branch information
aristocratos authored Jan 27, 2024
2 parents 4461a43 + 7d3617a commit edcb68c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/linux/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,24 @@ namespace Gpu {
namespace Rsmi {
#if !defined(RSMI_STATIC)
//? RSMI defines, structs & typedefs
#define RSMI_MAX_NUM_FREQUENCIES 32
#define RSMI_STATUS_SUCCESS 0
#define RSMI_MEM_TYPE_VRAM 0
#define RSMI_TEMP_CURRENT 0
#define RSMI_TEMP_TYPE_EDGE 0
#define RSMI_CLK_TYPE_MEM 4
#define RSMI_CLK_TYPE_SYS 0
#define RSMI_TEMP_MAX 1
#define RSMI_MAX_NUM_FREQUENCIES_V5 32
#define RSMI_MAX_NUM_FREQUENCIES_V6 33
#define RSMI_STATUS_SUCCESS 0
#define RSMI_MEM_TYPE_VRAM 0
#define RSMI_TEMP_CURRENT 0
#define RSMI_TEMP_TYPE_EDGE 0
#define RSMI_CLK_TYPE_MEM 4
#define RSMI_CLK_TYPE_SYS 0
#define RSMI_TEMP_MAX 1

typedef int rsmi_status_t,
rsmi_temperature_metric_t,
rsmi_clk_type_t,
rsmi_memory_type_t;

struct rsmi_version_t {uint32_t major, minor, patch; const char* build;};
struct rsmi_frequencies_t_v5 {uint32_t num_supported, current, frequency[RSMI_MAX_NUM_FREQUENCIES];};
struct rsmi_frequencies_t_v6 {bool has_deep_sleep; uint32_t num_supported, current, frequency[RSMI_MAX_NUM_FREQUENCIES];};
struct rsmi_frequencies_t_v5 {uint32_t num_supported, current; uint64_t frequency[RSMI_MAX_NUM_FREQUENCIES_V5];};
struct rsmi_frequencies_t_v6 {bool has_deep_sleep; uint32_t num_supported, current; uint64_t frequency[RSMI_MAX_NUM_FREQUENCIES_V6];};

//? Function pointers
rsmi_status_t (*rsmi_init)(uint64_t);
Expand Down Expand Up @@ -1265,6 +1266,7 @@ namespace Gpu {

LOAD_SYM(rsmi_init);
LOAD_SYM(rsmi_shut_down);
LOAD_SYM(rsmi_version_get);
LOAD_SYM(rsmi_num_monitor_devices);
LOAD_SYM(rsmi_dev_name_get);
LOAD_SYM(rsmi_dev_power_cap_get);
Expand Down

0 comments on commit edcb68c

Please sign in to comment.