Add doc about how to use the CPU-only docker images (#1432)

This commit is contained in:
Fangjun Kuang 2023-12-25 20:23:56 +08:00 committed by GitHub
parent ddd7131317
commit 835a92eba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,11 @@ We describe the following items in this section:
View available tags
===================
You can use the following command to view available tags:
CUDA-enabled docker images
--------------------------
You can use the following command to view available tags for CUDA-enabled
docker images:
.. code-block:: bash
@ -43,8 +47,25 @@ which will give you something like below:
Please select an appropriate combination of `torch`_ and CUDA.
Download a docker image
=======================
CPU-only docker images
----------------------
To view CPU-only docker images, please visit `<https://github.com/k2-fsa/icefall/pkgs/container/icefall>`_
for available tags.
You can select different combinations of ``Python`` and ``torch``. For instance,
to select ``Python 3.8`` and ``torch 2.1.2``, you can use the following tag
.. code-block:: bash
cpu-py3.8-torch2.1.2-v1.1
where ``v1.1`` is the current version of the docker image. You may see
``ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.2`` or some other versions.
We recommend that you always use the latest version.
Download a docker image (CUDA)
==============================
Suppose that you select the tag ``torch1.13.0-cuda11.6``, you can use
the following command to download it:
@ -53,6 +74,16 @@ the following command to download it:
sudo docker image pull k2fsa/icefall:torch1.13.0-cuda11.6
Download a docker image (CPU)
==============================
Suppose that you select the tag ``cpu-py3.8-torch2.1.2-v1.1``, you can use
the following command to download it:
.. code-block:: bash
sudo docker pull ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.1
Run a docker image with GPU
===========================
@ -65,7 +96,7 @@ Run a docker image with CPU
.. code-block:: bash
sudo docker run --rm -it k2fsa/icefall:torch1.13.0-cuda11.6 /bin/bash
sudo docker run --rm -it ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.1 /bin/bash
Run yesno within a docker container
===================================
@ -74,8 +105,13 @@ After starting the container, the following interface is presented:
.. code-block:: bash
# GPU-enabled docker
root@60c947eac59c:/workspace/icefall#
# CPU-only docker
root@60c947eac59c:# mkdir /workspace; git clone https://github.com/k2-fsa/icefall
root@60c947eac59c:# export PYTHONPATH=/workspace/icefall:$PYTHONPATH
It shows the current user is ``root`` and the current working directory
is ``/workspace/icefall``.
@ -107,7 +143,7 @@ to switch to the ``yesno`` recipe and run
.. hint::
If you are running without GPU, it may report the following error:
If you are running without GPU with a GPU-enabled docker, it may report the following error:
.. code-block:: bash