@@ -16,16 +16,16 @@ import (
1616
1717// NvidiaDevicePlugin implements the Kubernetes device plugin API
1818type NvidiaDevicePlugin struct {
19- devs []* pluginapi.Device
20- realDevNames []string
21- devNameMap map [string ]uint
22- devIndxMap map [uint ]string
23- socket string
24- mps bool
25- healthCheck bool
26-
27- stop chan struct {}
28- health chan * pluginapi.Device
19+ devs []* pluginapi.Device
20+ realDevNames []string
21+ devNameMap map [string ]uint
22+ devIndxMap map [uint ]string
23+ socket string
24+ mps bool
25+ healthCheck bool
26+ disableCGPUIsolation bool
27+ stop chan struct {}
28+ health chan * pluginapi.Device
2929
3030 server * grpc.Server
3131 sync.RWMutex
@@ -47,17 +47,20 @@ func NewNvidiaDevicePlugin(mps, healthCheck bool) (*NvidiaDevicePlugin, error) {
4747 if err != nil {
4848 return nil , err
4949 }
50-
50+ disableCGPUIsolation , err := disableCGPUIsolationOrNot ()
51+ if err != nil {
52+ return nil , err
53+ }
5154 return & NvidiaDevicePlugin {
52- devs : devs ,
53- realDevNames : devList ,
54- devNameMap : devNameMap ,
55- socket : serverSock ,
56- mps : mps ,
57- healthCheck : healthCheck ,
58-
59- stop : make (chan struct {}),
60- health : make (chan * pluginapi.Device ),
55+ devs : devs ,
56+ realDevNames : devList ,
57+ devNameMap : devNameMap ,
58+ socket : serverSock ,
59+ mps : mps ,
60+ healthCheck : healthCheck ,
61+ disableCGPUIsolation : disableCGPUIsolation ,
62+ stop : make (chan struct {}),
63+ health : make (chan * pluginapi.Device ),
6164 }, nil
6265}
6366
0 commit comments