Skip to content

Commit 02446fc

Browse files
authored
Merge pull request #1114 from eero-t/prefix-option
Add "prefix" option to GPU plugin for scalability testing
2 parents 6347609 + 5666b8f commit 02446fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/gpu_plugin/gpu_plugin.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,12 @@ func (dp *devicePlugin) Allocate(request *pluginapi.AllocateRequest) (*pluginapi
367367
}
368368

369369
func main() {
370-
var opts cliOptions
370+
var (
371+
prefix string
372+
opts cliOptions
373+
)
371374

375+
flag.StringVar(&prefix, "prefix", "", "Prefix for devfs & sysfs paths")
372376
flag.BoolVar(&opts.enableMonitoring, "enable-monitoring", false, "whether to enable 'i915_monitoring' (= all GPUs) resource")
373377
flag.BoolVar(&opts.resourceManagement, "resource-manager", false, "fractional GPU resource management")
374378
flag.IntVar(&opts.sharedDevNum, "shared-dev-num", 1, "number of containers sharing the same GPU device")
@@ -393,7 +397,7 @@ func main() {
393397

394398
klog.V(1).Infof("GPU device plugin started with %s preferred allocation policy", opts.preferredAllocationPolicy)
395399

396-
plugin := newDevicePlugin(sysfsDrmDirectory, devfsDriDirectory, opts)
400+
plugin := newDevicePlugin(prefix+sysfsDrmDirectory, prefix+devfsDriDirectory, opts)
397401
manager := dpapi.NewManager(namespace, plugin)
398402
manager.Run()
399403
}

0 commit comments

Comments
 (0)