fetch_ml/internal/worker/gpu_nvml_stub.go
Jeremie Fraeys be39b37aec
feat: native GPU detection and NVML bridge for macOS and Linux
- Add dynamic NVML loading for Linux GPU detection
- Add macOS GPU detection via IOKit framework
- Add Zig NVML wrapper for cross-platform GPU queries
- Update native bridge to support platform-specific GPU libs
- Add CMake support for NVML dynamic library
2026-02-21 17:59:59 -05:00

57 lines
1.3 KiB
Go

//go:build !cgo || !native_libs || !linux
// +build !cgo !native_libs !linux
package worker
import "errors"
// GPUInfo provides comprehensive GPU information
type GPUInfo struct {
Index uint32
Name string
Utilization uint32
MemoryUsed uint64
MemoryTotal uint64
Temperature uint32
PowerDraw uint32
ClockSM uint32
ClockMemory uint32
PCIeGen uint32
PCIeWidth uint32
UUID string
VBIOSVersion string
}
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, nil
}
func GetGPUInfo(index uint32) (*GPUInfo, error) { // <-- was missing
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")
}