Skip to content

Commit

Permalink
Update Quick Start. Update the install_nvidia_docker.sh script.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 321801388
  • Loading branch information
pichuan authored and copybara-github committed Jul 17, 2020
1 parent 0a0b1db commit 6723c8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 29 deletions.
17 changes: 9 additions & 8 deletions docs/deepvariant-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Docker image.

### Use Docker to run DeepVariant in one command.

In the 0.8 release, we introduced one convenient command that will run through
all 3 steps that are required to go from a BAM file to the VCF/gVCF output
files. You can still read about the r0.7 approach in [Quick Start in r0.7].
Starting from the 0.8 release, we introduced one convenient command that will
run through all 3 steps that are required to go from a BAM file to the VCF/gVCF
output files. You can still read about the r0.7 approach in
[Quick Start in r0.7].

If you want to compile the DeepVariant binaries for yourself, we also have a
[Dockerfile] that you can use to build your own Docker image. You can read the
Expand All @@ -35,7 +36,7 @@ the [External Solutions] section.
### Get Docker image

```bash
BIN_VERSION="0.10.0"
BIN_VERSION="rc1.0.0"

sudo apt -y update
sudo apt-get -y install docker.io
Expand Down Expand Up @@ -155,11 +156,11 @@ For more information about `output.visual_report.html`, see the

## Notes on GPU image

If you are using GPUs, you can pull the GPU version, and make sure to run with
`nvidia-docker`:
If you are using GPUs, you can pull the GPU version, and make sure you run with
`--gpus 1` (because DeepVariant currently can only make use of 1 GPU):

```
sudo nvidia-docker run \
sudo docker run --gpus 1 \
-v "${INPUT_DIR}":"/input" \
-v "${OUTPUT_DIR}:/output" \
google/deepvariant:"${BIN_VERSION}-gpu" \
Expand Down Expand Up @@ -238,7 +239,7 @@ Benchmarking Summary:
[BAM]: http://genome.sph.umich.edu/wiki/BAM
[BWA]: https://academic.oup.com/bioinformatics/article/25/14/1754/225615/Fast-and-accurate-short-read-alignment-with
[docker build]: https://docs.docker.com/engine/reference/commandline/build/
[Dockerfile]: https://github.com/google/deepvariant/blob/r0.10/Dockerfile
[Dockerfile]: https://github.com/google/deepvariant/blob/r1.0/Dockerfile
[External Solutions]: https://github.com/google/deepvariant#external-solutions
[FASTA]: https://en.wikipedia.org/wiki/FASTA_format
[Quick Start in r0.7]: https://github.com/google/deepvariant/blob/r0.7/docs/deepvariant-quick-start.md
Expand Down
34 changes: 13 additions & 21 deletions scripts/install_nvidia_docker.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# Copyright 2019 Google LLC.
# This script is used to install `nvidia-docker` on Ubutun 16.04.
# This script is used to install nvidia docker on Ubutun 16.04.
# For different Linux distributions and versions, modifications might be needed.

set -euo pipefail

# Installing `nvidia-docker` to use deepvariant_gpu Docker image.
# Installing nvidia docker to use deepvariant_gpu Docker image.
# (1) Install nvidia driver:
# https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver
sudo apt-get -qq -y update
Expand All @@ -29,33 +29,25 @@ if ! dpkg-query -W cuda-10-0; then
fi

# (2) Install Docker CE:
# https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce
# https://docs.docker.com/engine/install/ubuntu/
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get -qq -y update
sudo apt-get -qq -y install 'docker-ce=5:18.09.4~3-0~ubuntu-xenial'

# (3) Install nvidia-docker:
# https://github.com/NVIDIA/nvidia-docker#ubuntu-140416041804-debian-jessiestretch
# "If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers"
sudo docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 sudo docker ps -q -a -f volume={} | xargs -r sudo docker rm -f
sudo apt-get purge -y nvidia-docker || true
sudo apt-get -qq -y install docker-ce docker-ce-cli containerd.io

# (3) Install nvidia docker:
# https://github.com/NVIDIA/nvidia-docker#ubuntu-160418042004-debian-jessiestretchbuster
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo "${ID}${VERSION_ID}")
curl -s -L "https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list" | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get -qq -y update
distribution=$(. /etc/os-release;echo "$ID$VERSION_ID")
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L "https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list" | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -qq -y nvidia-docker2
sudo pkill -SIGHUP dockerd
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

# Test nvidia-smi with the latest official CUDA image
sudo docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
#### Test nvidia-smi with the latest official CUDA image
sudo docker run --gpus 1 nvidia/cuda:10.0-base nvidia-smi

0 comments on commit 6723c8c

Please sign in to comment.