Deepvariant Deploy

黃馨平
Jackycsie
Published in
3 min readNov 19, 2019

This article will tell you how to use deepvariant from nvidia driver.

Sponsor:

We are using the D52BV provided by Quanta Computer.

Environment inside:

  • 80 vCPU
  • 4 T4 GPU
  • 512 GiB RAM
https://www.qct.io/product/index/Server/rackmount-server/GPGPU-Xeon-Phi/QuantaGrid-D52BV-2U

Environmental configuration

  • Ubuntu 18.04 LTS
  • Nvidia driver 410.129
  • CUDA 10.0
  • cudnn 7.6.3
  • Bazel 0.19.2
  • Tensorflow 1.13
  • DeepVariant 0.8.0
  • Python2.7
  • Java 1.8

Install Nvidia driver

Before you install nvidia driver. You need go to this page download program.

sudo chmod u+x NVIDIA-Linux-x86_64-410.129-diagnostic.run
sudo ./NVIDIA-Linux-x86_64-410.129-diagnostic.run

If you install fail or you lack some tools, this command is uninstall driver.

sudo ./NVIDIA-Linux-x86_64-410.129-diagnostic.run --uninstall

Then, follow below command.

nvidia-smi

You can see this figure.

Congratulations, you did it.

By the way. I delete GPU UUID, so you can’t see it.

Install CUDA 10.0

First you need go to this page download CUDA 10.0

And follow below command.

sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.debsudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pubsudo apt updatesudo apt install cuda-10.0

Add environment variables

vim ~/.bashrc
export PATH=$PATH:/usr/local/cuda/bin/;
source ~/.bashrc

Then, input this command you can see CUDA version.

This means that CUDA was successfully installed.

nvcc -V

Install Cudnn 7.6.3

You need go to this page download three file.

  • libcudnn7_7.6.3.30–1+cuda10.0_amd64.deb
  • libcudnn7-dev_7.6.3.30–1+cuda10.0_amd64.deb
  • libcudnn7-doc_7.6.3.30–1+cuda10.0_amd64.deb
sudo dpkg -i libcudnn7_7.6.3.30-1+cuda10.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.6.3.30-1+cuda10.0_amd64.deb
sudo dpkg -i libcudnn7-doc_7.6.3.30-1+cuda10.0_amd64.deb

Install Bazel 0.19.2

Install required packages

sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python

Download bazel 0.19.2

https://github.com/bazelbuild/bazel/releases/tag/0.19.2bazel-0.19.2-installer-linux-x86_64.shchmod +x bazel-0.19.2-installer-linux-x86_64.sh4./bazel-0.19.2-installer-linux-x86_64.sh --uservim ~/.bashrcexport PATH=”$PATH:$HOME/bin”source ~/.bashrc

Install Tensorflow GPU 1.13

First you need use Python2

If you are use Python3 use can change python version.

ls /usr/local/python*Python --versionalias python='/usr/bin/python2.7'

Install tensorflow-gpu 1.13.1

sudo apt-get install python3-distutilspip install tensorflow-gpu==1.13.1pip install setuptoolspip show tensorflow-gpu

Download DeepVariant

You need to go to deepvariant github page.

Download the deepvariant version you want.

Github. We use deepvariant 0.8.0

wget https://github.com/google/deepvariant/releases/download/v0.8.0/deepvariant.zipunzip deepvariant.zip

Deepvariant have three steps:

  1. Make examples
  2. Call Variants
  3. Postprocess Variant
https://www.lizenghai.com/archives/27764.html

Make example

You need go to this path:

You can find make example.

deepvariant/binaries/DeepVariant/0.8.0/DeepVariant-0.8.0/make_examples.zip

How to use it ?

python2 deepvariant/binaries/DeepVariant/0.8.0/DeepVariant-0.8.0/make_examples.zip  \
--mode calling \
--ref {fasta file} \
--reads "{bam file}" \
--examples "{output_make_example}"

Call Variants

Call variants path:

deepvariant/binaries/DeepVariant/0.8.0/DeepVariant-0.8.0/call_variants.zip

command:

Postprocess Variant

Postprocess Variant path:

deepvariant/binaries/DeepVariant/0.8.0/DeepVariant-0.8.0/postprocess_variants.zip

command:

python2 /deepvariant/binaries/DeepVariant/0.8.0/DeepVariant-0.8.0/postprocess_variants.zip  \
--ref "{fasta file}" \
--infile "{call_variant_file}" \
--outfile "{Postprocess_Variant_file}"

Finish

Please kindly review it and any question is welcome

Thanks,

Jacky

One More thing

If you feel that you don’t understand how to deploy environment ?

You can use this approach.

This method could be use.

However I didn’t try it. Maybe you can try.

git clone https://github.com/google/deepvariant.git
cd deepvariant
#This will take a bit longer.
./build-prereq.sh

Because very tools always using Java 1.8.

However, if you use Ubuntu 18.04 defaults version is 1.11 so you need change version.

update-alternatives --config java
java -version

Reference

--

--

黃馨平
Jackycsie

閱讀本是尋常事,繁華靜處遇知音