This topic describes how to specify GPU-accelerated Elastic Compute Service (ECS) instance types to create an elastic container instance.
Description of the ECS instance families
For more information about ECS instance families, see the following topics:
Configuration description
When you create a GPU-accelerated elastic container instance, you must specify the number of GPUs in each container in addition to GPU-accelerated ECS instance types.
If you only specify GPU-accelerated ECS instance types but do not specify the number of GPUs in each container, an error is reported when the instance is started.
By default, multiple containers in the elastic container instance can share the vGPUs. Make sure that the number of GPUs that you allocate to individual containers does not exceed the number of GPUs that the specified GPU-accelerated ECS instance type provides.
API mode
When you call the CreateContainerGroup API operation to create an elastic container instance, you must use the InstanceType parameter to specify a GPU-accelerated ECS instance type and the GPU parameter in the container property to specify the number of GPUs that are allocated to the containers. The following table describes relevant parameters. For more information, see CreateContainerGroup.
Parameter | Type | Example | Description |
InstanceType | String | ecs.gn6v-c8g1.2xlarge | The GPU-accelerated ECS instance types. You can specify up to five ECS instance types at a time. Separate multiple instance types with commas (,). |
Container.N.Gpu | Integer | 1 | The number of GPUs to be allocated to Container N. |
You can call the UpdateContainerGroup API operation to update the number of GPUs that are allocated to containers in an existing GPU-accelerated elastic container instance. For more information, see UpdateContainerGroup.
By default, a GPU-accelerated elastic container instance automatically installs the supported driver and CUDA versions based on the specified GPU-accelerated ECS instance type. In specific scenarios, the loads of different GPU-accelerated elastic container instances require different drivers and CUDA versions. In this case, you can use the GpuDriverVersion parameter to specify the driver version.
Parameter | Type | Example | Description |
GpuDriverVersion | string | tesla=525.85.12 | The version of the GPU driver. Default value: tesla=470.82.01. Valid values:
Note You can change the GPU driver version of GPU-accelerated elastic container instances that use specific GPU-accelerated ECS instance types. For more information, see Description of the ECS instance families. |
Console mode
When you create a GPU-accelerated elastic container instance in the Elastic Container Instance console, you must perform the following GPU-related configurations:
Click the Specify Instance Type tab in the Container Group Configurations section and select a GPU-accelerated ECS instance type.
In the Advanced Settings section of each container, set the number of GPUs that you want to allocate to the container.