I am having some Issues exactly underestanding how to install the Driver+Firmware+Runtime for getting a few Hailo-8L to work on Debian Bookworm 12 AMD64.
My Goal is to run Podman Container (Rootless hopefully) with Frigate to have Accelerated Object Detections.
Unfortunately either the Official Documentation is difficult to find or just not very clear to me.
I mean since .deb Packages are available, it should also possible to create these Locally. Are there Instructions available ? There is no debian/changelog File so the “usual” Commands don’t really work …
#!/bin/bash
source config.sh
git clone https://github.com/hailo-ai/hailort.git
cd hailort
git checkout ${HAILORT_RUNTIME_TAG}
#cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config release
# Include installation in the Machine
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && sudo cmake --build build --config release --target install
build_pcie_driver.sh
#!/bin/bash
source config.sh
git clone https://github.com/hailo-ai/hailort-drivers.git
cd hailort-drivers
git checkout "${HAILORT_DRIVER_TAG}"
build --config release
cd linux/pcie
make all
sudo make install_dkms
sudo modprobe hailo_pci
cd ../.. || exit
./download_firmware.sh
mkdir -p /lib/firmware/hailo/
sudo mv hailo8_fw.${HAILORT_DRIVER_VERSION}.bin /lib/firmware/hailo/hailo8_fw.bin
mkdir -p /etc/udev/rules.d/
sudo cp ./linux/pcie/51-hailo-udev.rules /etc/udev/rules.d/
And I managed to get it working (almost) first try on Kernel 6.8.12-4-pve on Proxmox VE with Hailo Version v4.19.0. The 3x Installed Devices are recognized.
Whether they are all actually being used by Frigate Docker/Podman Container it’s another Matter: Frigate is NOT crashing and seems to have detected at least one of them, and CPU usage went down. No clue how to check the respective Load / Usage of each of these Hailo-8L though .
The original Question was also trying to ask: How can I create a Debian Package (.deb) from these Sources. The Provided Commands work “OK” for a Quick&Dirty Install, however I guess it should be fairly easy to provide Commands for how to build a Debian Package based on those, since apparently Raspberry Pi / Hailo are doing it.
I cannot compile it on my install as I get this error when compiling
root@server /m/a/m/h/l/pcie (master)# make all
make[1]: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/src/pcie.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/src/fops.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/src/sysfs.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/src/nnc.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/src/soc.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../../common/fw_validation.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../../common/fw_operation.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../../common/pcie_common.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../../common/vdma_common.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../../common/hailo_resource.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../utils/logs.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../vdma/vdma.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../vdma/memory.o
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/../vdma/ioctl.o
LD [M] /mnt/apps/misc/hailort-drivers/linux/pcie/hailo_pci.o
MODPOST /mnt/apps/misc/hailort-drivers/linux/pcie/Module.symvers
CC [M] /mnt/apps/misc/hailort-drivers/linux/pcie/hailo_pci.mod.o
LD [M] /mnt/apps/misc/hailort-drivers/linux/pcie/hailo_pci.ko
BTF [M] /mnt/apps/misc/hailort-drivers/linux/pcie/hailo_pci.ko
Skipping BTF generation for /mnt/apps/misc/hailort-drivers/linux/pcie/hailo_pci.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'
root@HOST:/usr/src/hailo/hailort-drivers/linux/pcie# make clean
make[1]: Entering directory '/usr/src/linux-headers-6.8.12-4-pve'
CLEAN /usr/src/hailo/hailort-drivers/linux/pcie
CLEAN /usr/src/hailo/hailort-drivers/linux/pcie/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-6.8.12-4-pve'
root@HOST:/usr/src/hailo/hailort-drivers/linux/pcie# make all
make[1]: Entering directory '/usr/src/linux-headers-6.8.12-4-pve'
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/pcie.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/fops.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/sysfs.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/nnc.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/soc.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/fw_validation.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/fw_operation.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/pcie_common.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/vdma_common.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/hailo_resource.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../utils/logs.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../vdma/vdma.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../vdma/memory.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../vdma/ioctl.o
LD [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.o
MODPOST /usr/src/hailo/hailort-drivers/linux/pcie/Module.symvers
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.mod.o
LD [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.ko
BTF [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.ko
Skipping BTF generation for /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.8.12-4-pve'
All you need to do now is
sudo make install_dkms
sudo modprobe hailo_pci
If you think it’s REALLY an error you can try make all -d (DEBUG) or make all --trace (TRACE) and that will give you more Information.
But I still think that if you do this it will work like it did for me:
Nope, but I already installed it so maybe that’s why my output is a bit shorter. But pretty sure it was also like the following on my first try …
root@HOST:/usr/src/hailo/hailort-drivers/linux/pcie# sudo make clean
make[1]: Entering directory '/usr/src/linux-headers-6.8.12-4-pve'
make[1]: Leaving directory '/usr/src/linux-headers-6.8.12-4-pve'
root@HOST:/usr/src/hailo/hailort-drivers/linux/pcie# sudo make all
make[1]: Entering directory '/usr/src/linux-headers-6.8.12-4-pve'
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/pcie.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/fops.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/sysfs.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/nnc.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/src/soc.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/fw_validation.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/fw_operation.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/pcie_common.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/vdma_common.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../../common/hailo_resource.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../utils/logs.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../vdma/vdma.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../vdma/memory.o
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/../vdma/ioctl.o
LD [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.o
MODPOST /usr/src/hailo/hailort-drivers/linux/pcie/Module.symvers
CC [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.mod.o
LD [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.ko
BTF [M] /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.ko
Skipping BTF generation for /usr/src/hailo/hailort-drivers/linux/pcie/hailo_pci.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.8.12-4-pve'
root@HOST:/usr/src/hailo/hailort-drivers/linux/pcie# sudo make install_dkms
Creating symlink /var/lib/dkms/hailo_pci/4.19.0/source -> /usr/src/hailo_pci-4.19.0
Sign command: /lib/modules/6.8.12-4-pve/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Building module:
Cleaning build area...
make -j8 KERNELRELEASE=6.8.12-4-pve -C /lib/modules/6.8.12-4-pve/build M=/var/lib/dkms/hailo_pci/4.19.0/build/linux/pcie modules...
Signing module /var/lib/dkms/hailo_pci/4.19.0/build/./linux/pcie/hailo_pci.ko
Cleaning build area...
hailo_pci.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.12-4-pve/updates/dkms/
depmod...
root@HOST:/usr/src/hailo/hailort-drivers/linux/pcie#
Other things to check include dmesg, apparmor, selinux, auditd.
You might have some protections going on, possibly some “noexec” or other “weird” mount Options on that location as well as simply running out of Memory / RAM (“Killed”).
@Nadav Any Chance the Administrators can have a Look at this weird 403 Error while trying to Submit a Reply ? It’s super irritating when I prepare a Reply and it just refuses to submit (potentially/coincidentally because of Code Blocks Ticks ?) …
I’m pretty sure it has to do with kernel headers. I am unable to install linux-headers-$(uname -r) as I get
sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-6.6.44-production+truenas
E: Couldn't find any package by glob 'linux-headers-6.6.44-production+truenas'
E: Couldn't find any package by regex 'linux-headers-6.6.44-production+truenas'
I also cannot compile the kernel headers on my machine and am unable to compile them on my Arch machine. If you have a TrueNAS machine running could you try to install this kernel on yours and see if it works for you?
My best guess would be that they name their Kernel a bit differently than Debian GNU/Linux.
A bit similar to what Proxmox VE does with their Kernel for instance (proxmox-kernel-xxxx, pve-kernel-xxxx).
So I’d probably just use “aptitude search headers” or “aptitude search truenas” or something like that and see what comes up. Maybe the Kernel package is in something like “truenas-kernel”.
I’m a complete noob when it comes to compiling drivers so I’m stuck honestly. I appreciate all the help you’ve given so far but nothing works.
I can install the driver after running
I think you only miss installing the FIRMWARE (see above for my script) now and do a update-initramfs -k all -u ; update-grub ; reboot
The Error Message in dmesg looks familiar, it’s simply missing the Firmware to be built-into the initramfs (well, not sure if it’s really the case, but it won’t hurt). Also add hailo_pci into /etc/modules-load.d/hailo.conf on the 2nd LINE (first line just put a # Comment). Cannot remember if it’s /etc/modules-load.d or /etc/modprobe.d or what else but somewhere the 1st Line gets ignored that’s why I start at line number 2 every Time