mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 00:08:11 +00:00
Simplify getMigConfigDevices() and getMigMonitorDevices()
Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
parent
a24b0c8b4e
commit
4791fab747
@ -214,21 +214,15 @@ func getDevices(env map[string]string) *string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getMigConfigDevices(env map[string]string) *string {
|
func getMigConfigDevices(env map[string]string) *string {
|
||||||
gpuVars := []string{envNVMigConfigDevices}
|
if devices, ok := env[envNVMigConfigDevices]; ok {
|
||||||
for _, gpuVar := range gpuVars {
|
return &devices
|
||||||
if devices, ok := env[gpuVar]; ok {
|
|
||||||
return &devices
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getMigMonitorDevices(env map[string]string) *string {
|
func getMigMonitorDevices(env map[string]string) *string {
|
||||||
gpuVars := []string{envNVMigMonitorDevices}
|
if devices, ok := env[envNVMigMonitorDevices]; ok {
|
||||||
for _, gpuVar := range gpuVars {
|
return &devices
|
||||||
if devices, ok := env[gpuVar]; ok {
|
|
||||||
return &devices
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user