fetch_ml/internal/worker/gpu_nvml_stub.go
Jeremie Fraeys 05b7af6991
feat: implement NVML-based GPU monitoring
- Add native/nvml_gpu/ C++ library wrapping NVIDIA Management Library
- Add Go bindings in internal/worker/gpu_nvml_native.go and gpu_nvml_stub.go
- Update gpu_detector.go to use NVML for accurate GPU count detection
- Update native/CMakeLists.txt to build nvml_gpu library
- Provides real-time GPU utilization, memory, temperature, clocks, power
- Falls back to environment variable when NVML unavailable
2026-02-21 15:16:09 -05:00

42 lines
1,015 B
Go

//go:build cgo && !native_libs
// +build cgo,!native_libs
package worker
import "errors"
// Stub implementations when native_libs build tag is not present
func InitNVML() error {
return errors.New("NVML requires native_libs build tag")
}
func ShutdownNVML() {}
func IsNVMLAvailable() bool {
return false
}
func GetGPUCount() (int, error) {
return 0, errors.New("NVML requires native_libs build tag")
}
func GetGPUInfo(index uint32) (*GPUInfo, error) {
return nil, errors.New("NVML requires native_libs build tag")
}
func GetAllGPUInfo() ([]*GPUInfo, error) {
return nil, errors.New("NVML requires native_libs build tag")
}
func GetGPUUtilization(index uint32) (uint32, error) {
return 0, errors.New("NVML requires native_libs build tag")
}
func GetGPUMemory(index uint32) (used uint64, total uint64, err error) {
return 0, 0, errors.New("NVML requires native_libs build tag")
}
func GetGPUTemperature(index uint32) (uint32, error) {
return 0, errors.New("NVML requires native_libs build tag")
}