intel / intel-npu-acceleration-library

Intel® NPU Acceleration Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this library work with wsl2?

tackgeun opened this issue · comments

Does this library work on WSL2?

I'm using NPU (Intel AI Boost) in Core Ultra 7 155H with window driver version 31.0.100.1776

I've tried to use this library on WSL2.
I follow the example in README page.
But, I see the warning message that the library cannot find the NPU.
It said
"$MY_HOME/anaconda3/envs/npu/lib/python3.8/site-packages/intel_npu_acceleration_library/nn/autograd.py:6: UserWarning: NPU is not available in your system. Library will fallback to AUTO device selection mode."

Do I need to set-up a linux driver for NPU (https://github.com/intel/linux-npu-driver) within WSL2? But, it also does not work.

Thank you in advance.

What I found is the current version of WSL2 is not equipped with intel NPU kernel driver, which should be located in the directory $ROOT/drivers/accel/ivpu/.
I found that NPU kernel driver is within the linux kernel starting from v6.3. But the latest WSL2 version is v6.1.

Until the WSL support higher version of linux kernel, I think we need custom WSL kernel for running NPU.

This repo provides rolling WSL2 kernel.

(Updated Apr 4th)
I start WSL2 with a custom kernel NPU driver (intel_vpu.so).
After prompting "sudo modprobe intel_vpu", there is any error message. However, I can not see any sign of loaded kernel driver in WSL2. I guess that I failed to load the kernel driver. I follow the description in driver repository (https://github.com/intel/linux-npu-driver).
I will update if there are new observations.

Good question, I'll check with our linux driver team

@tackgeun WLS is not supported atm but the team is working on it

I also was wanting to use WSL and it seems there is a cmake error when trying to build on WSL Ubuntu 22.04. Any progress here?

I also was wanting to use WSL and it seems there is a cmake error when trying to build on WSL Ubuntu 22.04. Any progress here?

I tried now with current main and I was able to compile it. Just be aware that in order to build the python wheel, you need libtbb-dev, cmake and a compiler (build-essential should work). I'm not aware that WSL is supported at driver level, so even if you are able to install the library, if the driver is not available it will fallback to another device in the system (usually CPU). Here for example I run a simple example and the library warns that UserWarning: NPU is not available in your system. Library will fallback to AUTO device selection mode

image

Double checked with driver team and WSL driver is not supported yet