Created
January 5, 2019 20:35
-
-
Save aspotton/1c93e871a103a8a8ae3a8440abd4b46b to your computer and use it in GitHub Desktop.
Use Nvidia GPU inside of an unprivileged container without nvidia-docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes that these are installed on the host system: | |
# * nvidia binary drivers | |
# * CUDA | |
# * cuDNN | |
docker run -it --rm $(ls /dev/nvidia* | xargs -I{} echo '--device={}') $(ls /usr/lib/*-linux-gnu/{libcuda,libnvidia}* | xargs -I{} echo '-v {}:{}:ro') -v $(pwd):/code test:test /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment