terraform-provider-docker icon indicating copy to clipboard operation
terraform-provider-docker copied to clipboard

Support NVIDIA GPUs

Open captn3m0 opened this issue 4 years ago • 5 comments

Terraform Version

v0.12.23

Affected Resource(s)

Please list the resources as a list, for example:

  • docker_container

Terraform Configuration Files

resource docker_container a {
  name = ""
  gpus = "all"
}

Debug Output

docker_container.a: : invalid or unknown key: gpus

Expected Behavior

The --gpus flag should be supported.

Actual Behavior

The --gpus flag is not supported.

Steps to Reproduce

Try to run a container with NVIDIA Docker support, which is now natively available in Docker 19.03

Important Factoids

  • NVIDIA has a FAQ on the feature here
  • The docker Engine API implementation sends a DeviceRequest to the update/create container endpoints. See this PR for details.
    • POST /containers/create now accepts DeviceRequests as part of HostConfig. Can be used to set Nvidia GPUs

captn3m0 avatar Mar 31 '20 18:03 captn3m0

In order to test this, you should have a NVIDIA GPU, run Linux, and install the nvidia-container-toolkit package.

captn3m0 avatar Mar 31 '20 18:03 captn3m0

We could add this but there is no machine around with this setup for testing. Would you mind to test then after the release?

mavogel avatar Apr 13 '20 16:04 mavogel

Happy to do that. :+1:

captn3m0 avatar Apr 13 '20 19:04 captn3m0

Need this arg in pulumi-docker-provider, but he use terraform-provider-docker )

moorick avatar Jun 14 '20 11:06 moorick

same problem here

ifokeev avatar Jun 14 '20 11:06 ifokeev