Update run.bash to use --gpus all when possible #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes
docker/run.bash
to use--gpus=all
instead of--runtime=nvidia
for Docker version>19.3
(to enable NVIDIA GPUs). PR is based on one of the discussions in #14, but it is not confirmed if this is a better option. What do you think about this change?For more context, the following comment describes the difference between
nvidia-docker2
andnvidia-container-toolkit
in depth: NVIDIA/nvidia-docker#1268 (comment)Regarding this PR, the condition utilizes
dpkg
for version comparison. Ifdpkg
is not detected on the system, then--runtime=nvidia
is used as a fallback option. Similarly,--runtime=nvidia
is used if Docker with version<=19.3.0
is installed.On a side note, I often need to export these environment variables inside Docker containers to use NVIDIA GPU for certain applications. Do you think it is worth adding them to be on the safe side? (I don't know if setting these variables is too permissive or if it brings some disadvantages)