How to Compiling HailoRT from Sources for Proxmox

Hi my computer specs is

  1. Kernel 7.0.14-3-pve

  2. Python 3.13.5

  3. installed build-essential package, bison, flex, libelf-dev and dkms

I have followed the guide and completed the following

https://hailo.ai/developer-zone/documentation/hailort-v4-23-0/?sp_referrer=inference/inference.html#multi-process-service

  1. git clone GitHub - hailo-ai/hailort: An open source light-weight and high performance inference framework for Hailo devices · GitHub

  2. cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && sudo cmake --build build --config release --target install

  3. Extracted the CMakeLists.txt from /hailort/hailort/libhailort/examples/

The file content looks like this

cmake_minimum_required(VERSION 3.5.0)

project(hailort-examples)

if(WIN32)
add_compile_options(/W4)
elseif(UNIX)
if (CMAKE_CXX_COMPILER_ID STREQUAL “GNU” OR CMAKE_CXX_COMPILER_ID STREQUAL “QCC”)
add_compile_options(-Wall -Wextra -Wconversion)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL “Clang”)
add_compile_options(-Wall -Wextra -Wconversion -Wno-missing-braces)
endif()
else()
message(FATAL_ERROR “Unexpeced host, stopping build”)
endif()

if (HAILO_COMPILE_WARNING_AS_ERROR)

Treat warnings as errors for all examples

if(WIN32)
add_compile_options(/WX)
elseif(UNIX)
add_compile_options(-Werror)
else()
message(FATAL_ERROR “Unexpeced host, stopping build”)
endif()
endif()

add_subdirectory(cpp)
add_subdirectory(c)
add_subdirectory(genai)

add_custom_target(hailort_examples)
add_dependencies(hailort_examples c_hailort_examples cpp_hailort_examples genai_hailort_examples)

  1. Added “find_package(HailoRT REQUIRED)“

  2. cmake ..

But driver is not installed

During cmake, I have the following warning. Wondering if it affects the compilation

-- Qt4 not found, so disabling the mandelbrot and opengl demos
– Could NOT find CHOLMOD (missing: CHOLMOD_INCLUDES CHOLMOD_LIBRARIES)
– Could NOT find UMFPACK (missing: UMFPACK_INCLUDES UMFPACK_LIBRARIES)
– Could NOT find KLU (missing: KLU_INCLUDES KLU_LIBRARIES)
– Could NOT find SuperLU (missing: SUPERLU_INCLUDES SUPERLU_LIBRARIES SUPERLU_VERSION_OK) (Required
is at least version “4.0”)

Thank you for your time.

Hi @user631 :waving_hand:

Your build is correct, the problem is that the repo you compiled does not contain the driver. The hailort repo only builds the userspace library (libhailort) and the examples. The PCIe kernel driver is in a separate repo, hailo-ai/hailort-drivers, and without it there is no /dev/hailo0, even if the library builds fine.

About the CMake warnings (Qt4, CHOLMOD, UMFPACK, SuperLU): those come from Eigen, a third-party dependency that hailort downloads during the build (see hailort/cmake/external/eigen.cmake). They only disable some Eigen demos, they do not affect libhailort at all, so you can ignore them.

In order to get the driver on Proxmox you need the pve kernel headers, then build and install the module:

sudo apt install pve-headers-$(uname -r)   # on newer Proxmox the package is proxmox-headers-$(uname -r)

git clone --depth 1 --branch v4.23.0 https://github.com/hailo-ai/hailort-drivers.git
cd hailort-drivers/linux/pcie
make all
sudo make install
sudo modprobe hailo_pci

# firmware + udev rule
cd ../..
./download_firmware.sh
sudo mkdir -p /lib/firmware/hailo
sudo mv hailo8_fw.4.23.0.bin /lib/firmware/hailo/hailo8_fw.bin
sudo cp linux/pcie/51-hailo-udev.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

Two notes. First, keep the driver and the library on the same tag (v4.23.0 in your case), mixing versions is a common source of errors. Second, it depends on where you want the device: if the card is passed through to a VM, the driver goes inside the guest (with that guest’s kernel headers), and the Proxmox host only needs the vfio passthrough config. If you run inference directly on the host, use the pve headers as above.

To confirm on my side, I built the same v4.23.0 driver from source today (make all in the linux/pcie folder) on kernel 6.17 and it compiles clean; my Hailo-8L runs with exactly that driver + firmware layout (/lib/firmware/hailo/hailo8_fw.bin). After the modprobe you should see /dev/hailo0 and hailortcli fw-control identify should answer.

Hope this helps!