Skip to content

Golang library for collecting metrics from GPU-Z sensors. It uses Shared Memory under the hood.

Notifications You must be signed in to change notification settings

hotafrika/gpuz-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPU-Z shared memory reader

This repo is used for getting data and sensors values from running GPU-Z utility by shared memory.

Running GPU-Z is required while using this code.

Example of usage

package main

import (
	"fmt"
	"log"
	
	"github.com/hotafrika/gpuz-reader"
)

func main() {
	sm := gpuz.DefaultSharedMemory()
	stat, err := sm.GetStat()
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Println(stat.GetAvailableRecords())
	fmt.Println(stat.GetAvailableSensors())
	fmt.Println(stat.GetRecord("CardName"))
	fmt.Println(stat.GetSensor("GPU Load"))
	fmt.Println(stat.GetSensorValue("GPU Temperature"))
}

About

Golang library for collecting metrics from GPU-Z sensors. It uses Shared Memory under the hood.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages