Get Started

  • 2021.2
  • 03/26/2021
  • Public Content

Run a Sample with Intel® Open Volume Kernel Library (Intel® Open VKL)

This tutorial demonstrates how to use the Intel® Open Volume Kernel Library (Intel® Open VKL) with sample applications to visualize volumetric datasets.
To run the sample applications, do one of the following:

Run Pre-Built Samples

Run the vklTutorial Sample
Graphical user interface (GUI) is not required to run this sample.
The
vklTutorial
sample application demonstrates how to use the Intel Open VKL API to find samples, gradients, and t-values along sampling rays in a simple procedurally defined volume.
Requirements:
  • Intel® oneAPI Rendering Toolkit
    for Linux* OS
    with Intel Open VKL. By default, the toolkit is installed to
    /opt/intel/oneapi/
    directory. Replace
    <install-dir>
    with the default or your custom installation path.
    Intel® DevCloud has the toolkit pre-installed.
To run the
vklTutorial
application:
  1. Open a new terminal window with default environment.
  2. Set up the Intel Open VKL environment variables. These environment variables allow applications to load Intel Open VKL dynamic libraries.
    source <install-dir>/setvars.sh
  3. Go to the
    bin
    folder of the Intel Open VKL installation directory:
    cd <install-dir>/openvkl/latest/bin
    To run this application in the Intel® DevCloud environment, consider using a queue mechanism.
  4. Run the sample application:
    ./vklTutorial
  5. Review the application output printed to the
    terminal
    .
The results display the following:
  • A bounding box for a grid.
  • The range of values, or samples, within the grid.
  • A sample taken at location 1.0, 1.0, 1.0 of the grid.
  • The computed gradient at the same 1.0, 1.0, 1.0 location.
  • Intervals of a ray that correlate with ranges of sought values. You can search these intervals further in user code.
Run the vklExamples Sample
Graphical user interface (GUI) is required to run this sample.
The
vklExamples
sample application renders the Intel Open VKL API results to screen through a graphical interface.
Requirements:
  • Intel® oneAPI Rendering Toolkit
    for Linux* OS with Intel Open VKL. By default, the toolkit is installed to
    /opt/intel/oneapi/
    directory. Replace
    <install-dir>
    with the default or your custom installation path.
  • An OpenGL*-capable device.
    • For Intel® Graphics devices, you can use a recent Linux* kernel with i915 kernel module. For example, you can use Linux* kernels 4.11 or higher and Intel® Graphics Technology Gen 9 or higher platforms.
    • For platforms without OpenGL* hardware devices, you can use Mesa3D* software OpenGL* implementation.
This application functions on different Linux* OS distributions and hardware configurations. This walkthrough was validated on Intel® Core™ i7-6770HQ (NUC6i7KYK) with Intel® Iris® Pro Graphics 580. Ubuntu* 18.04.3 OS was deployed with Linux* kernel 5.3.0. The hardware OpenGL* accelerator on this platform is accessed through the i915 kernel module distributed with the OS distribution. Your system may have different hardware or OS and require its own software and library configuration.
Set up the prerequisites for the vklExamples application:
In addition to default Intel Open VKL dependencies, the
vklExample
application requires the following 64-bit runtime libraries: libGL.so.1, libX11.so.6, libXrandr.so.2, libXinerama.so.1, libXxf86vm.so.1, libXcursor.so.1.
On Ubuntu* OS, you can run the following command to install the required dependencies with the following packages:
apt install libgl1 libx11-6 libxrandr2 libxinerama1 libxxf86vm1 libxcursor1
Run the
vklExamples
application:
  1. Open a new terminal window with default environment.
  2. Set up the Intel Open VKL environment variables. These environment variables allow applications to load Intel Open VKL dynamic libraries.
    source <install-dir>/setvars.sh
  3. Go to a writable directory, for example, to home directory
    ~
    :
    cd ~
  4. Run the sample application:
    <install-dir>/openvkl/latest/bin/vklExamples
    The sample results will open in a new GUI window.
The Intel Open VKL API path enabling Intel® Implicit SPMD Program Compiler (Intel® ISPC) might not be available. If the program shows a blank screen, choose the
C scalar
API from the
Open VKL API used
drop-down.
User interface elements may overlap. Drag and drop the blue control bar to see all controls.
You can select different transfer functions, Intel Open VKL API values, and rendering controls to visualize the volume:

Build and Run a Sample Application

This section explains how to build and run the
vklTutorial
sample application, which uses the Intel Open VKL API to find samples, gradients, and t-values along sampling rays in a simple procedurally defined volume.
Requirements:
  • Intel® oneAPI Rendering Toolkit
    for Linux* OS
    with Intel Open VKL. By default, the toolkit is installed to
    /opt/intel/oneapi/
    directory. Replace
    <install-dir>
    with the default or your custom installation path.
  • A C99 compiler such as GNU Compiler Collection (GCC)*, Clang*,
    Intel® C++ Compiler Classic
    , or
    Intel® oneAPI
    DPC++/C++
    Compiler
    included in the
    Intel® oneAPI Base Toolkit
    .
    • This tutorial uses GCC from GNU Compiler Collection 7.5.0.
  • Git* 2.10 or higher
  • CMake* 3.12 or higher
To build the
vklTutorial
sample application:
  1. Open a new terminal window.
  2. Go to a writable directory. Create a directory to stage the build. For example, create the
    rk_gsg
    folder under the
    home directory
    ~
    :
    cd ~
    mkdir rk_gsg
    cd rk_gsg
  3. Check out sources for the sample application from the Intel Open VKL GitHub repository. Check out the version tag for your release of the Render Kit:
    git clone --no-checkout https://github.com/openvkl/openvkl openvkl
    cd openvkl
    git fetch --tags
    git checkout v0.12.0 -- examples/vklTutorial.c examples/from_openvkl_install
    See the latest Release Notes for version information
  4. Set up a build directory:
    cd examples/from_openvkl_install
    mkdir build
    cd build
  5. Set up the Intel Open VKL environment variables. These environment variables allow applications to load Intel Open VKL dynamic libraries.
    source <install-dir>/setvars.sh
  6. Build the
    vklTutorial
    with CMake:
    cmake ..
    make
  7. Run the sample application:
    ./vklTutorial
    To run this application in the Intel® DevCloud environment, consider using a queue mechanism.
Review the application output printed to the command prompt. The results display the following:
  • A bounding box for a grid.
  • The range of values, or samples, within the grid.
  • A sample taken at location 1.0, 1.0, 1.0 of the grid.
  • The computed gradient at the same 1.0, 1.0, 1.0 location.
  • Intervals of a ray that correlate with ranges of sought values. You can search these intervals further in user code.
  • Ray t-values for desired sample values.

Next Steps

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.