You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

nvidia-docker run与docker run --runtime=nvidia是否存在差异?

Are nvidia-docker run and docker run --runtime=nvidia Different?

Great question—this is a super common point of confusion, and it all boils down to how NVIDIA's Docker integration has evolved over time. Let’s break it down clearly:

Core Functionality: They’re Effectively Equivalent

At the end of the day, both commands do the exact same thing: launch a Docker container that can access your NVIDIA GPU resources. The end result (a GPU-enabled container running with all necessary drivers and libraries) is identical no matter which command you use.

Key Differences: Historical Context & Implementation

  • nvidia-docker run: This was the go-to command back in the nvidia-docker 1.x era. Back then, NVIDIA’s GPU support for Docker wasn’t integrated into Docker’s native runtime system, so a separate nvidia-docker CLI tool was required to handle GPU setup, driver mounting, and container launch.
  • docker run --runtime=nvidia: This became the standard with nvidia-docker 2.x and later. NVIDIA shifted to building their GPU support as a Docker runtime plugin, which meant you could use regular Docker commands with the --runtime=nvidia flag to enable GPU access. The old nvidia-docker CLI was reworked to act as a wrapper—it actually translates nvidia-docker run into docker run --runtime=nvidia (plus some default configurations) under the hood.

Official Recommendation

NVIDIA’s current documentation favors docker run --runtime=nvidia (and even newer flags like docker run --gpus all for Docker 19.03+) because it aligns better with Docker’s native workflow. You don’t need to rely on a separate CLI tool, and it’s more consistent with how you’d run other specialized containers.

Compatibility Notes

  • If you’re stuck on an older nvidia-docker 1.x installation, you’ll have to use nvidia-docker run since the runtime plugin doesn’t exist in that version.
  • For nvidia-docker 2.x and above, both commands work, but using --runtime=nvidia is the more future-proof choice. You’ll still see nvidia-docker run in older tutorials or legacy scripts, but it’s just a holdover from the earlier tooling.

内容的提问来源于stack exchange,提问作者Rutger Hofste

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 09:19:17