2024-08-09 23:53:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Update package list and install dependencies
|
|
|
|
sudo apt-get update
|
2024-09-25 21:53:17 +02:00
|
|
|
sudo apt-get install -y build-essential cmake git wget
|
2024-08-09 23:53:33 +02:00
|
|
|
|
|
|
|
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
|
2024-09-26 20:16:08 +02:00
|
|
|
git clone --depth 1 --branch v4.18.0 https://github.com/hailo-ai/hailort-drivers.git
|
2024-08-09 23:53:33 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2024-09-26 20:16:08 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Unable to load hailo_pci module, common reasons for this are:"
|
|
|
|
echo "- Key was rejected by service: Secure Boot is enabling disallowing install."
|
|
|
|
echo "- Permissions are not setup correctly."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-08-09 23:53:33 +02:00
|
|
|
# Download and install the firmware
|
|
|
|
cd ../../
|
|
|
|
./download_firmware.sh
|
2024-09-26 20:16:08 +02:00
|
|
|
sudo mv hailo8_fw.4.18.0.bin /lib/firmware/hailo/hailo8_fw.bin
|
2024-08-09 23:53:33 +02:00
|
|
|
|
|
|
|
# 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."
|