From 1586722f7e0fcabd2dd1ecfe0f63dfcd21f14d60 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 7 Aug 2024 19:39:43 -0600 Subject: [PATCH] Support installations on amd64 and arm64 --- docker/hailo8l/h8l.hcl | 8 +++---- docker/hailo8l/user_installation.sh | 35 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 docker/hailo8l/user_installation.sh diff --git a/docker/hailo8l/h8l.hcl b/docker/hailo8l/h8l.hcl index bff09e6ba..a1eb82fb5 100644 --- a/docker/hailo8l/h8l.hcl +++ b/docker/hailo8l/h8l.hcl @@ -1,18 +1,18 @@ target wheels { dockerfile = "docker/main/Dockerfile" - platforms = ["linux/arm64"] + platforms = ["linux/arm64","linux/amd64"] target = "wheels" } target deps { dockerfile = "docker/main/Dockerfile" - platforms = ["linux/arm64"] + platforms = ["linux/arm64","linux/amd64"] target = "deps" } target rootfs { dockerfile = "docker/main/Dockerfile" - platforms = ["linux/arm64"] + platforms = ["linux/arm64","linux/amd64"] target = "rootfs" } @@ -23,5 +23,5 @@ target h8l { deps = "target:deps" rootfs = "target:rootfs" } - platforms = ["linux/arm64"] + platforms = ["linux/arm64","linux/amd64"] } diff --git a/docker/hailo8l/user_installation.sh b/docker/hailo8l/user_installation.sh new file mode 100644 index 000000000..0f40bbaac --- /dev/null +++ b/docker/hailo8l/user_installation.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Update package list and install dependencies +sudo apt-get update +sudo apt-get install -y build-essential cmake git wget linux-modules-extra-$(uname -r) + +arch=$(uname -m) + +if [[ $arch == "x86_64" ]]; then + sudo apt install -y linux-headers-$(uname -r); +else + sudo apt install -y linux-modules-extra-$(uname -r); +fi + +# Clone the HailoRT driver repository +git clone --depth 1 --branch v4.17.0 https://github.com/hailo-ai/hailort-drivers.git + +# Build and install the HailoRT driver +cd hailort-drivers/linux/pcie +sudo make all +sudo make install + +# Load the Hailo PCI driver +sudo modprobe hailo_pci + +# Download and install the firmware +cd ../../ +./download_firmware.sh +sudo mv hailo8_fw.4.17.0.bin /lib/firmware/hailo/hailo8_fw.bin + +# Install udev rules +sudo cp ./linux/pcie/51-hailo-udev.rules /etc/udev/rules.d/ +sudo udevadm control --reload-rules && sudo udevadm trigger + +echo "HailoRT driver installation complete."