Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 4.92 KB

GPGPU.md

File metadata and controls

61 lines (47 loc) · 4.92 KB

GPGPU acceleration

We use Tensorflow and OpenVINO as deep learning frameworks. The current repository contains Tensorflow libraries built without GPU functions to reduce the size. Also, few developers need GPGPU accelerated libraries. The GPU libraries will work on your device even if you don't have NVIDIA GPU.

OpenVINO

By default we use the "CPU" device when OpenVINO is enabled. If you have an Intel GPU and want to use it, then change the device type to "GPU" (--openvino_device="GNA"|"HETERO"|"CPU"|"MULTI"|"GPU"|"MYRIAD"|"HDDL"|"FPGA" command). More information at https://www.doubango.org/SDKs/kyc-documents-verif/docs/Configuration_options.html#openvino-device.

Tensorflow libraries

The Tensorflow libraries are hosted at:

Windows

To use the Tensorflow version with GPU funtions you'll need to download [1], extract tensorflow.dll and override CPU-only tensorflow.dll in binaries/windows/x86_64

Linux

On Linux x86_64, libtensorflow.so is missing in the binaries folder. You'll need to download your preferred Tensorflow version ([3] or [4]) and copy the content to binaries/linux/x86_64.

Migration to Tensorflow 2.x and CUDA 11.x

Our SDK is built and shipped with Tensorflow 1.x to make it work on oldest NVIDIA GPUs. If you want to use newest NVIDIA GPUs (e.g. RTX3060) which requires CUDA 11.x, then you'll need to upgrade the Tensorflow version. Check https://www.tensorflow.org/install/source#gpu to know which CUDA version is required for your Tensorflow version.

This section is about Tensorflow 2.6, Ubuntu 20.04.2 LTS, NVIDIA RTX3060 GPU and cuda_11.1.TC455_06.29190527_0. Tensorflow 2.6 is the latest (11/29/2021) public version published at https://www.tensorflow.org/install/lang_c. Please note that we use CUDA 11.1 instead of 11.2 as suggested at https://www.tensorflow.org/install/source#gpu but both will work.

cd  KYC-Documents-Verif-SDK/binaries/linux/x86_64
wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-2.6.0.tar.gz
tar -xf libtensorflow-gpu-linux-x86_64-2.6.0.tar.gz
cp lib/* .

make sure you don't have older Tensorflow binaries in that directory. ls from the current folder will give you libtensorflow_framework.so libtensorflow_framework.so.2 libtensorflow_framework.so.2.6.0 libtensorflow.so libtensorflow.so.2 libtensorflow.so.2.6.0

  • Checking dependencies and workaround

Now when you run ldd libKYCDocumentsVerifSDK.so you'll see libtensorflow.so.1 => not found. That's normal because the SDK is built for Tensorflow 1.x. Do not worry, we use the C-API which is the same for all Tensorflow versions.

The litte trick is to duplicate and rename the symbolic link: cp libtensorflow.so.2 libtensorflow.so.1