Add GPU_FOREIGN_UTIL_PCT: game detection via per-process GPU 3D-engine usage
Reads the same PDH counters as Task Manager (\GPU Engine(*)\Utilization Percentage, locale-independent via PdhAddEnglishCounterW), which cover graphics work under WDDM — games are caught without an exe list and the offender is named. Windows-only; a missing or failing counter disables the path with one log line. dwm (the desktop compositor) joins the default ignore list.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
//go:build !windows
|
||||
|
||||
package game
|
||||
|
||||
import "errors"
|
||||
|
||||
// errNoEngineCounters marks platforms without per-process GPU engine
|
||||
// counters (the PDH path is Windows-only).
|
||||
var errNoEngineCounters = errors.New("per-process GPU engine counters are only available on Windows")
|
||||
|
||||
// gpuEngineSampler is a stub on non-Windows platforms.
|
||||
type gpuEngineSampler struct{}
|
||||
|
||||
func openGPUEngineSampler() (*gpuEngineSampler, error) { return nil, errNoEngineCounters }
|
||||
|
||||
func (s *gpuEngineSampler) sample() (map[int]float64, error) { return nil, errNoEngineCounters }
|
||||
Reference in New Issue
Block a user