FAQ

Overview

What is Libra Technology?

Libra is a cross CPU - GPU processor, cross platform, cross language - standard math library and runtime API - for software application development.

What type of software plays well with Libra ?

Astronomy & Astrophysics Algorithms & Numerical Techniques Audio Processing Cloud Computing Computer Graphics Computer Vision Computational Fluid Dynamics Databases & Data Mining Digital Content Creation (DCC) Embedded & Automotive Molecular Dynamics Neuroscience Physics Simulation Quantum Chemistry Ray Tracing Signal Processing Stereoscopic 3D Tools & Libraries Video Processing Energy Exploration Finance Film GPU Accelerated Internet High Performance Computing Imaging Life Sciences Machine Learning & Artificial Intelligence Medical Imaging & Visualization ...

What do I get writing functions using Libra API ?

You get a portable function that your application can execute on any modern processor architecture and operating system.

Example of custom portable function, in Libra 2.0 to execute on CUDA, OpenCL and x86/x64 devices :

gVar add(gVar array1, gVar array2)
{
    return array1 + array2;
}

What math functions and operators are supported by Libra API ?

For a complete list of library functions and math operators, take a look at Libra API and documentation - www.gpusystems.com/doc

What programming languages are supported ?

Libra API is available via C, C++, Java, C# and matlab programming environments. Other common programming language environments can easily access Libra Technology via Libra C API programming interface, fortran for example, etc

What operating systems are supported ?

Libra SDK 2.0 current version is available for Windows, Linux and Mac.

What CPUs and GPUs are supported ?

AMD GPUs
All OpenCL enabled >= 5xxx series client devices and firestream serverside GPUs supported.

NVIDIA GPUs
All CUDA enabled client and serverside GPUs supported.

AMD & Intel & CPUs running x86/x64 code

What is the difference between Libra and CUDA ?

Libra is math runtime + libraries implemented on top of CUDA, a highlevel math programming API approach similar to C/C++ standard libraries and matlab. Libra is cross software & hardware, whereas CUDA is specific to NVIDIA GPU devices only.

What is the difference between Libra and OpenCL ?

Libra is math runtime + libraries implemented on top of OpenCL, a highlevel math programming API approach similar to C/C++ standard libraries and matlab. Libra is cross software & hardware, whereas an OpenCL program is specific to a vendor GPU or CPU device.

Installation

Do I have to run an SDK installer or set an environment PATH variable ?

No path has to be set or installer is needed to start using Libra SDK. Place Libra SDK onto your harddrive and link within your programming environment and application code. See README.txt

What 3rd party prerequisites are needed on the end user machine in order run Libra ?

Windows x86/x64 : Make sure your OS installation has all available service packs installed.

Mac x86/x64 : For a list of required system libraries -> at command prompt : type 'otool -L libLibra.dylib'

Linux x86/x64 : For a list of required system libraries -> at command prompt : type 'ldd libLibra.so' or 'ldd libLibra_x64.so'

Running on AMD GPUs:
Install latest catalyst graphics driver. All OpenCL enabled >= 5xxx series client devices and firestream serverside GPUs supported.

Running on NVIDIA GPUs:
Install latest CUDA graphics driver. All CUDA enabled client and serverside GPUs supported.

Setup programming environment

How do I include Libra API from my C/C++ programming environment ?

You need to set your IDE/compiler include path to point to the location of "Libra SDK/include" and add the following include statement to your application code ->
#include <libra.h>

How do I link with Libra shared library (libra.dll on Windows, libLibra.so on Linux and libLibra.dylib on Mac) ?

You need to set your IDE/compiler library path to point to the location of "Libra SDK/lib" and add the following link libraries to your application:

Windows : Link with Libra.lib for a C programming interface and LibraCpp.lib for C++ bindings.

Linux : Link with libLibra.so or libLibra_x64.so for a C programming interface and libLibraCpp.lib or libLibraCpp_x64.so for C++ bindings.

Mac : Link with libLibra.dylib for a C programming interface and libLibraCpp.dylib for C++ bindings.

Running the application. How does the application find the appropriate Libra binaries (libra.*, libra.bin) etc ?

Deploy all Libra binaries onto your application bin path or working directory.

Windows (optional) : Add Application Binary Path to system environment variable PATH if Libra binaries reside outside application path or working directory.

Linux : Add Application Binary Path to system environment variable LD_LIBRARY_PATH.

Mac : Add Application Binary Path to system environment variable DYLD_LIBRARY_PATH.

Development and Debugging Get Started

Where can I see some sample code on how to setup and run Libra programming for CPUs and GPUs ?

A good place to start checking is with sample programs coming with Libra SDK, for example :

HelloWorld : Performs powerful (S/DGEMM) matrix multiplication on CPUs and/or GPUs.

BatchTransforms : Powerful matrixmultiplication with many matrices packed together onto a large sparse matrix on CPUs and/or GPUs.

WaterDroplets : An interactive physics simulation showing advanced phsyics and graphics with Libra API.

See also code examples section

How do I setup my own project to start testing with Libra ?

There is an example empty project coming with the SDK that includes and initializes Libra API and is a good place to test and insert own experimental code.

See also code examples section

How to detect an error in my application if something goes wrong using Libra?

When debugging with Libra API, you call libra_GetLastErrorMessage() to see if previous Libra call did succeed or fail. See sample programs and Libra documentation for details - www.gpusystems.com/doc

How to view the contents of my Libra variable ?

Call print() to flush the contents of your variable to std::out and IDE output window. See sample programs and Libra documentation for details - www.gpusystems.com/doc

How can I view the contents of my variable in my debugger ?

Call getData() on your variable to "download" the contents to a local variable in your host programming environment to view data in your debugger. See sample programs and Libra documentation for details - www.gpusystems.com/doc

How can I view the contens of my variable graphically ?

Call render() on your variable to view the contents in the Libra Debugger window. You need to enable cmdLine -c ClientDebug for visual debugging. See sample program "ImageConvolution" source code and Libra documentation for details - www.gpusystems.com/doc

What other debugging tips are there for finding errors ?

Try running on another Libra compute backend for comparison/validation of results. For example passing -b CPU_BACKEND to libra_Init() or calling libra_SetCurrentBackend(). See sample programs and Libra documentation for details - www.gpusystems.com/doc

How can I synchronize my application function calls with Libra Runtime ?

Call libra_Finish() in order to synchronize Libra with the calling application.

Is it is possible to call Libra API from more than one thread ?

Yes, but is the responsibility of the calling application to synchronize Libra API calls from within multiple threads/contexts (calling Libra API the same time from many threads is undefined)

Does calling Libra API from multiple synchronized threads hurt or affect application performance ?

No - As Libra is a runtime system, all Libra API calls are simply enqueued for processing and calling threads always return immediately.

Are there any Libra API CPU blocking calls ?

Yes, libra_GetData() or libra_Finish() are good synchronization points for CPU - GPU interaction.

What are compute states ?

Compute states are Libra Runtime API calls that the application can toggle in order to switch compute precision or compute backend dynamically as needed.
For example: GFLOAT64 precision requires always more bandwidth than GFLOAT32 precision and may affect algorithm performance if not used sparingly.

Functionality

What level of math functionality is included by Libra SDK ?

Libra 1.2 supports BLAS 1,2 and level 3 functionality, dense & sparse matrix/vector operations and complex number arithmetics similar to matlab. All standard arithmetic operators, boolean operators, trigonometric operations, compare operations, conditional (if else) programming, random number generation plus necessary primitives/operators for solving small or larger linear equation systems.

How do I port existing matlab/octave scripts using Libra ?

As Libra is a dynamically typed environment for matrix/vector operations just like octave/matlab and following matlab naming convention, it is easy to port and/or extend Libra functionality with algorithms previously designed in matlab or another highlevel language or building new ones.

What compute backends are supported by Libra ?

Current version Libra 2.0 supports a NVIDIA specific CUDA_BACKEND, AMD GPU specific OPENCL_BACKEND, x86 CPU_BACKEND and NVIDIA/AMD OPENGL_BACKEND (single precision & real numbers).

Does Libra support double precision arithmethics ?

Yes, if you have a compute device, a CPU or GPU that supports double precision in hardware. (OPENGL_BACKEND reverts to single precision regardless of hardware).

Does Libra support complex number arithmetics ?

Yes, all functions support real as well as complex numbers equivalents.

What datatypes are supported by Libra ?

Float, double, integer and boolean types and operations are supported.

How do I select precision for my computation ?

As default - Libra selects 32-bit floating point precision before double precision and reverts to 32-bit precision if double precision is specified but not supported by current compute backend. During application flow, set desired precision using libra_SetDefaultDataType(). All Libra API calls that follow will target the currently set precision. See sample programs and Libra documentation for details - www.gpusystems.com/doc

How do I select a compute backend ?

By default, Libra automatically selects a GPU device before a CPU device. During application initialization, to explicitly choose a compute backend, a backend flagged can be passed to libra_Init() or switched dynamically using libra_SetCurrentBackend during application flow. See sample programs and Libra documentation for details - www.gpusystems.com/doc

License information

If I want to start programming with Libra API, how to do ?

Very simple, At no cost, goto download section and get yourself a copy of Libra SDK.

How do I ship my product that uses Libra SDK ?

Quick answer : Deploy Libra SDK + license onto the target machine.

Longer answer :

To acquire a Libra SDK license for developing or product shipping purposes - Goto download section.

1. Register a Libra SDK.
2. Download Libra SDK.
3. Deploy Libra SDK on the target machine.
4. Run Libra SDK on the target machine.

For info on Libra developing, product shipping and licensing, please contact GPU Systems for information : info@gpusystems.com