summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorxAlpharax <42233094+xAlpharax@users.noreply.github.com>2023-09-06 21:44:39 +0300
committerxAlpharax <42233094+xAlpharax@users.noreply.github.com>2023-09-06 21:44:39 +0300
commit57513bf7cd5934ae0bff0c3e67564243975d7b49 (patch)
tree4318e23906c3b1764820976ba32ae717fe3d7b7b /components
parentb2bcd0fc0f9b06cc021d46bdc954addb3c433f99 (diff)
Proper changes for VRAM monitoring functionality. NVIDIA + AMD support.
Intel support is missing as I could not have tested it, but instructions are present in vram.c Changes to be committed: modified: components/vram.c modified: config.h
Diffstat (limited to 'components')
-rw-r--r--components/vram.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/vram.c b/components/vram.c
index bb66c6c..d5e8a22 100644
--- a/components/vram.c
+++ b/components/vram.c
@@ -62,7 +62,7 @@ float GetTotalVRAM() {
float vram_total = -1.0;
// Check if an NVIDIA card is present
- command_output = runCommand("nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits");// Returns MiB
+ command_output = runCommand("nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits"); // Returns MiB
if (command_output != NULL) {
sscanf(command_output, "%f", &vram_total);
free(command_output);
@@ -100,7 +100,7 @@ vram_used(const char *unused) {
int vram_used = (int) GetUsedVRAM();
if (vram_used >= 0.0) {
- return fmt_human(vram_used * 1024, 1024);
+ return bprintf("%d MiB", vram_used);
} else {
return NULL;
}
@@ -111,7 +111,7 @@ vram_total(const char *unused) {
int vram_total = (int) GetTotalVRAM();
if (vram_total >= 0.0) {
- return fmt_human(vram_total * 1024, 1024);
+ return bprintf("%d MiB", vram_total);
} else {
return NULL;
}