Remove lib/rocm_smi_lib and add instructions for obtaining it to README

This commit is contained in:
romner-set 2023-06-16 11:11:57 +02:00
parent d8ebbe1181
commit 746f716a02
5 changed files with 27 additions and 5 deletions

3
.gitignore vendored
View file

@ -51,6 +51,9 @@ bin
btop
.*/
# Optional libraries
lib/rocm_smi_lib
#do not ignore .github directory
!.github

3
.gitmodules vendored
View file

@ -1,6 +1,3 @@
[submodule "lib/fmt"]
path = lib/fmt
url = https://github.com/fmtlib/fmt
[submodule "lib/rocm_smi_lib"]
path = lib/rocm_smi_lib
url = https://github.com/RadeonOpenCompute/rocm_smi_lib

View file

@ -341,6 +341,13 @@ Also needs a UTF8 locale and a font that covers:
Append `ARCH=<architecture>` to manually set the target architecture.
If omitted the makefile uses the machine triple (output of `-dumpmachine` compiler parameter) to detect the target system.
Append `RSMI_STATIC=true` to statically link the ROCm SMI library used for querying AMDGPU data.
For this to work, the `lib/rocm_smi_lib` directory must contain the RSMI source code, which can obtained using the following command:
```bash
git clone https://github.com/RadeonOpenCompute/rocm_smi_lib.git lib/rocm_smi_lib
```
Use `ADDFLAGS` variable for appending flags to both compiler and linker.
For example: `ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system.

@ -1 +0,0 @@
Subproject commit f8882d74d8749e2ad788184d624167cc326d4c2c

View file

@ -29,7 +29,6 @@ tab-size = 4
#include <net/if.h>
#include <arpa/inet.h> // for inet_ntop()
#include <dlfcn.h>
#include <rocm_smi/rocm_smi.h>
#if !(defined(STATIC_BUILD) && defined(__GLIBC__))
@ -155,6 +154,23 @@ namespace Gpu {
//? AMD data collection
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
typedef int rsmi_status_t,
rsmi_temperature_metric_t,
rsmi_clk_type_t,
rsmi_memory_type_t;
struct rsmi_frequencies_t {uint32_t num_supported, current, frequency[RSMI_MAX_NUM_FREQUENCIES];};
//? Function pointers
rsmi_status_t (*rsmi_init)(uint64_t);
rsmi_status_t (*rsmi_shut_down)();