2. Quick start

To set up your environment to use gcipuinfo, you will need to source the enable.sh script provided in the Poplar SDK or the Graphcore command line tools package:

$ source enable.sh

The enable.sh script in the Graphcore command line tools package sets an environment variable HOST_RUNTIME_ROOT to the base path of the package. The equivalent variable for the Poplar SDK is POPLAR_ROOT.

All the remaining examples will assume the command line tools package is being used.

In all the examples below, the output indicates that gc-powertest is currently using an IPU.

2.1. Running a Python example

To run one of the Python examples:

$ cd $HOST_RUNTIME_ROOT/share/gcipuinfo/examples/python
$ python3 ./gc_active_apps.py

Graphcore active apps:  1
 o application #0: [gc-powertest]

2.2. Running a C++ example

To run one of the C++ examples using the direct C++ interface:

$ cd $HOST_RUNTIME_ROOT/share/gcipuinfo/examples/cpp
$ make -f Makefile.gcda
$ ./gc-active-apps

Graphcore active apps:  1
 o application #0: [gc-powertest]

To run one of the C++ examples using the gcipuinfo_wrapper interface:

$ cd $HOST_RUNTIME_ROOT/share/gcipuinfo/examples/cpp
$ make -f Makefile.gcipuinfo_wrapper
$ ./gc-active-apps

Graphcore active apps:  1
 o application #0: [gc-powertest]

2.3. Running a Go example

To run one of the Go examples:

$ cd $HOST_RUNTIME_ROOT/share/gcipuinfo/examples/go
$ export GOPATH=$HOST_RUNTIME_ROOT/lib/go/
$ go run gc_active_apps.go

Graphcore active apps:  1
 o application #0: [gc-powertest]