This topic shows you how to create an Elastic Container Instance (ECI) by specifying a GPU-accelerated ECS instance type.
Specifications
For more information about ECS instance types, see the following topics:
Configuration
To create a GPU-accelerated instance, you must specify the GPU-accelerated instance type and the number of GPUs for each container.
-
If you specify a GPU-accelerated instance type but not the number of GPUs for the containers, the instance fails to start.
-
By default, multiple containers can share GPUs. Ensure that the number of GPUs configured for a single container does not exceed the total number of GPUs available for the specified instance type.
API
When calling the CreateContainerGroup operation to create an ECI instance, use the InstanceType parameter to specify an ECS GPU-accelerated instance type and the Gpu parameter to specify the number of GPUs for each container. For more information, see CreateContainerGroup.
|
Parameter |
Type |
Example |
Description |
|
InstanceType |
String |
ecs.gn6v-c8g1.2xlarge |
The ECS GPU-accelerated instance type. You can specify up to five instance types in a single request, separated by commas. |
|
Container.N.Gpu |
Integer |
1 |
The number of GPUs to allocate to container N. |
You can also call the UpdateContainerGroup operation to change the GPU allocation for each container in a GPU-accelerated instance. For more information, see UpdateContainerGroup.
By default, an ECI GPU instance automatically installs a GPU driver and CUDA version compatible with its instance type. If your workload requires a different version, use the GpuDriverVersion parameter to specify it.
|
Parameter |
Type |
Example |
Description |
|
GpuDriverVersion |
String |
tesla=535 |
The GPU driver version. Note
Changing the GPU driver version is supported only on select instance types. For details, see Specifications. |
Console
When you create a GPU-accelerated instance in the Elastic Container Instance console, configure the GPU-related settings as follows:
-
In the Container Group Configurations section, click the Specify Instance Type tab and select a GPU-accelerated instance type.
-
In the Advanced Settings for each container, set the number of GPUs it uses.
In this example, GPU is set to 1.