Get Started

  • 2021.3
  • 07/20/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
    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.
To run the
vklTutorial
application:
  1. Open a new terminal window. Open Spotlight* tool and enter
    Terminal
    .
  2. Set environment variables to load Intel Open VKL dynamic libraries. From the terminal, do one of the following:
    • Run the script to set the variables:
      source <install-dir>/setvars.sh
    • Set the
      DYLD_LIBRARY_PATH
      manually:
      export DYLD_LIBRARY_PATH=<install-dir>/rkcommon/latest/lib:<install-dir>/ospray/latest/lib:<install-dir>/oidn/latest/lib:<install-dir>/embree/latest/lib:<install-dir>/openvkl/latest/lib:<install-dir>/tbb/latest/lib
  3. Go to the
    bin
    folder of the Intel Open VKL installation directory:
    cd <install-dir>/openvkl/latest/bin
  4. Run the sample application:
    ./vklTutorial
  5. Review the application output printed to the
    terminal
    .
The results show basic API functionality, such as sampling and interval capture. Where applicable, the application demonstrates the functionality under different operation widths (number of elements per call):
  • 1-wide sampling (1 sample per call)
  • N-wide sampling (4, 8, or 16)
  • Stream sampling (showing arbitrary number of positions at once, data layout flexibility)
The
vklTutorial
source is a good procedural example of how to use each of these API types.
Run the vklExamples 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.
Run the
vklExamples
application:
  1. Open a new terminal window. Open Spotlight* tool and enter
    Terminal
    .
  2. Set environment variables to load Intel Open VKL dynamic libraries. From the terminal, do one of the following:
    • Run the script to set the variables:
      source <install-dir>/setvars.sh
    • Set the
      DYLD_LIBRARY_PATH
      manually:
      export DYLD_LIBRARY_PATH=<install-dir>/rkcommon/latest/lib:<install-dir>/ospray/latest/lib:<install-dir>/oidn/latest/lib:<install-dir>/embree/latest/lib:<install-dir>/openvkl/latest/lib:<install-dir>/tbb/latest/lib
  3. Go to a writable directory, for example, to home directory
    ~
    :
    cd ~
  4. Run the sample application:
    <install-dir>/openvkl/latest/bin/vklExamples -windowSize 1024 768
    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
    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 the default C/C++ compiler available from Xcode.
  • Git* 2.10 or higher
  • CMake* 3.12 or higher
To build the
vklTutorial
sample application:
  1. Open a new terminal window. Open Spotlight* tool and enter
    Terminal
    .
  2. Go to a writable directory. Create a directory to stage the build. For example, create the
    rk_gsg
    folder under the :
    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 tags/v0.13.0
    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 environment variables so that programs can see Render Kit runtime libraries. From the terminal, do one of the following:
    • Run the script to set the variables:
      source <install-dir>/setvars.sh
    • Set the
      DYLD_LIBRARY_PATH
      manually:
      export DYLD_LIBRARY_PATH=<install-dir>/rkcommon/latest/lib:<install-dir>/ospray/latest/lib:<install-dir>/oidn/latest/lib:<install-dir>/embree/latest/lib:<install-dir>/openvkl/latest/lib:<install-dir>/tbb/latest/lib
  6. Build the
    vklTutorial
    with CMake:
    export rkcommon_DIR=<install-dir>/rkcommon/latest
    export embree_DIR=<install-dir>/embree/latest
    export openvkl_DIR=<install-dir>/openvkl/latest
    export ospray_DIR=<install-dir>/ospray/latest
    export tbb_DIR=<install-dir>/tbb/latest
    cmake .. -DCMAKE_BUILD_TYPE=Release
    cmake --build .
  7. Run the sample application:
    ./vklTutorial

Next Steps

Product and Performance Information

1

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