Commit 1ea69f5f authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #574 from lilleswing/gpu-docker

GPU Docker
parents 24e4346c fdcb241b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ ENV PATH /miniconda/bin:$PATH
RUN git clone https://github.com/deepchem/deepchem.git && \
    cd deepchem && \
    git checkout tags/1.1.0 && \
    sed -i -- 's/tensorflow$/tensorflow-gpu/g' scripts/install_deepchem_conda.sh && \
    bash scripts/install_deepchem_conda.sh root && \
    pip install tensorflow-gpu==1.0.1 && \
    python setup.py develop
+5 −3
Original line number Diff line number Diff line
@@ -133,13 +133,15 @@ via this installation procedure.
    Try running tests for one submodule at a time if memory proves an issue.

### Using a Docker Image
For major releases we will create docker environments with everything pre-installed
For major releases we will create docker environments with everything pre-installed.
In order to get GPU support you will have to use the 
[nvidia-docker](https://github.com/NVIDIA/nvidia-docker) plugin.
``` bash
# This will the download the latest stable deepchem docker image into your images
docker pull deepchemio/deepchem

# This will create a container out of our latest image
docker run -i -t deepchemio/deepchem
# This will create a container out of our latest image with GPU support
nvidia-docker run -i -t deepchemio/deepchem

# You are now in a docker container whose python has deepchem installed
# For example you can run our tox21 benchmark
+9 −0
Original line number Diff line number Diff line
from tensorflow.python.client import device_lib


def get_available_gpus():
  local_device_protos = device_lib.list_local_devices()
  return [x.name for x in local_device_protos if x.device_type == 'GPU']


print(get_available_gpus())