All Products
Search
Document Center

Elastic Container Instance:Specify GPU-accelerated ECS instance types to create an elastic container instance

Last Updated:Sep 11, 2024

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

GPU-accelerated ECS instance types contain GPUs and are suitable for scenarios such as deep learning and image processing. GPU-related Docker images can be directly run on a GPU-accelerated elastic container instance. A NVIDIA GPU driver is pre-installed in the instance. The supported driver and CUDA versions vary with GPU types.

Category

GPU-accelerated instance family

Driver and CUDA versions

vGPU-accelerated instance families

sgn7i-vws

NVIDIA 470.161.03 and CUDA 11.4

vgn7i-vws

vgn6i-vws

GPU-accelerated compute-optimized instance families

gn7e

  • NVIDIA 470.82.01 and CUDA 11.4 (default)

  • NVIDIA 525.85.12 and CUDA 12.0

  • NVIDIA 535.161.08 and CUDA 12.2

gn7i

gn7s

gn7

gn6v

gn6e

gn6i

gn5i

gn5

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.

Important
  • 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.

Note

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:

  • tesla=470.82.01

  • tesla=525.85.12

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:

  1. Click the Specify Instance Type tab in the Container Group Configurations section and select a GPU-accelerated ECS instance type.

    指定GPU.png

  2. In the Advanced Settings section of each container, set the number of GPUs that you want to allocate to the container.

    容器GPU.png