Add Devices abstraction to CUDA image

This change adds a Devices abstraction to the CUDA image utilities. This
allows for checking whether a devices is selected, for example.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2022-10-26 12:37:23 +02:00
parent db47b58275
commit aca0c7bc5a
8 changed files with 135 additions and 14 deletions

View File

@@ -167,7 +167,7 @@ func getDevicesFromEnvvar(image image.CUDA, swarmResourceEnvvars []string) *stri
// Build a list of envvars to consider. Note that the Swarm Resource envvars have a higher precedence.
envVars := append(swarmResourceEnvvars, envNVVisibleDevices)
devices := image.DevicesFromEnvvars(envVars...)
devices := image.DevicesFromEnvvars(envVars...).List()
if len(devices) == 0 {
return nil
}