Skip to content

Hardware Drivers & Sensor Polling

LocalTelemetry reads low-level hardware registers directly from kernel drivers and vendor-provided API libraries. This page explains how driver initialization and sensor polling operate under the hood.

🔌 Hardware Sensor Architecture

Hardware Sensor Sources Summary

Metric CategoryPrimary API SourceFallback / Alternative
CPU UsageGetSystemTimes (Win32 kernel32 API)N/A
CPU TemperaturePawnIO IntelMSR (Intel MSR)PawnIO RyzenSMU (AMD SMU)
CPU FrequencyPawnIO APERF/MPERF MSR deltaIntel Power Gadget / CallNtPowerInformation
RAM UsageGlobalMemoryStatusEx (Win32 API)N/A
GPU Utilization & TempNVML (NVIDIA) / WDDM GPU Engine countersADL (AMD) / IGCL (Intel)
Disk ThroughputPDH (PhysicalDisk\Disk * Bytes/sec\_Total)Win32 IOCTL Queries
Network SpeedsNetworkInterface.GetIPv4Statistics() deltaWindowsNetworkUsageProvider / ESE SRUDB

1. PawnIo Kernel Driver

To read CPU package temperatures, MSR (Model-Specific Register) values and Ryzen SMU metrics, LocalTelemetry utilizes the PawnIo kernel driver abstraction layer.

  • Driver Subsystem: Located inside LocalTelemetry.Core/Hardware/PawnIo/.
  • First-launch auto-install: On startup, HardwareMonitor.InitPawnIo probes for the device handle. If the driver is not present, PawnIoDevice.TryInstall downloads PawnIO_setup.exe from GitHub and runs it silently (-install -silent), then starts the PawnIO service via sc start PawnIO. Because the app is already elevated at launch, these child processes inherit elevation without additional UAC prompts. The probe retries every 500 ms (up to 10 attempts) until the device opens; this is what causes the brief delay before the tray icon appears on a fresh install.
  • Intel Sensor Queries: MSR registers IA32_THERM_STATUS (0x19C) and APERF/MPERF deltas for core frequencies.
  • AMD Sensor Queries: Interacts with Ryzen SMU (System Management Unit) interface to read package temperatures and SMU telemetry.

2. NVIDIA GPU Monitoring (NvGpuMonitor.cs & NVML)

GPU monitoring for NVIDIA GeForce graphics cards uses native P/Invoke calls into nvml.dll (NVIDIA Management Library, which ships with every display driver):

  • Initialization: nvmlInitnvmlDeviceGetHandleByIndex(0); also reads the GPU name and driver version (nvmlSystemGetDriverVersion).
  • Sensor Queries:
    • nvmlDeviceGetTemperature: GPU temperature.
    • nvmlDeviceGetUtilizationRates: GPU engine and memory utilization.
    • nvmlDeviceGetMemoryInfo: Dedicated VRAM usage.
    • nvmlDeviceGetClockInfo: GPU core clock frequency.
    • nvmlDeviceGetPowerUsage / nvmlDeviceGetPowerManagementLimit: Power draw and TDP.
  • System-wide GPU utilisation is measured independently via WDDM GPU Engine performance counters (WddmGpuMonitor.cs), so it works regardless of vendor.

3. AMD GPU Monitoring (AmdGpuMonitor.cs & ADL)

GPU monitoring for AMD Radeon graphics cards uses the AMD Display Library (atiadlxx.dll):

  • Initialization: Calls ADL_Main_Control_Create to initialize ADL context.
  • Sensor Queries: Fetches core utilization, edge/junction temperatures and VRAM metrics.

4. Disk & Network Sensors

  • Disk I/O: Polled using Windows Performance Data Helper (PDH) performance counters for physical disk read/write bytes per second.
  • Network I/O: Polled using NetworkInterface.GetIPv4Statistics() deltas over active network interfaces.

Released under the GNU General Public License v3.0.