Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
Loading...
Searching...
No Matches
GPUUsageMonitor Struct Reference

Reads GPU utilization % via Linux DRM fdinfo (same method as MangoHud). More...

#include <gpu_usage.h>

Data Fields

FILE * streams [GPU_USAGE_MAX_FDS]
 
int stream_count
 
uint64_t prev_gpu_time_ns
 
uint64_t prev_wall_time_ns
 
float load_percent
 
char driver [GPU_USAGE_MAX_KEY_LEN]
 
char engine_key [GPU_USAGE_MAX_KEY_LEN]
 
bool available
 

Detailed Description

Reads GPU utilization % via Linux DRM fdinfo (same method as MangoHud).

Scans /proc/self/fdinfo/ for DRM render node file descriptors, reads cumulative engine time (drm-engine-render for i915, drm-engine-gfx for amdgpu, etc.), and computes utilization as delta_gpu_time / delta_wall_time.

Supported drivers: i915, xe, amdgpu, nouveau.

Field Documentation

◆ available

bool GPUUsageMonitor::available

◆ driver

char GPUUsageMonitor::driver[GPU_USAGE_MAX_KEY_LEN]

◆ engine_key

char GPUUsageMonitor::engine_key[GPU_USAGE_MAX_KEY_LEN]

◆ load_percent

float GPUUsageMonitor::load_percent

◆ prev_gpu_time_ns

uint64_t GPUUsageMonitor::prev_gpu_time_ns

◆ prev_wall_time_ns

uint64_t GPUUsageMonitor::prev_wall_time_ns

◆ stream_count

int GPUUsageMonitor::stream_count

◆ streams

FILE* GPUUsageMonitor::streams[GPU_USAGE_MAX_FDS]

The documentation for this struct was generated from the following file: