summaryrefslogtreecommitdiffstats
path: root/devices
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2021-03-04 16:23:04 -0600
committerSean E. Russell <ser@ser1.net>2021-03-04 16:23:04 -0600
commitefcb0e9d2ab8a8f115b5368da03a75974898ed86 (patch)
tree824e37ea8434b91004ba51e533f605ec4314c73b /devices
parenta44ced4bba471325bba98cabce5709d52c90a60c (diff)
Gets the NVidia extension options working, including marshalling.nvidia
Diffstat (limited to 'devices')
-rw-r--r--devices/nvidia.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/devices/nvidia.go b/devices/nvidia.go
index 0e50dba..8f4b21e 100644
--- a/devices/nvidia.go
+++ b/devices/nvidia.go
@@ -9,8 +9,6 @@ import (
"strconv"
"sync"
"time"
-
- "github.com/xxxserxxx/opflag"
)
// Set up variables and register this plug-in with the main code.
@@ -27,7 +25,6 @@ import (
// tool periodically and puts the results into hashes; the update functions
// then just sync data from those hashes into the return data.
func init() {
- opflag.BoolVarP(&nvidia, "nvidia", "", false, "Enable NVidia GPU support")
RegisterStartup(startNVidia)
}
@@ -73,7 +70,7 @@ func updateNvidiaUsage(cpus map[string]int, _ bool) map[string]error {
// `nvidia-refresh` arg, which is expected to be a time.Duration value and
// sets how frequently the nvidia tool is called to refresh the date.
func startNVidia(vars map[string]string) error {
- if !nvidia {
+ if vars["nvidia"] != "true" {
return nil
}
_, err := exec.Command("nvidia-smi", "-L").Output()
@@ -180,5 +177,3 @@ func update() {
}
}
}
-
-var nvidia bool