Skip to content

Commit

Permalink
Better way to resolve DLL path
Browse files Browse the repository at this point in the history
  • Loading branch information
mxpv committed Feb 26, 2018
1 parent dd19dbd commit f7df3fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package nvml

import (
"C"
"os"
"syscall"
"unsafe"

Expand Down Expand Up @@ -158,7 +159,7 @@ func (a API) ErrorString(result uintptr) string {
// New creates nvml.dll wrapper
func New(path string) (*API, error) {
if path == "" {
path = "C:\\Program Files\\NVIDIA Corporation\\NVSMI\\nvml.dll"
path = os.ExpandEnv("$ProgramW6432\\NVIDIA Corporation\\NVSMI\\nvml.dll")
}

dll, err := syscall.LoadDLL(path)
Expand Down

0 comments on commit f7df3fb

Please sign in to comment.