(common: ResolverParameters, params: DockerResolverParameters, config: DevContainerFromDockerfileConfig | DevContainerFromImageConfig)
| 325 | } |
| 326 | |
| 327 | export async function extraRunArgs(common: ResolverParameters, params: DockerResolverParameters, config: DevContainerFromDockerfileConfig | DevContainerFromImageConfig) { |
| 328 | const extraArguments: string[] = []; |
| 329 | if (config.hostRequirements?.gpu) { |
| 330 | if (await checkDockerSupportForGPU(params)) { |
| 331 | common.output.write(`GPU support found, add GPU flags to docker call.`); |
| 332 | extraArguments.push('--gpus', 'all'); |
| 333 | } else { |
| 334 | if (config.hostRequirements?.gpu !== 'optional') { |
| 335 | common.output.write('No GPU support found yet a GPU was required - consider marking it as "optional"', LogLevel.Warning); |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | return extraArguments; |
| 340 | } |
| 341 | |
| 342 | export async function spawnDevContainer(params: DockerResolverParameters, config: DevContainerFromDockerfileConfig | DevContainerFromImageConfig, mergedConfig: MergedDevContainerConfig, imageName: string, labels: string[], workspaceMount: string | undefined, additionalMountString: string | undefined, imageDetails: () => Promise<ImageDetails>, containerUser: string | undefined, extraLabels: Record<string, string>) { |
| 343 | const { common } = params; |
no test coverage detected