Skip to content

Instantly share code, notes, and snippets.

@helinwang
Created December 20, 2017 23:57
Show Gist options
  • Save helinwang/db4cb71d3b533149debd0f110b889761 to your computer and use it in GitHub Desktop.
Save helinwang/db4cb71d3b533149debd0f110b889761 to your computer and use it in GitHub Desktop.
Run docker with nvidia-gpu without nvidia-docker
ls /dev/nvidia* | xargs -I{} echo '--device {}:{}'
docker run -v /var/lib/nvidia-docker/volumes/nvidia_driver/384.98:/driver --device /dev/nvidia0:/dev/nvidia0 --device /dev/nvidiactl:/dev/nvidiactl --device /dev/nvidia-uvm:/dev/nvidia-uvm --device /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools -it -v `pwd`:/data nvidia/cuda:8.0-runtime-ubuntu16.04 bash
export PATH=$PATH:/driver/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/driver/lib64/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment