Docker 镜像#

我们提供 docker 实用程序脚本来帮助开发人员设置开发环境。它们还有助于通过 TVM 演示和教程运行。如果想要使用 cuda,则需要 dockernvidia-docker

获取 tvm 源分发或克隆 github 存储库以获取辅助脚本

git clone --recursive https://github.com/apache/tvm tvm

然后我们可以使用下面的命令来启动一个 docker 镜像。

/path/to/tvm/docker/bash.sh <image-name>

Here the image-name can be a local docker image name, e.g. tvm.ci_cpu after you have done the local build.

此辅助脚本执行以下操作:

  • Mount current directory to /workspace

  • Switch user to be the same user that calls the bash.sh (so you can read/write host system)

  • Use the host-side network on Linux. Use the bridge network and expose port 8888 on macOS, because host networking driver isn’t supported. (so you can use jupyter notebook)

Then you can start a Jupyter notebook by typing

jupyter notebook

You might see an error OSError: [Errno 99] Cannot assign requested address when starting a Jupyter notebook on macOS. You can change the binding IP address by

jupyter notebook --ip=0.0.0.0

Note that on macOS, because bash.sh uses the Docker bridge network, Jupyter will be reportedly running at an URL like http://{container_hostname}:8888/?token=.... You should replace the container_hostname with localhost when pasting it into browser.

Docker 源码#

Check out the docker source if you are interested in building your own docker images.

运行以下命令来构建 docker 镜像。

/path/to/tvm/docker/build.sh <image-name>

You can find some un-official third party pre-built images at https://hub.docker.com/r/tlcpack/. These images are used for test purposes and are NOT of the ASF release.