diff --git a/src/gpu.cpp b/src/gpu.cpp index 80f4f03..2c85f33 100644 --- a/src/gpu.cpp +++ b/src/gpu.cpp @@ -24,7 +24,12 @@ int detect(gpuSensors* target, const std::string& pci) { applog(LOG::INF, "Detected path \"{}\"", target->hwmon); if (utils::fileExists(target->hwmon + rel_metrics_path)) { - applog(LOG::INF, "Found gpu_metrics"); + std::array raw_metrics{}; + if (!utils::readFile(target->hwmon + rel_metrics_path, raw_metrics)) + return -1; + const auto header = reinterpret_cast(raw_metrics.data()); + + applog(LOG::INF, "Found gpu_metrics_v{}_{}", header->format_revision, header->content_revision); target->hasGpuMetrics = true; } return 0;