create_container not support --gpus param
See original GitHub issuedocker version: 19.03
I want to set --gpus all
when create container ,but found docker-py not support this param.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:51
- Comments:29 (3 by maintainers)
Top Results From Across the Web
Creating a container image for use on Amazon ECS
Stop the Docker container by typing Ctrl + c. Push your image to Amazon Elastic Container Registry. Amazon ECR is a managed AWS...
Read more >Creating a GPU container image for scoring with Azure ...
Deploy container image: from the image in the workspace, we deploy the image to compute that supports GPUs. Machine Learning SDK. The Azure ......
Read more >Docker-compose: volume name is too short, names should be ...
volume name is too short, names should be at least two alphanumeric characters' ERROR: for webserver Cannot create container for service ...
Read more >Self-host GPU Continuous Integration with Azure Piplines and ...
Since the workers hosted by travis do not have GPUs, it is not possible to actually execute any GPU code or the majority...
Read more >PowerPoint 簡報 - QNAP
Enjoy the same container service platform as with big enterprises. ... Supports GPU Computing. Exclusive ... Pull image and create container.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this is actually a major feature for all data science community that runs tensorflow in docker on nvidia GPUs in the cloud. Why is this ignored for such a long time? 😞
I think one hacky way, though not very reliable, is to use the low-level Api and overwrite the host configuration. Since I only tried to follow the docker cli code in go, I’m not sure how reliable/portable this solution is. It works on my machine and I thought it might help someone until the official support is implemented.
The following code is a modification of the original
DockerClient.containers.create()
function, that adds aDeviceRequest
to the host configuration and otherwise works exactly like the original function:I think the cli client sets the
NVIDIA_VISIBLE_DEVICES
environment variable, so it’s probably a good idea to do the same withenvironment={'NVIDIA_VISIBLE_DEVICES': 'all'}
as parameter of the create_with_device_request() call. This enables all available gpus. You could modify this with different device_requests:The environment parameter should then look like
{'NVIDIA_VISIBLE_DEVICES': '0,1'}
respectively{'NVIDIA_VISIBLE_DEVICES': '0,GPU-xxx'}