2. Installation

Note

The parameters of device mapping will be omitted in the examples in this chapter. Please add them as needed or use the gc-docker tool for automatic processing.

For the C600 card, each IPU device needs to map three device files. Taking ipu0 as an example, each IPU device needs to map /dev/ipu0, /dev/ipu0_ex and /dev/ipu0_mem.

The following is an example of mapping devices ipu0 and ipu1 to the Docker container:

docker run \
    --device=/dev/ipu0:/dev/ipu0 --device=/dev/ipu0_ex:/dev/ipu0_ex --device=/dev/ipu0_mem:/dev/ipu0_mem \
    --device=/dev/ipu1:/dev/ipu1 --device=/dev/ipu1_ex:/dev/ipu1_ex --device=/dev/ipu1_mem:/dev/ipu1_mem \
    --ipc=host \
    ...

For IPU-M2000 and Bow-2000 systems, the following parameters will need to be added:

docker run \
    --ulimit memlock=-1:-1 --net=host --cap-add=IPC_LOCK --device=/dev/infiniband/ --ipc=host\
    -v /path/to/ipu.conf:/etc/ipuof.conf -e IPUOF_CONFIG_PATH=/etc/ipuof.conf \
    ...

More information about IPUOF_CONFIG_PATH can be found in Using IPU Pod partitions .

2.1. Compatibility of PopRT with the Poplar SDK

The PopRT version must correspond to the Poplar SDK version to ensure the compatibility of PopRT functions with the Poplar SDK.

Table 2.1 Compatible versions of PopRT and the Poplar SDK

PopRT version

Poplar SDK version

Note

v1.4.0

v3.3.0

None

v1.3.0

v3.3.0

None

v1.2.0

v3.2.0

None

v1.1.0

v3.2.0

None

v1.0.2

v3.1.0

None

2.2. Quick start with a Docker image

You can use Docker images that contain PopRT. Details are available on the DockerHub page.

For example to pull the Docker image with the latest version of PopRT:

docker pull graphcorecn/poprt:latest
docker run --rm graphcorecn/poprt:latest -v

2.3. Install PopRT on host server

To install PopRT on a host server, you must:

  • Download the Poplar SDK (from the Software Downloads page) for your OS. You can check which OS you are running by using the command:

    $ lsb_release -a
    
  • Download the PopRT wheel file from the PopRT Github Releases page. Make sure that the version you download corresponds to the version of the Poplar SDK you have already downloaded. See Table 2.1 for compatible versions.

2.3.1. For Ubuntu 20.04

Note

PopRT only supports Python 3.8 on Ubuntu 20.04.

Install Poplar SDK

The Poplar SDK tarball is named as follows:

poplar_sdk-[os]-[poplar_ver]-[build].tar.gz

where [os] is the host OS, [poplar_ver] is the SDK software version number and [build] identifies a specific build.

An example of the Poplar SDK tarball for Ubuntu 20.04 and version 3.2 of the SDK is:

poplar_sdk-ubuntu_20_04-3.2.0-7cd8ade3cd.tar.gz

Install the SDK by unpacking the tarball as follows:

$ tar -xvzf poplar_sdk-[os]-[ver].tar.gz

You can install the SDK to any directory that you have write access to.

For details of the components included in the Poplar SDK, refer to Contents of the SDK .

Enable the SDK

After you have installed the SDK, you need to enable it. First check whether you already have a version of the SDK enabled:

echo $POPLAR_SDK_ENABLED

This will return the path of the enabled SDK. If a path is already set, then run first:

unset POPLAR_SDK_ENABLED

If there is no path set, then run:

source [path_to_SDK]/enable

where [path_to_SDK] is the location of the Poplar SDK on your system.

Install PopRT

Note

If you do not wish to install PopRT in the default Python environment, then you can create a Python virtual environment with:

python -m venv [name-of-virtual-environment]

Install the PopRT wheel file with:

pip install poprt-*.whl

Verify the version of the installed wheel file with:

poprt -v

This will return the version, for example, for PopRT version 1.0.2, the expected output is:

PopRT version: 1.0.2
Build with SDK: 3.1.0+6824 (8387f79d96)
Runtime SDK: 3.1.0+6824 (8387f79d96)