小编Pio*_*zyn的帖子

在 AWS Elastic Beanstalk 上的 Docker 容器中运行 GPU 加速应用程序

我只是想与社区分享我如何设法在 AWS Elastic Beanstalk 上的 Docker 容器中运行 GPU 加速应用程序。我花了将近两天的时间反复试验,所以我希望其他人不要浪费时间在这里发表这篇文章。

这些是我的 Elastic Beanstalk 环境的设置:

  1. 将 AMI ID 设置为 NVIDIA 驱动程序和 Docker 预配置的 ID。我使用了深度学习 AMI (Amazon Linux) 版本 25.3 -ami-068d6d02d8775ec52
  2. 将实例类型设置为具有 GPU 的 EC2 实例之一。我使用g3s.xlarge它,因为它足以满足我需要做的事情。
  3. 在您的应用中Dockerfile添加以下几行:
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
Run Code Online (Sandbox Code Playgroud)
  1. 在您的应用程序根文件夹中创建.ebextensions/01-nvidia-docker.config文件并粘贴以下代码:
option_settings:
  aws:autoscaling:launchconfiguration:
    # I had to increase storage space for the docker to run my container
    BlockDeviceMappings: /dev/xvdcz=:24:true

commands:
  configure_docker_run:
    # I had to update EB startup script so it passes …
Run Code Online (Sandbox Code Playgroud)

gpu machine-learning docker amazon-elastic-beanstalk

6
推荐指数
1
解决办法
1085
查看次数