Get Started with the Intel® Rendering Toolkit for Linux*

ID 766438
Date 3/22/2024
Public

Configure Your System

To use the Intel® Rendering Toolkit (Render Kit) samples, you first need to set up your system as follows:

  1. Install Intel® oneAPI Base Toolkit for dependency libraries and the sample browser.
  2. Install build tools for building the samples.
  3. Recommended: Update CMake*.
  4. Install graphics and imaging libraries for viewing interactive sample application.
  5. Install imaging tools for staging sample input and output.
  6. Optional: Set up system for Intel® GPU compute..
  7. Install Level-Zero
  8. Set up environment variables.
  9. Optional: Set up a Docker* container for GUI-based applications.
  10. Optional: Install tools to navigate repositories and documentation.
NOTE:
If you use the Render Kit from the Intel® DevCloud, you can skip the configuration and start with building and running sample applications. Intel DevCloud already has all the Render Kit components installed and configure

Install the Base Kit with Intel® oneAPI Threading Building Blocks, which is available in both Render Kit and Base Kit. No other Base Kit components are required for CPU targets. See Base Kit product page for more information and download links.

d. See Get Started with Intel DevCloud for oneAPI for details. The 'Connect with Jupyter' section has a tutorial sand box for Render Kit.

Install the Intel® oneAPI Base Toolkit (Base Kit)

Install the Base Kit with the Intel® oneAPI DPC++/C++ Compiler selected as well as the automatic components the compiler adds. No other Base Kit components are required to be specified for Render Kit. See Base Kit product page for more information.

NOTE:
The Base Kit contains build-time and runtime library distributions for Intel® oneAPI DPC++/C++ Compiler. These Base Kit libraries are required to use Render Kit libraries when targeting Intel Graphics Devices. Other Base Kit libraries may be used directly with the system compiler for Rendering Libraries when targeting CPU. Libraries may be available from other distributions. If you have questions about alternate distributions for production deployment, please ask on the forum.
NOTE:
The oneAPI sample browser is automatically distributed as part of the Base Kit in the dev-utilities directory. Use the oneAPI sample browser to access sample applications easily for Render Kit getting started walkthrough guidance after setup.
NOTE:
You can also get the samples manually using Git*.

Install Tools to Build Samples

To build the Render Kit sample applications, you need to install CMake*, pkg-config library, and GNU* development tools. oneAPI tools and toolkits do not need the CMake and pkg-config, many oneAPI samples are provided as CMake projects and require CMake to build them. In some cases, pkg-config is also necessary to locate libraries needed to complete a build of the application.

Most compilers use GNU build toolchains existing on your system to provide a complete C/C++ development environment. If your Linux distribution does not include the complete suite of GNU development tools, you need to install them. Render Kit is validated with compilers that support C99 and C++11.

To install CMake, pkg-config, and GNU development tools on your Linux system, open a new terminal session and enter the following commands.

IMPORTANT:
You need root permissions to install the tools.

Ubuntu*

sudo apt update
sudo apt -y install cmake pkg-config build-essential

Red Hat*, Fedora*, CentOS*

sudo yum update
sudo yum -y install cmake pkgconfig
sudo yum groupinstall "Development Tools"

SUSE*

sudo zypper update
sudo zypper --non-interactive install cmake pkg-config which
sudo zypper --non-interactive install patterns-devel-C-C++-devel_C_C++ gcc-c++

For all distributions: Verify the installation

Print the installation location with this command:

which cmake pkg-config make gcc g++

One or more of these locations will display:

/usr/bin/cmake
/usr/bin/pkg-config
/usr/bin/make
/usr/bin/gcc
/usr/bin/g++

For more information about CMake, refer to CMake.org.

If you are cannot install CMake using your Linux distribution standard package manager, see the CMake download page for additional installation options.

Recommended: Update CMake*

Intel® Embree, Intel® OSPRay, Intel® Open Volume Kernel Library (Intel® Open VKL), and Intel® Open Image Denoise require CMake 3.1 or higher. Superbuild rkutil component requires CMake 3.12 or higher. For optimal compatibility with Intel® OSPRay Studio, CMake 3.15 or higher is suggested, but not required. To check what CMake version is installed on your system, run:

cmake --version

If your system package manager offers only a lower version CMake:

  1. Remove the CMake installed on your system to avoid conflicting dependencies:
    • On Ubuntu:
      apt purge cmake
    • On CentOS or Red Hat:
      yum remove cmake
    • On SUSE:
      zypper rm cmake
  2. Install the latest CMake version from the CMake download page with your preferred download method.

Install Graphics and Imaging Libraries

Some Render Kit samples, such as Intel OSPRay Studio, are interactive and require graphics libraries.

To install the graphics and imaging libraries, do one of the following depending on your Linux distribution:

IMPORTANT:
You need root permissions to install the libraries.

Ubuntu 20.04 Runtime Dependencies

sudo -E apt install libpng16-16 libjpeg-turbo8 libglfw3 libgl1 libopenimageio2.1 libxrandr2 libxinerama1 libxcursor1

Ubuntu 20.04 Developer Build Dependencies

sudo -E apt install libpng-dev libjpeg-turbo8-dev libglfw3-dev mesa-common-dev libopenimageio-dev libopenimageio-doc libxrandr-dev libxinerama-dev libxcursor-dev

Ubuntu 22.04 Runtime Dependencies

sudo -E apt install libpng16-16 libjpeg-turbo8 libglfw3 libgl1 libopengl0 libopenimageio2.2 libxrandr2 libxinerama1 libxcursor1

Ubuntu 22.04 Developer Build Dependencies

sudo -E apt install libpng-dev libjpeg-turbo8-dev libglfw3-dev mesa-common-dev libopenimageio-dev libopenimageio-doc libxrandr-dev libxinerama-dev libxcursor-dev

CentOS 8 Runtime Dependencies

  1. Make sure extended library sets are searchable:
    sudo -E yum install epel-release dnf-plugins-core
    sudo -E yum config-manager --set-enabled powertools
    sudo -E yum repolist
  2. Install graphics drives:
    sudo -E yum install mesa-dri-drivers.x86_64
  3. Install runtimes:
    sudo -E yum install libpng.x86_64 libjpeg-turbo.x86_64 glfw.x86_64 libglvnd-glx.x86_64 OpenImageIO.x86_64 libXrandr2.x86_64 libXinerama.x86_64 libXcursor.x86_64

CentOS 8 Developer Build Dependencies

sudo -E yum install libpng-devel.x86_64 libjpeg-turbo-devel.x86_64 glfw-devel.x86_64 libglvnd-devel.x86_64 OpenImageIO-devel.x86_64 libXrandr-devel.x86_64 libXinerama-devel.x86_64 libXcursor-devel.x86_64 libXxf86vm-devel

openSUSE* Leap 15 SP2 Runtime Dependencies

  1. Install graphics drives:
    sudo -E zypper install Mesa-dri
  2. Install runtimes:
    sudo -E zypper install libpng16-16 libjpeg8 libglfw3 libglvnd OpenImageIO libXrandr2 libXinerama1 libXcursor1 libXxf86vm1

openSUSE* Leap 15 SP2 Developer Build Dependencies

sudo -E yum install libpng-devel.x86_64 libjpeg-turbo-devel.x86_64 glfw-devel.x86_64 libglvnd-devel.x86_64 OpenImageIO-devel.x86_64 libXrandr-devel.x86_64 libXinerama-devel.x86_64 libXcursor-devel.x86_64 libXxf86vm-devel
NOTE:
In the repository, the libopenimageio can have a different label or version for your OS distribution. dev[el]-suffixed packages are used for building, while non-dev[el] packages are used at application run-time.

The commands from the sections install the following libraries:

  • libPNG is a PNG image loading library for input and output image files.
  • libJPEG is a JPEG image loading library for input and output image files.
  • libGL is OpenGL* graphics library.
  • libGLFW3 is a multiplatform OpenGL API for windowing, input, events.
  • libOpenImageIO is a library for reading and writing many image types, including HDR images.
  • libxrandr is an X11* RandR* extension library.
  • libXinerama is an X11* Xinerama* extension library.
  • libxcursor is an X* cursor management library.
  • libXxf86vm1 is an X11* XFree86* video mode extension library. This library is available on CentOS and Ubuntu by default.

Install OpenMP* Library

The oneAPI distribution of Intel ISPC has a dependency on OpenMP*. Other libraries in the rendering toolkit, such as OSPRay and OSPRay Studio, depend on Intel ISPC. Thus, OpenMP is required for precompiled and compiled programs built against Rendering Toolkit libraries to run.

To install an OpenMP library, do one of the following depending on your Linux distribution:

IMPORTANT:
You need root permissions to install the libraries.

Ubuntu*

sudo -E apt install libomp-dev libomp5

Rocky/RHEL/CentOS compatible

sudo -E yum install libomp

openSUSE* Leap 15 SP2 compatible or higher

sudo -E zypper install libomp-devel

Fedora

sudo -E yum install libomp

Install Imaging Tools

Render Kit samples and applications often require preprocessed images as input or generate images as output. To display and convert input and output images, you need to get imaging tools for staging NetPBM filetypes (PPM and PFM). The ImageMagick* tool is suggested. See the ImageMagick website for standalone and package manager install instructions.

Set up System for GPU Compute

To work with GPU workloads, you need to configure your system properly.

Install GPU Drivers

To install GPU drivers, follow the instructions for your system in the Installation Guide.

NOTE:
Intel® Arc™ Graphics users see the 'Client Usages' section.

BIOS setup

In the BIOS, enable Resizable Bar (Base Address Register) for better performance if the setting is available.

Set up Permission

Non-root users typically do not have access to a GPU device to for compute workloads. To access GPU capabilities, the active user must be able to access DRM render nodes in /dev/dri.

The following will list the group assigned ownership of the render nodes, and list the groups the active user is a member of:

stat -c "%G" /dev/dri/render*
groups ${USER}

If the active user is not a member of the same group used by the DRM render nodes (usually ‘render’ or ‘video’), add the user to the render node group.

sudo gpasswd -a ${USER} render

This will be sufficient for shells created after this update. To change the group ID of the current shell:

newgrp render

You need to add the non-root user(s) to the group. Otherwise, binaries compiled for the GPU device will fail when executed by a non-root user.

IMPORTANT:
You need root permissions to set up the permission.

Disable Hangcheck

A workload that takes more than four seconds for GPU hardware to execute is a long-running workload. By default, individual threads that qualify as long-running workloads are considered hung and are terminated. To avoid this problem, disable the hangcheck timeout period.

NOTE:

Disable hangcheck only for applications with long-running GPU compute workloads in native environments.

You need root permissions.

To disable hangcheck, run the following:

sudo sh -c "echo N> /sys/module/i915/parameters/enable_hangcheck"

After you reboot your system, hangcheck is automatically enabled. You need to disable hangcheck again after every reboot or follow the instructions below to disable hangcheck permanently.

To disable hangcheck permanently:

  1. Open a new terminal.
  2. Navigate to the /etc/default directory and open the grub file for editing.
  3. In the grub file, find the line GRUB_CMDLINE_LINUX_DEFAULT="".
  4. Between the quotes, type the following:
    i915.enable_hangcheck=0
  5. Run the following command:
    sudo update-grub
  6. Reboot the system. Hangcheck should remain disabled.
NOTE:
If you update the kernel, hangcheck is automatically enabled. Run the instructions above after every kernel update to ensure hangcheck is disabled.

Multi-card Deployments

Some systems may have compatibility issues between the system BIOS and the Linux kernel MMIO BAR re-allocation which prevents the Intel Data Center GPUs from being accessible once the system has booted. If you are experiencing problems with multi-card solutions and the Intel GPU devices not initializing (entries for the device are not enumerating in /dev/dri), you can work around the issue by adding pci=realloc=off to your kernel’s boot parameter.

To check if your system already has pci=realloc=off, you can check for the string via cat /proc/cmdline. If it does not, you can add the option using instructions provided by your operating system provider, or by editing the value of GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub to include pci=realloc=off. After you have made the changes, run sudo update-grub to regenerate the system’s boot configuration, and reboot.

After editing, the line for GRUB_CMDLINE_LINUX_DEFAULT should look similar to the following:

GRUB_CMDLINE_LINUX_DEFAULT="text pci=realloc=off"

After editing, make sure you run sudo update-grub and then reboot. After rebooting, you should now see pci=realloc=off in /proc/cmdline.

Install Level-Zero

If you did not install a graphics driver, OSPRay-based applications may still require level-zero. Download the level-zero-devel and level-zero release packages. Example download and install (as root user and using Ubuntu 22.04):

wget https://github.com/oneapi-src/level-zero/releases/download/v1.11.0/level-zero_1.11.0+u22.04_amd64.deb
wget https://github.com/oneapi-src/level-zero/releases/download/v1.11.0/level-zero-devel_1.11.0+u22.04_amd64.deb
dpkg -i level-zero*.deb

Set up Environment Variables

To use Render Kit from command line, you need to set up environment variables for Intel oneAPI Toolkit components using a setvars.sh script. You can find the script in the root folder of your Intel oneAPI Toolkit installation, which is by default /opt/intel/oneapi/ for sudo or root users and ~/intel/oneapi/ for non-root users.

NOTE:
If you installed the Intel oneAPI Toolkits to a different location, make sure to replace the default path with your custom one in the commands below before running them.

Option 1. Configure environment variables once per session

Each time as you open a new terminal, you need to source the setvars.sh script as follows:

  • For root or sudo users:
    source /opt/intel/oneapi/setvars.sh
  • For non-root users:
    source ~/intel/oneapi/setvars.sh

Option 2. Configure environment variables to be set up automatically for all sessions

To have the environment automatically set up for your all projects, add the source command to a startup script where it will be invoked automatically.

For example, you can add the source /opt/intel/oneapi/setvars.sh (for root users) or the source ~/intel/oneapi/setvars.sh (for non-root users) command to your ~/.bashrc_profile or ~/.profile script.

To make the settings permanent for all accounts on your system, create a one-line .sh script in your system's /etc/profile.d folder and add the source command to the file.

For details about environment variables, see Ubuntu documentation.

You can manage the setvars.sh script using a configuration file. This is helpful if you need to initialize specific versions of libraries or a compiler, rather than defaulting to the latest version. For details, see Using a Configuration File to Manage Setvars.sh.

If you need to setup the environment in a non-POSIX shell, see oneAPI Development Environment Setup for more configuration options.

Optional: Set up a Docker* Container for GUI Applications

If you want to run samples from a Docker* container, you need to configure the container environment first.

  1. Give a Docker session access to a window manager using Xhost*. Allow access to the X* server:
    xhost +

    Otherwise, GUI-based Render Kit samples launched from the Docker container can give a X11: Failed to open display error.

  2. Run the Docker container with one of the following methods:
    • With access to the display and X Server socket, but no access to GPU:
      • If you have proxy set up:
        sudo -E docker run --name renderkit --rm -it --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -e HTTP_PROXY=$HTTP_PROXY -e HTTPS_PROXY=$HTTPS_PROXY -e http_proxy=$http_proxy -e https_proxy=$https_proxy ubuntu bash
      • If you do not have proxy set up:
        sudo -E docker run --name renderkit --rm -it --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ubuntu bash
    • With access to the display and X Server socket and to GPU:
      • If you have proxy set up:
        sudo -E docker run --name renderkit --rm -it --privileged --device=/dev/dri -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -e HTTP_PROXY=$HTTP_PROXY -e HTTPS_PROXY=$HTTPS_PROXY -e http_proxy=$http_proxy -e https_proxy=$https_proxy ubuntu bash
      • If you do not have proxy set up:
        sudo -E docker run --name renderkit --rm -it --privileged --device=/dev/dri -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ubuntu bash
  3. Install the Render Kit using a package manager or copy an offline installer into your docker container. See Intel oneAPI Toolkits Installation Guide for Linux* OS for instructions.
  4. Run a GUI application, such as xclock, to verify the container can run GUI applications. Xclock is available as one of the following:
    • In the xorg-x11-apps package on CentOS/Red Hat
    • In the xclock package on SUSE
    • On the x11-apps on Ubuntu

Optional: Install Tools to Navigate Repositories and Documentation

You might need the following tools:

  • Install Git* or Wget* to get the library and sample source code.
  • Install Grip* and Mozilla* Firefox* to view documentation in Markdown format located in the Intel oneAPI Toolkit package or GitHub* repositories.
  • Install a PDF viewer, for example, Evince*, to view in-package documentation.

Next Steps

Get started with the Intel® Rendering Toolkit by building and running sample applications.

Feedback on Issues

Share your feedback on this article in the Intel® Rendering Toolkit forum.