Installation PuzzleLib on Windows

General requirements

For working with PuzzleLib, you need to install the following system dependencies:

  • С++ compiler (cl from Visual Sudio >= 2015, gcc, clang); the path to the folder with the compiler must be aadded in the PATH (path may be, for example, C:\Program Files (x86)\Microsoft Visual Studio ...\VC\bin for cl.exe);
  • python >= 3.5 (64-bit).

Additional requirements

CUDA (NVIDIA GPU)

For working with videocards NVIDIA required:

DNNL (Intel|AMD CPU)

  • DNNL version any of [1.1, 1.2, 1.91]

For the dnnl.dll library from the archive, you must specify the path to the file in the DNNL_PATH system variable.

Some library functions that are not supported by DNNL, will be executed on the numpy-backend.

TensorRT (only inference for NVIDIA GPU)

The path to the TensorRT files must be added to the TRT_PATH system variable, otherwise TensorRT will be assumed to be installed in the path of the CUDA_PATH system variable..

OpenVINO (only inference for Intel CPU)

The path to OpenVINO files must be added to the OPENVINO_PATH system variable, otherwise there will be a build error.

Installation from PyPI

To isntall version that runs on pure numpy backend and has stripped down functionality:

$ pip install PuzzleLib

There are also two options to choose from:

  • backend - what additional backend to install; possible options - cuda, hip, intel;
  • converter - what converter to prepare for accelerated inference; possible options - tensorrt, openvino.

For example:

installing cuda and intel backends:

$ pip install PuzzleLib --install-option="--backend=cuda,intel"

installing cuda backend and also tensorrt converter:

$ pip install PuzzleLib --install-option="--backend=cuda" --install-option="--converter=tensorrt"

Installing from source

Select and download the desired release on the releases page.

Unpack the archive along the path of your choice (path/to/PuzzleLib).

You can install the library by directly calling the setup.py script:

$ python /path/to/PuzzleLib/setup.py install --backend=cuda

Or with pip:

$ pip install /path/to/PuzzleLib --install-option="--backend=cuda"

To see the available installation options consult Installing from PyPI.

Tip

Changes to system variables of the console become visible only after restarting the console, so if something does not work for you, try closing-opening the console.

Backend selection

from PuzzleLib import Config
Config.backend = Config.Backend.cuda # for usage NVIDIA CUDA backend
Config.backend = Config.Backend.hip # for usage AMD ROCm backend
Config.backend = Config.Backend.cpu # for usage CPU numpy backend
Config.backend = Config.Backend.intel # for usage Intel/AMD CPU DNNL backend