Tech/linux

Hailo AI pci driver 빌드

kwangson 2024. 7. 10. 16:45

요즘 AI 매우 중요해지면서 SoC에서 지원하지 않고 PCI형태의 AI 가속기들이 나오고 있다.

 

그중 Hailo-8 가 많이 사용되는 듯 하다.

https://hailo.ai/products/ai-accelerators/hailo-8-ai-accelerator/

 

AI Processor Hailo-8 For Edge Devices | Up to 26 Tops Hardware

The Hailo-8 AI processor, with 26 TOPS hardware, surpasses other GPUs for machine learning. With unmatched efficiency in a penny-sized space.

hailo.ai

 

드라이버 코드가 open 되어 있지만, 아쉽게도 upstream형태는 아니다.

드라이버 모듈을 직접 빌드 후 dkms로 유지하는 방식이다.

 

빌드 방법은 최신 버전 기준

1. 모듈 빌드를 위해 kernel header를 설치해준다. $ apt install linux-headers-$(uname -r)

2. https://github.com/hailo-ai/hailort-drivers 을 다운받는다.

3. firmware download script를 다운 받아서 firmware 위치에 옮겨준다.

4. $ cd linux/pcie 후 make로 빌드 & dkms 인스톨을 해준다.

 

upstream 드라이버가 아니고, 사실 상 firmware에 매우 의존적이다. 따라서 어떤 문제가 생길지 알수 없다.

그리고 firmware버전과 userspace app (hailortcli?) 의 버전이 동일해야한다.