mirror of
https://github.com/clearml/go-nvlib
synced 2025-06-26 18:28:08 +00:00
Update go-nvml dependency
This updates go-nvml to include fixes for getting devices by UUID and to remove the panic from calls to Init and Shutdown. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
6
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go
generated
vendored
6
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go
generated
vendored
@@ -38,21 +38,21 @@ func DeviceGetHandleByIndex(Index int) (Device, Return) {
|
||||
// nvml.DeviceGetHandleBySerial()
|
||||
func DeviceGetHandleBySerial(Serial string) (Device, Return) {
|
||||
var Device Device
|
||||
ret := nvmlDeviceGetHandleBySerial(Serial, &Device)
|
||||
ret := nvmlDeviceGetHandleBySerial(Serial + string(rune(0)), &Device)
|
||||
return Device, ret
|
||||
}
|
||||
|
||||
// nvml.DeviceGetHandleByUUID()
|
||||
func DeviceGetHandleByUUID(Uuid string) (Device, Return) {
|
||||
var Device Device
|
||||
ret := nvmlDeviceGetHandleByUUID(Uuid, &Device)
|
||||
ret := nvmlDeviceGetHandleByUUID(Uuid + string(rune(0)), &Device)
|
||||
return Device, ret
|
||||
}
|
||||
|
||||
// nvml.DeviceGetHandleByPciBusId()
|
||||
func DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) {
|
||||
var Device Device
|
||||
ret := nvmlDeviceGetHandleByPciBusId(PciBusId, &Device)
|
||||
ret := nvmlDeviceGetHandleByPciBusId(PciBusId + string(rune(0)), &Device)
|
||||
return Device, ret
|
||||
}
|
||||
|
||||
|
||||
12
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go
generated
vendored
12
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go
generated
vendored
@@ -32,13 +32,9 @@ var nvml *dl.DynamicLibrary
|
||||
// nvml.Init()
|
||||
func Init() Return {
|
||||
lib := dl.New(nvmlLibraryName, nvmlLibraryLoadFlags)
|
||||
if lib == nil {
|
||||
panic(fmt.Sprintf("error instantiating DynamicLibrary for %s", nvmlLibraryName))
|
||||
}
|
||||
|
||||
err := lib.Open()
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("error opening %s: %v", nvmlLibraryName, err))
|
||||
return ERROR_LIBRARY_NOT_FOUND
|
||||
}
|
||||
|
||||
nvml = lib
|
||||
@@ -50,13 +46,9 @@ func Init() Return {
|
||||
// nvml.InitWithFlags()
|
||||
func InitWithFlags(Flags uint32) Return {
|
||||
lib := dl.New(nvmlLibraryName, nvmlLibraryLoadFlags)
|
||||
if lib == nil {
|
||||
panic(fmt.Sprintf("error instantiating DynamicLibrary for %s", nvmlLibraryName))
|
||||
}
|
||||
|
||||
err := lib.Open()
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("error opening %s: %v", nvmlLibraryName, err))
|
||||
return ERROR_LIBRARY_NOT_FOUND
|
||||
}
|
||||
|
||||
nvml = lib
|
||||
|
||||
Reference in New Issue
Block a user