我想在 Google Compute Engine 上使用 GPU 运行自定义 Docker 镜像。
我已经构建并将图像推送到 Google Container Registry。
在 Google Cloud Engine 中为主机使用 Container-Optimized OS 似乎是合乎逻辑的,因为除了 Docker、Nvidia GPU 驱动程序和 nvidia-container-runtime
之外,我不需要主机上的任何额外软件。
我设法用 this solution 安装了 nvidia-drivers .
但如果没有 nvidia-container 运行时,我无法使用 GPU(使用 --gpu all
选项)运行我的 Docker 镜像。 This step is specified in official Docker documentation .
有没有办法在 Google Cloud VM 中的 Container-Optimized OS 上安装 nvidia-container-runtime?
最佳答案
您不必设置--gpu all
,因为这是nvidia-container-runtime 的默认选项.您不需要任何其他东西的假设是错误的,因为它需要 libnvidia-container .
准确回答问题:不是,因为操作系统需要安装libnvidia-container
,K8s容器内需要安装nvidia-container-runtime
.一个公开接口(interface) - 另一个连接它。因此,一个没有另一个是无用的。
关于google-cloud-platform - 在 Google Cloud VM 中将 GPU 与容器和容器优化操作系统一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61068495/