Commit a9a4329e by Tianqi Chen Committed by GitHub

[DOCKER] Add demo-gpu image (#1407)

parent badcb630
# Minimum docker image for demo purposes
# prebuilt-image: tvmai/demo_cpu
# prebuilt-image: tvmai/demo-cpu
FROM ubuntu:16.04
RUN apt-get update --fix-missing
......
# Minimum docker image for demo purposes
# prebuilt-image: tvmai/demo-gpu
FROM nvidia/cuda:8.0-cudnn7-devel
RUN apt-get update --fix-missing
COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh
# Python: basic dependencies
RUN apt-get update && apt-get install -y python3-dev python3-pip
RUN pip3 install numpy nose-timer cython decorator scipy
# LLVM
RUN echo deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main \
>> /etc/apt/sources.list.d/llvm.list && \
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - && \
apt-get update && apt-get install -y --force-yes llvm-6.0
# Jupyter notebook.
RUN pip3 install matplotlib Image Pillow jupyter[notebook]
# Deep learning frameworks
RUN pip3 install mxnet tensorflow keras
# Build TVM
COPY install/install_tvm_gpu.sh /install/install_tvm_gpu.sh
RUN bash /install/install_tvm_gpu.sh
# Environment variables
ENV PYTHONPATH=/usr/tvm/python:/usr/tvm/topi/python:/usr/tvm/nnvm/python/:/usr/tvm/vta/python:${PYTHONPATH}
ENV PATH=/usr/local/nvidia/bin:${PATH}
ENV PATH=/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH}
......@@ -24,10 +24,10 @@ The helper bash script can be useful to build demo sessions.
## Prebuilt Docker Images
We provide several pre-built images for doing quick exploration with TVM installed.
For example, you can run the following command to get ```tvmai/demo_cpu``` image.
For example, you can run the following command to get ```tvmai/demo-cpu``` image.
```bash
/path/to/tvm/docker/bash.sh tvmai/demo_cpu
/path/to/tvm/docker/bash.sh tvmai/demo-cpu
```
Then inside the docker container, you can type the following command to start the jupyter notebook
......
......@@ -2,7 +2,7 @@
#
# Execute command within a docker container
#
# Usage: ci_build.sh <CONTAINER_TYPE> [--dockerfile <DOCKERFILE_PATH>] [-it]
# Usage: build.sh <CONTAINER_TYPE> [--dockerfile <DOCKERFILE_PATH>] [-it]
# <COMMAND>
#
# CONTAINER_TYPE: Type of the docker container used the run the build: e.g.,
......
cd /usr
git clone https://github.com/dmlc/tvm --recursive
cd /usr/tvm
echo set\(USE_LLVM llvm-config-6.0\) >> config.cmake
echo set\(USE_CUDA ON\) >> config.cmake
echo set\(USE_CUDNN ON\) >> config.cmake
echo set\(USE_RPC ON\) >> config.cmake
echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_GRAPH_RUNTIME ON\) >> config.cmake
echo set\(USE_BLAS openblas\) >> config.cmake
mkdir -p build
cd build
cmake ..
make -j10
......@@ -3,7 +3,7 @@
Docker Images
=============
We provide several prebuilt docker images to quickly try out tvm.
These images are also helpful to do demo/tutorials of TVM.
These images are also helpful run through TVM demo and tutorials.
You can get the docker images via the following steps.
We need `docker <https://docs.docker.com/engine/installation/>`_ and
`nvidia-docker <https://github.com/NVIDIA/nvidia-docker/>`_ if we want to use cuda.
......@@ -15,14 +15,14 @@ First, clone tvm repo to get the auxiliary scripts
git clone --recursive https://github.com/dmlc/tvm
We can then use the following command to launch a `tvmai/demo_cpu` image.
We can then use the following command to launch a `tvmai/demo-cpu` image.
.. code:: bash
/path/to/tvm/docker/bash.sh tvmai/demo_cpu
.. note::
You can find all the prebuilt images in `https://hub.docker.com/r/tvmai/`_
You can find all the prebuilt images in `<https://hub.docker.com/r/tvmai/>`_
This auxiliary script does the following things:
......@@ -41,5 +41,5 @@ Then you can start a jupyter notebook by typing
Docker Source
-------------
Check out `https://github.com/dmlc/tvm/tree/master/docker`_ if you are interested in
Check out `<https://github.com/dmlc/tvm/tree/master/docker>`_ if you are interested in
building your own docker images.
......@@ -84,8 +84,7 @@ The configuration of tvm can be modified by `config.cmake`.
cmake ..
make -j4
If everything goes well, we can go to the specific language installation section.
If everything goes well, we can go to :ref:`python-package-installation`_
Building on Windows
~~~~~~~~~~~~~~~~~~~
......@@ -114,6 +113,8 @@ Currently, ROCm is supported only on linux, so all the instructions are written
- You need to first install HIP runtime from ROCm. Make sure the installation system has ROCm installed in it.
- Install latest stable version of LLVM (v6.0.1), and LLD, make sure ``ld.lld`` is available via command line.
.. _python-package-installation:
Python Package Installation
---------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment