HELP Hailo PCIe Driver Installation and GPU Issues in WSL2

Hello Community,

I need help with installing the Hailo PCIe drivers and utilizing my GPU in WSL2. Despite several attempts, I have encountered various issues that I have been unable to resolve.

System Details:

  • OS: Windows 11
  • WSL2: Ubuntu 22.04.4 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)
  • GPU: NVIDIA GeForce RTX 4090
  • Docker Version: 24.0.7, build 24.0.7-0ubuntu2~22.04.1

Problems Encountered:

  1. Hailo PCIe Driver Installation:
  • I followed the instructions to install the Hailo PCIe driver package hailort-pcie-driver_4.18.0_all.deb.
  • Encountered errors related to missing Linux headers for WSL2 kernel (5.15.153.1-microsoft-standard-WSL2).
  • Attempted to link headers manually but the driver installation script continues to fail with the error: No rule to make target 'clean'. Stop.

Error Log:

mike@DESKTOP-GK4LOTR:/mnt/d/hailo$ sudo dpkg -i hailort-pcie-driver_4.18.0_all.deb
(Reading database ... 95306 files and directories currently installed.)
Preparing to unpack hailort-pcie-driver_4.18.0_all.deb ...
Could not test for SecureBoot, assuming SecureBoot is disabled on this machine.
Unpacking hailort-pcie-driver (4.18.0) ...
Setting up hailort-pcie-driver (4.18.0) ...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

ybuild-essential/jammy,now 12.9ubuntu3 amd64 [installed]
Do you wish to use DKMS? [Y/n]:
Failed. Exited with status 2. See /var/log/hailort-pcie-driver.deb.log
dpkg: error processing package hailort-pcie-driver (--install):
 installed hailort-pcie-driver package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 hailort-pcie-driver

Log File:

######### Wed Jul 31 21:26:42 CEST 2024 #########
/share/opt/hailo/linux/pcie /
make[1]: Entering directory '/usr/src/linux-headers-5.15.153.1-microsoft-standard-WSL2'
make[1]: *** No rule to make target 'clean'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-5.15.153.1-microsoft-standard-WSL2'
make: *** [Makefile:100: clean] Error 2
Failed. Exited with status 2. See /var/log/hailort-pcie-driver.deb.log
Failed at 40
   37   }
   38
   39   function compile_and_install_pcie_driver_with_dkms() {
   40       make clean &>> $LOG
   41       make install_dkms &>> $LOG || {
   42           echo "Failed to install PCIe driver to the DKMS tree. Trying to install PCIe driver without DKMS"
   43           compile_and_install_pcie_driver_without_dkms
  1. NVIDIA GPU Issues:
  • Successfully installed the NVIDIA drivers and Docker integration using nvidia-container-toolkit.
  • Verified GPU visibility with Docker using the nvidia/cuda:11.2.2-base image.
  • GPU is not being detected in Jupyter Notebook.

Steps Taken:

  • Downloaded and extracted WSL2 Linux kernel headers manually.
  • Linked the extracted headers to the expected location.
  • Installed nvidia-docker2 and verified GPU visibility with Docker.

Jupyter Notebook Issue:

When trying to optimize the model and test its accuracy, I received the following output indicating the absence of a GPU:

# The original images are being used, just as the input to the SDK_FP_OPTIMIZED emulator
calib_dataset = image_dataset

# For calling Optimize, use the short version: runner.optimize(calib_dataset)
# A more general approach is being used here that works also with multiple input nodes.
# The calibration dataset could also be a dictionary with the format:
# {input_layer_name_1_from_hn: layer_1_calib_dataset, input_layer_name_2_from_hn: layer_2_calib_dataset}
hn_layers = runner.get_hn_dict()["layers"]
print("Input layers are: ")
print([layer for layer in hn_layers if hn_layers[layer]["type"] == "input_layer"])  # See available input layer names
calib_dataset_dict = {"resnet_v1_18/input_layer1": calib_dataset}  # In our case there is only one input layer
runner.optimize(calib_dataset_dict)

Output:

Input layers are: 
['resnet_v1_18/input_layer1']
[info] Starting Model Optimization
[warning] Reducing optimization level to 0 (the accuracy won't be optimized and compression won't be used) because there's no available GPU
[warning] Running model optimization with zero level of optimization is not recommended for production use and might lead to suboptimal accuracy results
[info] Model received quantization params from the hn
[info] Starting Mixed Precision
[info] Mixed Precision is done (completion time is 00:00:00.20)
[info] Layer Norm Decomposition skipped
[info] Starting Stats Collector
[info] Using dataset with 64 entries for calibration
Calibration: 100%|█████████████████████████████████████████████████████████████████| 64/64 [00:39<00:00,  1.62entries/s]
[info] Stats Collector is done (completion time is 00:00:39.98)
[info] Starting Fix zp_comp Encoding
[info] Fix zp_comp Encoding is done (completion time is 00:00:00.00)
[info] matmul_equalization skipped
[info] Finetune encoding skipped
[info] Bias Correction skipped
[info] Adaround skipped
[info] Fine Tune skipped
[info] Layer Noise Analysis skipped
[info] Model Optimization is done

I am unable to successfully install the Hailo PCIe drivers and use the GPU in my Jupyter Notebook environment. I believe there might be underlying issues related to the Linux headers or the integration process that I might have missed.

I would greatly appreciate any guidance or troubleshooting steps you could provide to help resolve these issues.

Thank you for your support.

Best regards,
Mike

The Hailo PCIe driver is not supported under WSL2.

The Hailo Dataflow Compiler does not need the PCIe driver.

If you want to run inference under Windows you can install the HailoRT Windows installer. This will allow you to use HailoRT CLI under Windows and develop/run your own Windows applications.

May I ask why you try to use the Hailo Dataflow Compiler under WSL2?

My recommendation is to install the Hailo AI Software Suite docker under Ubuntu directly without WSL2. Even if your end application runs on Windows you could still do the model conversion under Linux.

Hi Klausk,

Thank you for you reply.

I must admit, I’m fairly new with this. I’m a little confused as i do not know what i need excactly, so i just tried anything.

To clarify a few things: I have the Hailo AI Kit for my Raspberry Pi and want to run a few things there. The PC is here to create models to run on the Pi Kit,

I now went ahead and created a Ubuntu system on a second drive and still run in some issues.

mike@mike-ubuntu:~/Downloads$ sudo dpkg -i hailort-pcie-driver_4.18.0_all.deb
Selecting previously unselected package hailort-pcie-driver.
(Reading database ... 175493 files and directories currently installed.)
Preparing to unpack hailort-pcie-driver_4.18.0_all.deb ...
Verifying secureboot is disabled.
Unpacking hailort-pcie-driver (4.18.0) ...
Setting up hailort-pcie-driver (4.18.0) ...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

build-essential/noble,now 12.10ubuntu1 amd64 [installed]
Do you wish to use DKMS? [Y/n]: 
Failed to install PCIe driver to the DKMS tree. Trying to install PCIe driver without DKMS
Failed. Exited with status 2. See /var/log/hailort-pcie-driver.deb.log
dpkg: error processing package hailort-pcie-driver (--install):
 installed hailort-pcie-driver package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 hailort-pcie-driver
mike@mike-ubuntu:~/Downloads$ 

I installed the “hailort_4.18.0_amd64.deb” but still. I run into errors trying to install the PCIe drivers.

> [info] System info: OS: Linux, Kernel: 6.6.32-linuxkit [info] Hailo DFC Version: 3.28.0 [info] HailoRT Version: 4.18.0 [info] PCIe: No Hailo PCIe device was found

And when i want to open the jypter notebook this occurs:

xdg-open: no method available for opening 'file:///home/hailo/.local/share/jupyter/runtime/nbserver-103-open.html'

At least i think my GPU is detected.

Thank you for you support.

Kindest Regards,
Mike

Hi Mike,

What is the content of /var/log/hailort-pcie-driver.deb.log ?

As Klaus mentioned in the previous post, you don’t need to install the Hailo-RT PCIe driver, nor the Hailo-RT driver if you just want to use the DFC to create models to on the Pi kit.

About the xdg-open error, it looks like the system cannot find a browser to open the html file. Can you install google chrome and see if it resolves the issue ?

Hi Victor,

I reinstalled Ubuntu and started fresh. I downloaded the CUDA and CUDNN and GPU drivers.

And now i run into these errors:

When run via Docker Desktop:

$ hailo tutorial
[info] Current Time: 14:16:10, 08/09/24
[info] CPU: Architecture: x86_64, Model: AMD Ryzen 7 5800X3D 8-Core Processor, Number Of Cores: 16, Utilization: 0.0%
[info] Memory: Total: 7GB, Available: 6GB
[info] System info: OS: Linux, Kernel: 6.6.32-linuxkit
[info] Hailo DFC Version: 3.28.0
[info] HailoRT Version: 4.18.0
[info] PCIe: No Hailo PCIe device was found
[info] Running `hailo tutorial`
[I 14:16:12.353 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:16:12.353 NotebookApp] Serving notebooks from local directory: /local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_tutorials/notebooks
[I 14:16:12.353 NotebookApp] Jupyter Notebook 6.5.2 is running at:
[I 14:16:12.353 NotebookApp] http://localhost:8889/?token=4acdf76dce56a58742daf9001ec8ff6b20f3fa038a262e69
[I 14:16:12.353 NotebookApp]  or http://127.0.0.1:8889/?token=4acdf76dce56a58742daf9001ec8ff6b20f3fa038a262e69
[I 14:16:12.353 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:16:12.396 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/hailo/.local/share/jupyter/runtime/nbserver-566-open.html
    Or copy and paste one of these URLs:
        http://localhost:8889/?token=4acdf76dce56a58742daf9001ec8ff6b20f3fa038a262e69
     or http://127.0.0.1:8889/?token=4acdf76dce56a58742daf9001ec8ff6b20f3fa038a262e69
Warning: program returned non-zero exit code #256
/usr/bin/xdg-open: 869: firefox: not found
/usr/bin/xdg-open: 869: iceweasel: not found
/usr/bin/xdg-open: 869: seamonkey: not found
/usr/bin/xdg-open: 869: mozilla: not found
/usr/bin/xdg-open: 869: epiphany: not found
/usr/bin/xdg-open: 869: konqueror: not found
/usr/bin/xdg-open: 869: chromium: not found
/usr/bin/xdg-open: 869: chromium-browser: not found
/usr/bin/xdg-open: 869: www-browser: not found
/usr/bin/xdg-open: 869: links2: not found
/usr/bin/xdg-open: 869: elinks: not found
/usr/bin/xdg-open: 869: links: not found
/usr/bin/xdg-open: 869: lynx: not found
/usr/bin/xdg-open: 869: w3m: not found
xdg-open: no method available for opening 'file:///home/hailo/.local/share/jupyter/runtime/nbserver-566-open.html'
^C[I 14:18:58.650 NotebookApp] interrupted
Serving notebooks from local directory: /local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_tutorials/notebooks
0 active kernels
Jupyter Notebook 6.5.2 is running at:
http://localhost:8889/?token=4acdf76dce56a58742daf9001ec8ff6b20f3fa038a262e69
 or http://127.0.0.1:8889/?token=4acdf76dce56a58742daf9001ec8ff6b20f3fa038a262e69
Shutdown this notebook server (y/[n])? Traceback (most recent call last):
  File "/local/workspace/hailo_virtualenv/bin/hailo", line 8, in <module>
    sys.exit(main())
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_sdk_client/tools/cmd_utils/main.py", line 111, in main
    ret_val = client_command_runner.run()
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_platform/tools/hailocli/main.py", line 64, in run
    return self._run(argv)
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_platform/tools/hailocli/main.py", line 104, in _run
    return args.func(args)
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_sdk_client/tools/tutorial_runner.py", line 41, in run
    return subprocess.run(
  File "/usr/lib/python3.8/subprocess.py", line 495, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.8/subprocess.py", line 1020, in communicate
    self.wait()
  File "/usr/lib/python3.8/subprocess.py", line 1083, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib/python3.8/subprocess.py", line 1806, in _wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib/python3.8/subprocess.py", line 1764, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt

$ 

When run via the Terminal:

mike@mike-Ubuntu:~/Downloads$ ./hailo_ai_sw_suite_docker_run.sh --resume
Resuming an old container 
hailo_ai_sw_suite_2024-07.1_container


Welcome to Hailo AI Software Suite Container
To list available commands, please type:

----------------------------------------------------

HailoRT:                hailortcli -h
Dataflow Compiler:      hailo -h
Hailo Model Zoo:        hailomz -h
TAPPAS:                 hailo_run_app -h

----------------------------------------------------


bash: /local/workspace/tappas/scripts/bash_completion.d/python-argcomplete: No such file or directory
(hailo_virtualenv) hailo@docker-desktop:/local/workspace$ hailo tutorial
[info] First time Hailo Dataflow Compiler is being used. Checking system requirements... (this might take a few seconds)
[Error] The SDK requires 16 GB of RAM (32 GB recommended), while this system has only 8 GB.
[Error] See full log: /local/workspace/.install_logs/hailo_installation_log_2024.08.09T14:12:16.log
[Info] No GPU connected.
Component   Requirement      Found
==========  ==========       ==========  ==========
OS          Ubuntu           Ubuntu      Required
Release     20.04            20.04       Required
Package     python3-tk       V           Required
Package     graphviz         V           Required
Package     libgraphviz-dev  V           Required
Package     python3.8-dev    V           Required
RAM(GB)     16               8           Required
RAM(GB)     32               8           Recommended
CPU-Arch    x86_64           x86_64      Required
CPU-flag    avx              V           Required
Var:CC      unset            unset       Required
Var:CXX     unset            unset       Required
Var:LD      unset            unset       Required
Var:AS      unset            unset       Required
Var:AR      unset            unset       Required
Var:LN      unset            unset       Required
Var:DUMP    unset            unset       Required
Var:CPY     unset            unset       Required
System requirements check failed (see table above for details). Continue? [Y/n][Info] No response - exitting.
[info] Current Time: 14:13:19, 08/09/24
[info] CPU: Architecture: x86_64, Model: AMD Ryzen 7 5800X3D 8-Core Processor, Number Of Cores: 16, Utilization: 0.0%
[info] Memory: Total: 7GB, Available: 6GB
[info] System info: OS: Linux, Kernel: 6.6.32-linuxkit
[info] Hailo DFC Version: 3.28.0
[info] HailoRT Version: 4.18.0
[info] PCIe: No Hailo PCIe device was found
[info] Running `hailo tutorial`
[I 14:13:21.207 NotebookApp] Serving notebooks from local directory: /local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_tutorials/notebooks
[I 14:13:21.207 NotebookApp] Jupyter Notebook 6.5.2 is running at:
[I 14:13:21.207 NotebookApp] http://localhost:8888/?token=52cded58824956156f116f7145cc4e46de4ff677abf7b8a8
[I 14:13:21.207 NotebookApp]  or http://127.0.0.1:8888/?token=52cded58824956156f116f7145cc4e46de4ff677abf7b8a8
[I 14:13:21.207 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:13:21.251 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/hailo/.local/share/jupyter/runtime/nbserver-182-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=52cded58824956156f116f7145cc4e46de4ff677abf7b8a8
     or http://127.0.0.1:8888/?token=52cded58824956156f116f7145cc4e46de4ff677abf7b8a8
Warning: program returned non-zero exit code #256
/usr/bin/xdg-open: 869: firefox: not found
/usr/bin/xdg-open: 869: iceweasel: not found
/usr/bin/xdg-open: 869: seamonkey: not found
/usr/bin/xdg-open: 869: mozilla: not found
/usr/bin/xdg-open: 869: epiphany: not found
/usr/bin/xdg-open: 869: konqueror: not found
/usr/bin/xdg-open: 869: chromium: not found
/usr/bin/xdg-open: 869: chromium-browser: not found
/usr/bin/xdg-open: 869: www-browser: not found
/usr/bin/xdg-open: 869: links2: not found
/usr/bin/xdg-open: 869: elinks: not found
/usr/bin/xdg-open: 869: links: not found
/usr/bin/xdg-open: 869: lynx: not found
/usr/bin/xdg-open: 869: w3m: not found
xdg-open: no method available for opening 'file:///home/hailo/.local/share/jupyter/runtime/nbserver-182-open.html'
^C[I 14:17:57.817 NotebookApp] interrupted
Serving notebooks from local directory: /local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_tutorials/notebooks
0 active kernels
Jupyter Notebook 6.5.2 is running at:
http://localhost:8888/?token=52cded58824956156f116f7145cc4e46de4ff677abf7b8a8
 or http://127.0.0.1:8888/?token=52cded58824956156f116f7145cc4e46de4ff677abf7b8a8
Shutdown this notebook server (y/[n])? Traceback (most recent call last):
  File "/local/workspace/hailo_virtualenv/bin/hailo", line 8, in <module>
    sys.exit(main())
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_sdk_client/tools/cmd_utils/main.py", line 111, in main
    ret_val = client_command_runner.run()
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_platform/tools/hailocli/main.py", line 64, in run
    return self._run(argv)
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_platform/tools/hailocli/main.py", line 104, in _run
    return args.func(args)
  File "/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_sdk_client/tools/tutorial_runner.py", line 41, in run
    return subprocess.run(
  File "/usr/lib/python3.8/subprocess.py", line 495, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.8/subprocess.py", line 1020, in communicate
    self.wait()
  File "/usr/lib/python3.8/subprocess.py", line 1083, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib/python3.8/subprocess.py", line 1806, in _wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib/python3.8/subprocess.py", line 1764, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt

(hailo_virtualenv) hailo@docker-desktop:/local/workspace$ 

Here the Browser:

mike@mike-Ubuntu:~/Downloads$ sudo update-alternatives --config x-www-browser
There are 2 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).

  Selection    Path                           Priority   Status
------------------------------------------------------------
  0            /usr/bin/google-chrome-stable   200       auto mode
* 1            /usr/bin/firefox                40        manual mode
  2            /usr/bin/google-chrome-stable   200       manual mode

Press <enter> to keep the current choice[*], or type selection number: 0
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
mike@mike-Ubuntu:~/Downloads$ 

I have no idea left what to do. I’m can’t get it to work even after 3 weeks of trying.
Let me know if you need more information…

Thank you in advance.
Mike

It appears that one issue is the amount of memory on your system. As the message indicates, the SDK requires at least 16 GB but your system has only 8 GB.

About the other issue with the browser, have you installed a X-server on Windows 11 ?
If not, please follow these instructions:

X-server installation

A Xserver must be installed in Windows so that any Ubuntu application that implement a GUI can show up on your display. These include your favorite browser such as Google Chrome, Tensorboard, etc . With a X-server installed, starting a Jupyter notebook will automatically launch a Ubuntu based internet browser. Without it, you would have to manually copy paste the notebook’s URL to a Windows based internet browser.

We recommend VxXsrv:

a) Download and install VxXsrv from: VcXsrv Windows X Server
When installing it, select the default options.

b) After installation, create a new desktop shortcut that points to C:\Program Files\VcXsrv\vcxsrv.exe and set the following command in the Target field of the shortcut’s properties: "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto

c) Double click on the shortcut to launch the X-server.

d) Optionally, add X-Server to Startup Program by using Window(KEY)+R, and then executing the following command:

shell:startup
Copy the shortcut created above into the Startup folder.

e) Start a WSL-Ubuntu terminal through the Windows start menu and edit the .bashrc file:
vim .bashrc
Press ‘i’ and add the following line:
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
Press ESC and then the key ‘:’ and type ‘wq’ to write the file and quit
Close the terminal and open a new one in order to execute .bashrc .

f) For testing, install terminator, which is a terminal emulator like xterm:
sudo apt-get install terminator
Test the xserver by launching a terminal window:
terminator &

If you get the following error:
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.InvalidFileContent: D-Bus library appears to be incorrectly set up: see the manual page for dbus-uuidgen to correct this issue. (Failed to open “/var/lib/dbus/machine-id”: No such file or directory; UUID file ‘/etc/machine-id’ should contain a hex string of length 32, not length 0, with no other text)

Run the command:

sudo dbus-uuidgen --ensure