fix(GPU): EE-4331 error when enabling gpu on existing container (#8316)

pull/8722/head
cmeng 2 years ago committed by GitHub
parent 6242952141
commit 93866644c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -502,7 +502,11 @@ angular.module('portainer.docker').controller('CreateContainerController', [
} }
deviceRequest.Capabilities = [gpuOptions.capabilities]; deviceRequest.Capabilities = [gpuOptions.capabilities];
config.HostConfig.DeviceRequests.push(deviceRequest); if (config.HostConfig.DeviceRequests) {
config.HostConfig.DeviceRequests.push(deviceRequest);
} else {
config.HostConfig.DeviceRequests = [deviceRequest];
}
} }
function prepareConfiguration() { function prepareConfiguration() {

Loading…
Cancel
Save