Skip to content

Commit

Permalink
Fix bug with wrong instance of lib being called for load/close
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Klues <[email protected]>
  • Loading branch information
klueska committed Apr 22, 2024
1 parent a97d07c commit 8a7ac4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/nvml/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ import "C"

// nvml.Init()
func (l *library) Init() Return {
if err := libnvml.load(); err != nil {
if err := l.load(); err != nil {
return ERROR_LIBRARY_NOT_FOUND
}
return nvmlInit()
}

// nvml.InitWithFlags()
func (l *library) InitWithFlags(flags uint32) Return {
if err := libnvml.load(); err != nil {
if err := l.load(); err != nil {
return ERROR_LIBRARY_NOT_FOUND
}
return nvmlInitWithFlags(flags)
Expand All @@ -39,7 +39,7 @@ func (l *library) Shutdown() Return {
return ret
}

err := libnvml.close()
err := l.close()
if err != nil {
return ERROR_UNKNOWN
}
Expand Down

0 comments on commit 8a7ac4d

Please sign in to comment.