Настройка и пример работы LLM на встроенном NPU мини-компьютера с Intel Core Ultra 5 226V
Подопытный - мини-ПК Ninkear L20 на Intel Core Ultra 5 226V с 16 ГБ памяти. В статье будет установка и настройка OpenVINO, запуск Qwen3-8B на NPU, замеры скорости и мощности по счётчикам самого процессора и сравнение с дорогой видеокартой RTX 5070 Ti. Плюс практическая часть: обработка фотографий, 3D-рельеф из фото, озвучка книг TTS, Blender и печатная плата. Всё работает локально, без утечек данных в интернет и без оплаты подписок.
В новых процессорах Intel Core Ultra появился третий вычислитель - нейронный процессор, NPU. Маркетинг обещает «ИИ-компьютер», но живых примеров обычно два: размытие фона в видеозвонке и Copilot. Мне стало интересно другое. Можно ли запустить на NPU настоящую языковую модель (LLM), сколько она выдаёт токенов в секунду и сколько при этом потребляет? Также мне интересно, что же получится, если загрузить сразу все три блока процессора: NPU, встроенную графику и обычные ядра. Постараюсь разобраться и подробно все рассказать.
Начну с писания этого мини-ПК. Ninkear L20 построен на Intel Core Ultra 5 226V (Lunar Lake) с 16 ГБ памяти LPDDR5X-8533 на корпусе процессора. Рабочий диапазон мощности 17-37 Вт. Внутри три разных вычислителя:
CPU на 8 ядер (4 производительных + 4 энергоэффективных). Универсален, но на нейросетях медленный: мало параллельных блоков, высокая частота, высокое энергопотребление на операцию.
iGPU Intel Arc 130V (в терминах Intel и PyTorch XPU, в OpenVINO это GPU). Архитектура Xe2, сотни параллельных вычислителей, аппаратное умножение матриц. Самый быстрый блок для крупных нейросетей: языковых моделей, Stable Diffusion, длинных промптов.
NPU Intel AI Boost четвёртого поколения, по данным Intel до 40 TOPS. Узкий специалист: умножение матриц в INT8 и FP16 на низкой частоте и при малом напряжении. Не умеет динамические формы данных, требует долгой первой компиляции, поддерживает не все операции.
У всех трёх блоков общая оперативная память: своей видеопамяти у графики нет, своего ОЗУ у NPU тоже. Модель не нужно копировать между устройствами, но шина памяти одна на всех. При одновременной работе это видно. Чем NPU отличается от Arc 130V на практике.
Графика быстрее на языковой модели вдвое. NPU выигрывает, когда задача длинная, нагрузка неполная и важны тишина и ватты:
Фоновая обработка (поток с камеры, пакет фотографий, пересказ документов) на NPU добавляет к простою 1-2 Вт (огромная разница по потреблению, если смотреть ту же RTX 5070 Ti, подходит для случаев, когда нужно не срочно).
Графика и процессор свободны для основной работы, будь то Blender, браузер или сборка проекта.
NPU загружен на 99%, процессор 7%, графика 2%: остальная система свободна
Вентилятор не раскручивается: шум остаётся на уровне простоя, 22-24 дБ, тогда как с графикой и процессором 33-34 дБ (для меня также критично - шум не раздражает).
Шум L20 при разной нагрузке (замер шумомером): NPU не отличается от простоя
NPU, графика и процессор в цифрах
Для сравнения я взял одну и ту же языковую модель Qwen3-8B в 4-битном сжатии (OpenVINO GenAI 2026.4). Запрос - 77 токенов, ответ - 256, жадная генерация, засчитывается второй прогон. Мощность - среднее по счётчику RAPL всего кристалла (CPU + GPU + NPU + контроллер памяти) за время генерации.
Скорость генерации на трёх вычислительных устройствах
Qwen3-8B INT4
NPU
GPU Arc 130V
CPU
Генерация, ток/с
10,7
21,2
10,0
Первый токен, с
1,7
0,17
0,46
Чтение промпта 1329 токенов, ток/с
360
1171
30
Мощность кристалла, Вт
15,4
20,6
16,0
Энергия на токен, Дж
1,52
1,01
1,64
Скажу прямо: Arc 130V быстрее NPU вдвое и даже тратит меньше энергии на токен 1,01 Дж против 1,52. Графика потребляет на треть больше мощности, но заканчивает работу вдвое быстрее.
Мощность кристалла по времени: NPU, GPU, CPU и все три блока сразу
Процессор по скорости генерации равен NPU, но читает длинный промпт в 12 раз медленнее и тратит больше всех. Привел данные в график к 1 токену и добавил для сравнения RTX 5070 Ti. Обратите внимание - подобный мини-ПК оказывается практически в 2-3 раза экономичнее, чем компьютер с полноценной дискретной видеокартой.
Энергия на один токен: L20 и оценка для RTX 5070 Ti
Как это выглядит на большой задаче, например, «написать 10 000 токенов» (15-20 страниц текста). NPU делает её за 15,6 минуты и 4,2 Вт·ч, графика - за 7,9 минуты и 2,8 Втч. Разница в энергии 1,4 Втч, меньше заряда одного телефона. На неполной нагрузке NPU на треть экономичнее графики и в 4-10 раз экономичнее процессора. Специально делаю акцент - если задача не срочная, NPU позволяет отдать её в фон и не занимать графику. Обычно я ставлю пакетную обработку фото или генерацию моделей через LLM и оставляю его работать.
Одна задача на трёх устройствах: время и энергия
Где NPU выигрывает: параллельная работа. Если две нейросети запустить на одной графике, каждая работает вдвое медленнее. Если языковую модель перенести на NPU, нейросеть на графике сохраняет 92% своей скорости. А все три блока одновременно потребляют 27,5 Вт.
Все три блока заняты: NPU 75%, графика 92%, процессор 62%
Настройка OpenVINO
Пара слов про настройку. Работает такая связка на базе OpenVINO - это открытый набор инструментов Intel для запуска нейросетей на CPU, GPU и NPU. Модель хранится в формате IR (.xml граф, .bin веса). Для каждого устройства есть плагин: он компилирует граф под конкретное железо. Для работы потребуется настроить драйверы (речь про NPU драйвер) и установить связку OpenVINO+Python и что еще требуется. NPU виден в Диспетчере устройств в разделе «Нейронные процессоры» как Intel(R) AI Boost. Драйверы NPU и графики берутся с сайта Intel (Intel Driver & Support Assistant ставит оба). У меня: NPU 32.0.100.5540, графика 32.0.101.8331. Со старым драйвером NPU многие модели не компилируются - это первое, что стоит обновить. Потребуется Python 3.12 с python.org. На каждый проект - своё виртуальное окружение, чтобы зависимости разных программ не конфликтовали:
python -m venv C:\AI\npu\venv
C:\AI\npu\venv\Scripts\activate
pip install openvino openvino-genai nncf huggingface_hubsourcecraft.dev
Здесь: openvino - среда выполнения, openvino-genai - готовые конвейеры для языковых моделей, Stable Diffusion и распознавания речи, nncf - сжатие моделей в INT8/INT4, huggingface_hub - скачивание моделей (команда hf).
Дальше - проверка устройств и свойств NPU.
python -c "import openvino as ov; c=ov.Core(); print(c.available_devices); print(c.get_property('NPU','FULL_DEVICE_NAME'), c.get_property('NPU','NPU_DRIVER_VERSION'))"sourcecraft.dev
OpenVINO видит CPU, GPU и NPU
Выбор устройства в коде. Общего переключателя в системе нет: устройство задаёт программа. Варианты:
CPU, GPU, NPU - конкретное устройство. Две видеокарты Intel получают имена GPU.0 и GPU.1;
AUTO - OpenVINO выбирает сам;
HETERO:NPU,CPU - неподдерживаемые NPU операции уходят на процессор.
import openvino as ov
core = ov.Core()
model = core.read_model("model.xml")
compiled = core.compile_model(model, "NPU", {"CACHE_DIR": r"C:\AI\ov_cache", "PERFORMANCE_HINT": "LATENCY"})
result = compiled(input_tensor)[0]sourcecraft.dev
Здесь: PERFORMANCE_HINT задаёт стратегию: LATENCY - один запрос как можно быстрее, THROUGHPUT - максимум кадров в секунду через несколько параллельных запросов. Тест NPU на 99% выше сделан именно с THROUGHPUT и очередью из 8 запросов.
Настройка LLM модели для работы с NPU
Первая компиляция для NPU долгая: Qwen3-8B - 97 секунд, Depth Anything - 30-40 секунд, ESRGAN - 12 минут. С CACHE_DIR скомпилированная модель сохраняется на диск, и следующий запуск занимает секунды (Qwen3-8B 14,6 с). Дальше отмечу, что NPU принимает только фиксированный размер входа. Для картинок модель экспортируют сразу под нужное разрешение (например, 1×3×518×518) или вызывают model.reshape(...) перед компиляцией. Для языковых моделей это делает OpenVINO GenAI: достаточно задать максимальную длину промпта и ответа (см. ниже). Готовые модели для NPU лежат на Hugging Face в коллекции OpenVINO. Для NPU нужны варианты -int4-cw-ov: веса в 4 бита, симметрично, одним масштабом на канал. Свою модель в этом формате можно собрать инструментом optimum-cli (пакет optimum-intel):
optimum-cli export openvino -m Qwen/Qwen3-4B --weight-format int4 --sym --group-size -1 --ratio 1.0 Qwen3-4B-int4-cw-ovsourcecraft.dev
Я пользовался готовыми моделями, эту команду привожу для полноты. Продолжаю настройку:
hf download OpenVINO/Qwen3-8B-int4-cw-ov --local-dir C:\AI\models\Qwen3-8B-int4-cw-ov
import openvino_genai as og
pipe = og.LLMPipeline(r"C:\AI\models\Qwen3-8B-int4-cw-ov", "NPU",
CACHE_DIR=r"C:\AI\ov_cache", MAX_PROMPT_LEN=2048, MIN_RESPONSE_LEN=512)
cfg = og.GenerationConfig(); cfg.max_new_tokens = 400
print(pipe.generate("Перескажи текст в пяти пунктах: ... /no_think", cfg))sourcecraft.dev
MAX_PROMPT_LEN и MIN_RESPONSE_LEN нужны только NPU: под эти размеры GenAI «нарезает» модель. Приписка /no_think выключает у Qwen3 режим размышлений. Для удобства я сделал окно чата с выбором устройства, в котором видны скорость и мощность:
Qwen3-8B на NPU: 1,8 с до первого токена, 15,8 ток/с, кристалл 17,3 Вт
Во время генерации NPU загружен примерно на две трети: языковая модель упирается в скорость памяти.
Загрузка NPU во время теста
Синтез речи Qwen3-TTS на NPU
Qwen3-TTS - синтез речи на основе языковой модели (1,7 млрд параметров), с встроенными голосами и клонированием голоса по образцу. У Intel есть официальный пример запуска Qwen3-TTS в OpenVINO (ноутбук qwen3-tts в репозитории openvino_notebooks). Я взял из него конвертер и конвейер. Для Qwen3-TTS нужен PyTorch для конвертации, нужно настроить дополнительное окружение:
python -m venv C:\AI\tts\venv
C:\AI\tts\venv\Scripts\activate
pip install torch==2.8.0 torchaudio==2.8.0 --index-url download.pytorch.org
pip install qwen-tts==0.1.1 openvino nncf soundfile
git clone --depth 1 openvinotoolkit/openvino_notebooks
hf download Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice --local-dir C:\AI\models\Qwen3-TTS-1.7B-CustomVoice
hf download Qwen/Qwen3-TTS-12Hz-1.7B-Base --local-dir C:\AI\models\Qwen3-TTS-1.7B-Basesourcecraft.dev
CustomVoice - модель со встроенными голосами, Base - для клонирования голоса по образцу. Каждая весит около 4,2 ГБ. Конвертация в IR - функцией из примера Intel, около 3 минут на модель:
cd openvino_notebooks\notebooks\qwen3-tts
python -c "from qwen_3_tts_helper import convert_qwen3_tts_model as c; c(r'C:\AI\models\Qwen3-TTS-1.7B-CustomVoice', r'C:\AI\models\Qwen3-TTS-CV-OV')"sourcecraft.dev
Процесс запуска генерации:
from qwen_3_tts_helper import OVQwen3TTSModel
import soundfile as sf
tts = OVQwen3TTSModel.from_pretrained(r"C:\AI\models\Qwen3-TTS-CV-OV", device="GPU")
wavs, sr = tts.generate_custom_voice(text="Глава первая. ...", speaker="aiden", language="Russian",
temperature=0.9, top_k=50, repetition_penalty=1.05, max_new_tokens=2048)
sf.write("chapter1.wav", wavs[0], sr)sourcecraft.dev
Параметры по умолчанию модели: temperature 0,9, top_k 50, repetition_penalty 1,05. За один проход модель озвучивает до 8192 токенов (около 11 минут звука), поэтому книгу я режу на куски около 1500 символов по абзацам и склеиваю результат. Пример Intel официально исключает NPU, и проверка это подтвердила. Основная часть модели (talker) и вокодер имеют динамические формы и KV-кэш, их компилятор NPU не принимает. Но в модели есть «предсказатель кодов» (code predictor), который вызывается 15 раз на каждый кадр звука. Я переэкспортировал его в статическую форму без состояния (вход 1×16×2048), и он заработал на NPU с тем же результатом, что в PyTorch.
Программа озвучки: основная модель на графике, предсказатель кодов на NPU
Qwen3-TTS 1.7B
RTF
Всё на графике (статический предсказатель)
1,73
Графика + предсказатель на NPU
2,0-2,1
Процессор + предсказатель на NPU
6,7
Всё на процессоре
8,8-9,9
RTF во сколько раз генерация дольше звука. Самый быстрый вариант - это графика ARC 130V. Вариант «процессор + NPU» в полтора раза быстрее чистого процессора и не трогает графику вовсе - удобно для озвучки книги ночью, пока компьютер занят чем-то ещё. Разборчивость проверялась распознаванием речи Whisper: 95-100% слов во всех вариантах.
GIMP и нейросети OpenVINO
Intel выпускает бесплатный набор плагинов для GIMP 3: увеличение разрешения, сегментация, Stable Diffusion (генерация и инпейнтинг) и FastSD. Устройство выбирается в окне плагина. Установка подобным образом:
winget install --id GIMP.GIMP.3 --version 3.0.8.2 --scope user
mkdir C:\AI\GIMP_OpenVINO
cd C:\AI\GIMP_OpenVINO
git clone --branch 3.3.0 intel/openvino-ai-plugins-gimp
openvino-ai-plugins-gimp\install.bat
gimpenv3\Scripts\python.exe -m pip install "optimum-intel==2.0.0"
gimpenv3\Scripts\python.exe openvino-ai-plugins-gimp\model_setup.pysourcecraft.dev
Версию GIMP я взял 3.0.x: на ней Intel проверяет плагины. install.bat создаёт для плагинов отдельное окружение gimpenv3 и копирует их в %APPDATA%\GIMP\3.0\plug-ins. model_setup.py - меню загрузки моделей Stable Diffusion. Super Resolution и сегментация входят в комплект. Модели инпейнтинга меню скачивает целым репозиторием (14 и 19 ГБ) и конвертирует сам. Я поступил экономнее: скачал только FP16-веса и сконвертировал той же командой, что вызывает плагин, положив результат в его папку моделей:
hf download stable-diffusion-v1-5/stable-diffusion-inpainting --include ".json" ".txt" "*fp16.safetensors"
gimpenv3\Scripts\optimum-cli export openvino --model <папка_скачанной_модели> --variant fp16 --weight-format fp16 --task image-to-image %USERPROFILE%\openvino-ai-plugins-gimp\weights\stable-diffusion-ov\stable-diffusion-1.5\inpaintingsourcecraft.dev
Для SDXL - то же с репозиторием diffusers/stable-diffusion-xl-1.0-inpainting-0.1 и папкой stable-diffusion-xl\inpainting.
Слой → OpenVINO-AI-Plugins: четыре плагина
Нюанс: плагины работают только в интерактивном режиме. Из пакетного режима GIMP они ничего не делают.
Устройство выбирается списком: CPU, GPU, NPU
Тест апскейлинга 741×500 → 1482×1000 пх.
Super Resolution на NPU, результат - новым слоем
Модель
CPU
GPU
NPU
Super Resolution sr_1033
151 мс
32 мс
46 мс
Super Resolution ESRGAN ×4
64 с
1,0 с
1,2 с
Сегментация deeplabv3
200 мс
7,6 мс
19,5 мс
Сегментация sseg-adas-0001
491 мс
31 мс
неверный результат
SD 1.5 Inpainting, 512×512, 20 шагов
284 с
25 с
не компилируется
SDXL Inpainting, 1024×1024, 20 шагов
-
107 с
не компилируется
Для NPU в GIMP подходят Super Resolution и сегментация deeplabv3. Модель sseg-adas-0001 на NPU работает без ошибок, но результат неверный: с процессором совпадают 2,3% пикселей. Stable Diffusion - только на графике, в режиме Power Mode - Best performance. Так что для тяжелых генераций имеет смысл подключить eGPU (но это уже отдельная история).
3D-рельеф из фото: Depth Anything на NPU
Depth Anything V2 строит карту глубины по одному фото. Из неё моя программа Depth & Relief Studio делает рельеф с основанием и рамкой и экспортирует STL для 3D-печати. Это идеальная задача для NPU: модель картиночная, размер входа фиксированный, а пакет из сотни фотографий можно поставить в фон. Настройка конвертации модели в IR под NPU (окружение с torch и transformers):
import torch, openvino as ov
from transformers import AutoModelForDepthEstimation
class DepthOnly(torch.nn.Module):
def init(self, m):
super().init()
self.m = m
def forward(self, x):
return self.m(pixel_values=x).predicted_depth
m = AutoModelForDepthEstimation.from_pretrained("depth-anything/Depth-Anything-V2-Small-hf").eval()
with torch.no_grad():
ovm = ov.convert_model(DepthOnly(m), example_input=torch.zeros(1, 3, 518, 518), input=[1, 3, 518, 518])
ov.save_model(ovm, "small_fp16_518/model.xml", compress_to_fp16=True)sourcecraft.dev
Фиксированный вход 518×518 (кратно 14 - размеру патча ViT) сразу делает модель пригодной для NPU. Сжатие в INT8 инструментом NNCF, без переобучения. Для калибровки хватило восьми моих фото рельефов, размноженных отражениями и кадрированиями до 88 примеров. tensors - список этих примеров, подготовленных так же, как для инференса: размер 518×518, нормализация ImageNet, массив 1×3×518×518:
import nncf
q = nncf.quantize(ov.Core().read_model("small_fp16_518/model.xml"), nncf.Dataset(tensors),
model_type=nncf.ModelType.TRANSFORMER, subset_size=len(tensors))
ov.save_model(q, "small_int8_518/model.xml")sourcecraft.dev
FP16 против INT8 на восьми фото рельефов: время, энергия на кадр и точность
Depth Anything V2 Small
CPU
GPU
NPU
FP16, мс на кадр
659
18,1
28,0
INT8, мс на кадр
336
18,1
23,6
INT8, Дж на кадр
3,58
0,31
0,36
INT8, отличие от FP16 (рельеф 5 мм)
0,063 мм
0,065 мм
0,062 мм
INT8 уменьшает модель с 47 до 24 МБ, ускоряет NPU на 16% и процессор вдвое. Отличие от FP16 - в среднем 0,06 мм на рельефе высотой 5 мм, меньше слоя FDM-печати.
Фото, FP16 и INT8 на NPU, разница (усилена в 5 раз)
Разница собрана по резким контурам, а не по всей поверхности:
Depth & Relief Studio: модель INT8, устройство NPU, карта высот парусника
Рельеф Парусник 90 × 120 мм, STL прошёл проверку на замкнутость, можно отправлять на принтер для FDM печати.
Парусник на основании со скруглёнными углами под фрезеровку и 3D печать
Такой сценарий работы «поставить и забыть» удобен, особенно если в очереди много файлов для обработки: в программе есть пакетный режим (папка с фото → папка с картами глубины). На NPU в INT8 он идёт в фоне на 24 мс и 0,36 Дж на кадр, вентилятор при этом не слышно, а графика свободна для Blender или слайсера.
Сравнение с Tesla V100 и флагманскими видеокартами
Я не так давно рассказывал про приобретение Tesla V100 (и в качестве eGPU, и для домашнего ИИ-сервера). Для сравнения вот такой график. Указываю паспортную мощность видеокарт (реально могут быть другие цифры, нужно также прогонять на тестах для более детального сравнения), рядом с измеренной мощностью кристалла L20:
Tesla V100 - 250 Вт (PCIe) или 300 Вт (SXM2), RTX 5070 Ti - 300 Вт, RTX 4090 - 450 Вт, RTX 5090 - 575 Вт. И это одна карта, без процессора, памяти и блока питания.
L20 на языковой модели потребляет 15-21 Вт на кристалл, все три блока сразу - 27,5 Вт, фоновая задача на NPU - плюс 2 Вт к простою.
Выводы
NPU медленный. Языковая модель на нём работает вдвое медленнее, чем на Arc 130V, и тратит на токен даже больше энергии. Если результат нужен сейчас - считайте на графике.
NPU экономный в фоне. На неполной нагрузке он добавляет к простою 1-2 Вт - это на треть меньше графики и в 4-10 раз меньше процессора.
NPU почти не шумит. При работе нейросети на NPU шум L20 остаётся на уровне простоя (22-24 дБ). С графикой и процессором - 33-34 дБ.
NPU работает параллельно. Отдав ему одну нейросеть, вы сохраняете графику и процессор: задача на графике теряет всего 8% скорости.
Не всё запускается на NPU. Stable Diffusion, основная часть Qwen3-TTS и модели с динамическими формами не компилируются. Некоторые модели (sseg-adas-0001) дают неверный результат без ошибок - проверяйте на эталоне.
Кэш и статические формы - обязательны. Без CACHE_DIR каждый запуск начинается с минутной компиляции.
INT8 для картиночных моделей - да. Depth Anything в INT8 на NPU быстрее на 16%, вдвое меньше и почти не отличается от FP16.
Итог простой: NPU в L20 - не ускоритель «для скорости», а тихий экономичный помощник. Подходящий вариант, чтобы поставить задачу и забыть, если результат не нужен срочно: пересказ документов, пакетная обработка фото в рельефы, озвучка книги в связке с процессором. Мини-ПК при этом не слышно, а графика и процессор свободны для основной работы.
А какие фоновые задачи вы бы отдали NPU на своём компьютере?
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat)
Hey everyone,
Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs (like the XPS 14 and 13 that DHH likes to rave about). So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required.
It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino)
You can check out the umbrella project here: vinopilot.ca
Below is an explanation of all the different projects I've worked on, with further details on implementation.
VinoWhisper - Live Captioning (vinowhisper.com)
This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones.
VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca)
This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use.
Ovfetch - Runtime consistency (crates.io)
This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem.
This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus
VinoOpenEffects - Camera Effects
This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here!
VinoSearch - Semantic Search for Text, Images, Documents
This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge!
VinoPop - Click to Do/PopClip for Linux
This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline!
VinoWatch - Performance Monitoring
This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right.
PRs and feedback welcome!
5 points · 1 comment
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat)
**Disclaimer: AI was used extensively in the development of these applications, but these applications run entirely offline on the Intel Linux NPUs. I work as a professional software engineer**
Hey everyone,
Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required.
It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino)
You can check out the umbrella project here: vinopilot.ca
Below is an explanation of all the different projects I've worked on, with further details on implementation.
VinoWhisper - Live Captioning (vinowhisper.com)
This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones.
VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca)
This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use.
Ovfetch - Runtime consistency (crates.io)
This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem.
This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus
VinoOpenEffects - Camera Effects
This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here!
VinoSearch - Semantic Search for Text, Images, Documents
This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge!
VinoPop - Click to Do/PopClip for Linux
This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline!
VinoWatch - Performance Monitoring
This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right.
PRs and feedback welcome!
8 points
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat)
**Disclaimer: AI was used extensively in the development of these applications, but these applications run entirely offline on the Intel Linux NPUs. I work as a professional software engineer**
Hey everyone,
Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required.
It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino)
You can check out the umbrella project here: vinopilot.ca
Below is an explanation of all the different projects I've worked on, with further details on implementation.
VinoWhisper - Live Captioning (vinowhisper.com)
This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones.
VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca)
This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use.
Ovfetch - Runtime consistency (crates.io)
This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem.
This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus
VinoOpenEffects - Camera Effects
This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here!
VinoSearch - Semantic Search for Text, Images, Documents
This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge!
VinoPop - Click to Do/PopClip for Linux
This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline!
VinoWatch - Performance Monitoring
This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right.
PRs and feedback welcome!
1 point
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat)
**Disclaimer: AI was used extensively in the development of these applications, but these applications run entirely offline on the Intel Linux NPUs. I work as a professional software engineer**
Hey everyone,
Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required.
It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino)
You can check out the umbrella project here: vinopilot.ca
Below is an explanation of all the different projects I've worked on, with further details on implementation.
VinoWhisper - Live Captioning (vinowhisper.com)
This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones.
VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca)
This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use.
Ovfetch - Runtime consistency (crates.io)
This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem.
This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus
VinoOpenEffects - Camera Effects
This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here!
VinoSearch - Semantic Search for Text, Images, Documents
This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge!
VinoPop - Click to Do/PopClip for Linux
This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline!
VinoWatch - Performance Monitoring
This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right.
PRs and feedback welcome!
1 point
I've ported over (almost) all the useful Windows "Copilot+" features to Linux. All of them run offline, on any recent Intel CPU with a decent NPU.
Hey everyone,
Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required.
It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino)
You can check out the initiative here: vinopilot.ca
All work was assisted by Claude Opus and Sonnet. Below is an explanation of all the different projects I've worked on, with further details on implementation
VinoWhisper - Live Captioning (vinowhisper.com)
This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries, so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones.
VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca)
This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use.
Ovfetch - Runtime consistency (crates.io)
This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem.
This is more of a "plumbing" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus
VinoOpenEffects - Camera Effects
This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here!
VinoSearch - Semantic Search for Text, Images, Documents
This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge!
VinoPop - Click to Do/PopClip for Linux
This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4. I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPU the most, so if you are using this, bear in mind its going to be much slower than the Cloud, but it works offline!
VinoWatch - Performance Monitoring
This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right.
PRs and feedback welcome!
2 points · 3 comments
Intel Meteor Lake の NPU を Proxmox コンテナにパススルーして使ってみた ― embeddings は CPU 比 2.4 倍、LLM 生成は遅かった
はじめに
「AI PC」世代の CPU には NPU(Neural Processing Unit)が載っています。手元のミニ PC(Beelink GTi14 Ultra / Intel Core Ultra 7 155H = Meteor Lake)にも Intel AI Boost NPU が搭載されているのですが、Proxmox 上のコンテナからは見えていませんでした。
本記事では NPU を非特権 LXC コンテナにパススルーし、次の用途で実際に計測した結果を共有します。
- A. embeddings(RAG のベクトル化)
- B. 音声認識(Whisper)
- C. NPU と内蔵GPU の同時実行
- (参考)LLM 生成
結論を先に言うと、Meteor Lake の NPU は「embeddings」と「音声認識」では CPU より明確に速く、LLM のトークン生成では内蔵GPU に大きく負ける、という結果でした。
> 関連記事:同じマシンの内蔵GPU で Ollama / llama.cpp(Vulkan・SYCL・OpenVINO) / OVMS を比較した記事も書いています。本記事はその「NPU編」です。
TL;DR
| 用途 | NPU の結果 | CPU 比 |
|---|---|---|
| embeddings (bge-small) | 126.9 texts/s (7.9 ms/text) | 約 2.4 倍 |
| Whisper (base, 20秒音声) | 0.42s (RTF 0.021) | 約 1.5 倍 |
| LLM 生成 (1.2B) | 9.5 tok/s | GPU の 1/4〜1/5 |
| NPU + GPU 同時 | 合計 +10%(コンテンション) | — |
NPU の実用的な使い道は embeddings と音声認識でした。
検証環境
| 項目 | 内容 |
|---|---|
| マシン | Beelink GTi14 Ultra(DMI: AZW GTi14) |
| SoC | Intel Core Ultra 7 155H(Meteor Lake, 6P+8E+2LP-E = 16C/22T) |
| NPU | Intel AI Boost(NPU 3720, PCI 8086:7d1d) |
| 内蔵GPU | Intel Arc Graphics(8 Xeコア) |
| ホスト | Proxmox VE(カーネル 7.x-pve) |
| ゲスト | 非特権 LXC(Ubuntu 24.04.4 LTS, 20GB RAM, 22 vCPU) |
| コンテナ | Docker(LXC 内でネスト実行) |
NPU の位置づけ
| ユニット | 概算性能 |
|---|---|
| NPU (AI Boost) | 約 11 TOPS |
| 内蔵GPU (Arc 8 Xe) | 約 18 TOPS |
| CPU (22 スレッド) | 約 5 TOPS |
NPU は 生のスループットでは内蔵GPU より非力です。売りは低消費電力(Intel の資料では GPU の半分以下の消費電力)で、「GPU が別作業で埋まっている間の常時 AI」に向きます。
1. NPU を LXC にパススルーする
ハマりどころ①:手動の lxc.* では動かない
最初、よくある手順で lxc.cgroup2.devices.allow と lxc.mount.entry を手書きしたところ、デバイスノードは見えるのに root でも開けない(Permission denied)状態になりました。デバイスの所有者が nobody:nogroup になり、デバイス cgroup に反映されていなかったためです。
正解は、Proxmox の dev[n]: ショートカットを使うこと。/dev/dri のパススルーと同じ仕組みで、ノード生成と cgroup 許可をまとめて面倒見てくれます。
# /etc/pve/lxc/<CTID>.conf
dev0: /dev/dri/renderD128
dev1: /dev/dri/card0
dev2: /dev/accel/accel0 # ← NPU を追加(これだけ)
ハマりどころ②:非特権 LXC は自作 mknod 不可
非特権 LXC では mknod が Operation not permitted で弾かれます。デバイスノードを自分で作ることはできないので、必ずホスト側の設定変更が必要です。
手順
# ホスト(Proxmox)で
ls -l /dev/accel/accel0 # 存在確認(261:0)
# /etc/pve/lxc/<CTID>.conf に dev2: /dev/accel/accel0 を追記
pct snapshot <CTID> pre-npu # 念のためスナップショット
pct reboot <CTID>
再起動後、ゲストで /dev/accel/accel0 が root:root で見え、開けるようになります。
ls -l /dev/accel/accel0 # crw-rw---- root root 261, 0
head -c0 /dev/accel/accel0 && echo OPEN_OK
ハマりどころ③:NPU ドライバ(ユーザ空間)が必要
カーネル側は intel_vpu がロード済みでも、ユーザ空間の Level Zero NPU ドライバ(libze_intel_npu.so) が無いと使えません。今回は OpenVINO 同梱イメージ(後述)にドライバが入っていたため、それを利用しました。
# 例:イメージからドライバを取り出す
ls /usr/lib/x86_64-linux-gnu/libze_intel_npu.so*
2. 環境構築(OpenVINO GenAI + optimum-intel)
モデルの OpenVINO IR 変換と推論に Python 環境を用意します。落とし穴が多かったので、バージョン固定が重要です。
python3 -m venv /opt/ov-venv
/opt/ov-venv/bin/pip install torch --index-url https://download.pytorch.org/whl/cpu
/opt/ov-venv/bin/pip install openvino openvino-genai "optimum-intel[openvino]" \
"transformers>=5.4,<5.6" soundfile librosa
> 注意:torch と torchvision のバージョンがずれると operator torchvision::nms does not exist で transformers の import が壊れます。CPU 版をセットで入れ直すこと。また transformers は 5.4 以上 5.6 未満に固定します(後述)。
3. A. embeddings を NPU で動かす
bge-small-en-v1.5 を IR にエクスポートします。
/opt/ov-venv/bin/optimum-cli export openvino \
--model BAAI/bge-small-en-v1.5 --task feature-extraction \
/opt/ov-models/bge-small-ov
ハマりどころ④:NPU は静的シェイプ必須
エクスポート直後のモデルは動的シェイプ([?,?])で、NPU コンパイラに拒否されます(INT64_MAX の次元エラー)。入力長を固定して reshape します。
import openvino as ov
core = ov.Core()
m = core.read_model("/opt/ov-models/bge-small-ov/openvino_model.xml")
# 入力を [1,128] に固定
m.reshape({i.get_any_name(): [1, 128] for i in m.inputs})
# NPU プラットフォームを明示(Meteor Lake = 3720)
cm = core.compile_model(m, "NPU", {"NPU_PLATFORM": "3720"})
計測結果:
| 実行先 | スループット | レイテンシ |
|---|---|---|
| NPU | 126.9 texts/s | 7.9 ms/text |
| CPU | 52.4 texts/s | 19.1 ms/text |
NPU は CPU の約 2.4 倍。埋め込みの一致度(cosine)も 0.99994 で、実質同一の出力が得られました。RAG のベクトル化を NPU に逃がせば、内蔵GPU を LLM に空けられます。
4. B. Whisper を NPU で動かす
whisper-base をエクスポートします。ここが一番ハマりました。
/opt/ov-venv/bin/optimum-cli export openvino \
--model openai/whisper-base \
--task automatic-speech-recognition-with-past \
/opt/ov-models/whisper-past
ハマりどころ⑤:--task ...-with-past が必須
--task automatic-speech-recognition(without past)でエクスポートすると、decoder に beam_idx が含まれず、WhisperPipeline が Port for tensor name beam_idx was not found で失敗します。-with-past を付けると decoder に beam_idx が入り、動くようになります。
ハマりどころ⑥:transformers のバージョン
Whisper の NPU 実行は、エクスポート時の transformers >= 5.4 が事実上必須です(古い 4.x でエクスポートした IR は NPU で invalid unordered_map key を起こす既知バグがあります)。transformers>=5.4,<5.6 に固定しましょう。
実行と結果(20.06 秒の音声、3 回計測の最速値):
| 実行先 | 処理時間 | RTF | 文字起こし |
|---|---|---|---|
| NPU | 0.42s | 0.021 | CPU と完全一致 |
| CPU | 0.65s | 0.033 | — |
NPU は CPU の約 1.5 倍速(20 秒の音声を 0.42 秒で文字起こし)。RTF 0.02 は「実時間の 1/50」で、常時文字起こしには十分です。
import openvino_genai as ov_genai
pipe = ov_genai.WhisperPipeline("/opt/ov-models/whisper-past", "NPU", NPU_PLATFORM="3720")
print(pipe.generate(wav).texts[0])
5. C. NPU と内蔵GPU の同時実行
「GPU で LLM を回しつつ、NPU で別の小型モデルを回す」構成を検証しました。NPU に 1.2B、GPU に 4B を載せ、同時にリクエストを投げます。
| 構成 | スループット |
|---|---|
| NPU 単独(1.2B) | 8.7 tok/s |
| GPU 単独(4B) | 13.9 tok/s |
| 同時実行 合計 | 15.3 tok/s(NPU 6.5 + GPU 8.8) |
同時にすると各ストリームは 25〜37% 低下し、合計も GPU 単独比 +10% 程度にとどまりました。内蔵GPU と NPU がメモリ帯域や CPU を共有するため、コンテンションが発生しています。
→ スループットを稼ぐ目的ではなく、「GPU を対話用に占有し、NPU で裏方処理(embeddings・ASR)を回す」という分離用途が現実的です。
6. 参考:NPU で LLM を生成すると
同じ仕組みで 1.2B の LLM を NPU 実行すると 9.5 tok/s。内蔵GPU の Vulkan 実行(同じ 1.2B で 45.9 tok/s)の 約 1/5 でした。4B クラスは NPU のグラフに載らず Compute error で失敗します。
NPU は LLM の生成速度目的では割に合いません。 モデルの対応範囲も限定的(対称 INT4 中心、コンテキスト上限が小さい)です。
まとめ
| 用途 | NPU の評価 | 根拠 |
|---|---|---|
| Embeddings / RAG | ◎ | CPU 比 2.4 倍、低電力 |
| ASR (Whisper) | ○ | CPU 比 1.5 倍、常時処理向き |
| LLM 生成 | △ | GPU の 1/5、モデル対応も限定的 |
| GPU との同時 | △ | 合計の伸びは限定的 |
Meteor Lake の NPU は「埋め込み」と「音声認識」に使うのが結論です。どちらも GPU から切り離せるため、「GPU は LLM、NPU は RAG のベクトル化と文字起こし」という役割分担が有効です。
得られた教訓(Meteor Lake NPU)
1. パススルーは Proxmox の dev[n]: 方式で(手動 lxc.* は効かない)
2. NPU は静的シェイプ必須(動的シェイプはコンパイル不可)
3. NPU_PLATFORM=3720 を明示
4. Whisper は --task ...-with-past + transformers>=5.4
5. ユーザ空間の Level Zero NPU ドライバが必要
6. NPU 実行は OpenVINO 同梱イメージ内で行うと確実
参考リンク
- Intel NPU / OpenVINO 設定: docs.openvino.ai
- OpenVINO GenAI on NPU: docs.openvino.ai
- Whisper on NPU の既知バグ(#4222): openvino.genai#4222
- OpenVINO Model Server(NPU 配信): docs.openvino.ai
Mentions
Настройка и пример работы LLM на встроенном NPU мини-компьютера с Intel Core Ultra 5 226V Подопытный - мини-ПК Ninkear L20 на Intel Core Ultra 5 226V с 16 ГБ памяти. В статье будет установка и настройка OpenVINO, запуск Qwen3-8B на NPU, замеры скорости и мощности по счётчикам самого процессора и сравнение с дорогой видеокартой RTX 5070 Ti. Плюс практическая часть: обработка фотографий, 3D-рельеф из фото, озвучка книг TTS, Blender и печатная плата. Всё работает локально, без утечек данных в интернет и без оплаты подписок. В новых процессорах Intel Core Ultra появился третий вычислитель - нейронный процессор, NPU. Маркетинг обещает «ИИ-компьютер», но живых примеров обычно два: размытие фона в видеозвонке и Copilot. Мне стало интересно другое. Можно ли запустить на NPU настоящую языковую модель (LLM), сколько она выдаёт токенов в секунду и сколько при этом потребляет? Также мне интересно, что же получится, если загрузить сразу все три блока процессора: NPU, встроенную графику и обычные ядра. Постараюсь разобраться и подробно все рассказать. Начну с писания этого мини-ПК. Ninkear L20 построен на Intel Core Ultra 5 226V (Lunar Lake) с 16 ГБ памяти LPDDR5X-8533 на корпусе процессора. Рабочий диапазон мощности 17-37 Вт. Внутри три разных вычислителя: CPU на 8 ядер (4 производительных + 4 энергоэффективных). Универсален, но на нейросетях медленный: мало параллельных блоков, высокая частота, высокое энергопотребление на операцию. iGPU Intel Arc 130V (в терминах Intel и PyTorch XPU, в OpenVINO это GPU). Архитектура Xe2, сотни параллельных вычислителей, аппаратное умножение матриц. Самый быстрый блок для крупных нейросетей: языковых моделей, Stable Diffusion, длинных промптов. NPU Intel AI Boost четвёртого поколения, по данным Intel до 40 TOPS. Узкий специалист: умножение матриц в INT8 и FP16 на низкой частоте и при малом напряжении. Не умеет динамические формы данных, требует долгой первой компиляции, поддерживает не все операции. У всех трёх блоков общая оперативная память: своей видеопамяти у графики нет, своего ОЗУ у NPU тоже. Модель не нужно копировать между устройствами, но шина памяти одна на всех. При одновременной работе это видно. Чем NPU отличается от Arc 130V на практике. Графика быстрее на языковой модели вдвое. NPU выигрывает, когда задача длинная, нагрузка неполная и важны тишина и ватты: Фоновая обработка (поток с камеры, пакет фотографий, пересказ документов) на NPU добавляет к простою 1-2 Вт (огромная разница по потреблению, если смотреть ту же RTX 5070 Ti, подходит для случаев, когда нужно не срочно). Графика и процессор свободны для основной работы, будь то Blender, браузер или сборка проекта. NPU загружен на 99%, процессор 7%, графика 2%: остальная система свободна Вентилятор не раскручивается: шум остаётся на уровне простоя, 22-24 дБ, тогда как с графикой и процессором 33-34 дБ (для меня также критично - шум не раздражает). Шум L20 при разной нагрузке (замер шумомером): NPU не отличается от простоя NPU, графика и процессор в цифрах Для сравнения я взял одну и ту же языковую модель Qwen3-8B в 4-битном сжатии (OpenVINO GenAI 2026.4). Запрос - 77 токенов, ответ - 256, жадная генерация, засчитывается второй прогон. Мощность - среднее по счётчику RAPL всего кристалла (CPU + GPU + NPU + контроллер памяти) за время генерации. Скорость генерации на трёх вычислительных устройствах Qwen3-8B INT4 NPU GPU Arc 130V CPU Генерация, ток/с 10,7 21,2 10,0 Первый токен, с 1,7 0,17 0,46 Чтение промпта 1329 токенов, ток/с 360 1171 30 Мощность кристалла, Вт 15,4 20,6 16,0 Энергия на токен, Дж 1,52 1,01 1,64 Скажу прямо: Arc 130V быстрее NPU вдвое и даже тратит меньше энергии на токен 1,01 Дж против 1,52. Графика потребляет на треть больше мощности, но заканчивает работу вдвое быстрее. Мощность кристалла по времени: NPU, GPU, CPU и все три блока сразу Процессор по скорости генерации равен NPU, но читает длинный промпт в 12 раз медленнее и тратит больше всех. Привел данные в график к 1 токену и добавил для сравнения RTX 5070 Ti. Обратите внимание - подобный мини-ПК оказывается практически в 2-3 раза экономичнее, чем компьютер с полноценной дискретной видеокартой. Энергия на один токен: L20 и оценка для RTX 5070 Ti Как это выглядит на большой задаче, например, «написать 10 000 токенов» (15-20 страниц текста). NPU делает её за 15,6 минуты и 4,2 Вт·ч, графика - за 7,9 минуты и 2,8 Втч. Разница в энергии 1,4 Втч, меньше заряда одного телефона. На неполной нагрузке NPU на треть экономичнее графики и в 4-10 раз экономичнее процессора. Специально делаю акцент - если задача не срочная, NPU позволяет отдать её в фон и не занимать графику. Обычно я ставлю пакетную обработку фото или генерацию моделей через LLM и оставляю его работать. Одна задача на трёх устройствах: время и энергия Где NPU выигрывает: параллельная работа. Если две нейросети запустить на одной графике, каждая работает вдвое медленнее. Если языковую модель перенести на NPU, нейросеть на графике сохраняет 92% своей скорости. А все три блока одновременно потребляют 27,5 Вт. Все три блока заняты: NPU 75%, графика 92%, процессор 62% Настройка OpenVINO Пара слов про настройку. Работает такая связка на базе OpenVINO - это открытый набор инструментов Intel для запуска нейросетей на CPU, GPU и NPU. Модель хранится в формате IR (.xml граф, .bin веса). Для каждого устройства есть плагин: он компилирует граф под конкретное железо. Для работы потребуется настроить драйверы (речь про NPU драйвер) и установить связку OpenVINO+Python и что еще требуется. NPU виден в Диспетчере устройств в разделе «Нейронные процессоры» как Intel(R) AI Boost. Драйверы NPU и графики берутся с сайта Intel (Intel Driver & Support Assistant ставит оба). У меня: NPU 32.0.100.5540, графика 32.0.101.8331. Со старым драйвером NPU многие модели не компилируются - это первое, что стоит обновить. Потребуется Python 3.12 с python.org. На каждый проект - своё виртуальное окружение, чтобы зависимости разных программ не конфликтовали: python -m venv C:\AI\npu\venv C:\AI\npu\venv\Scripts\activate pip install openvino openvino-genai nncf huggingface_hubsourcecraft.dev Здесь: openvino - среда выполнения, openvino-genai - готовые конвейеры для языковых моделей, Stable Diffusion и распознавания речи, nncf - сжатие моделей в INT8/INT4, huggingface_hub - скачивание моделей (команда hf). Дальше - проверка устройств и свойств NPU. python -c "import openvino as ov; c=ov.Core(); print(c.available_devices); print(c.get_property('NPU','FULL_DEVICE_NAME'), c.get_property('NPU','NPU_DRIVER_VERSION'))"sourcecraft.dev OpenVINO видит CPU, GPU и NPU Выбор устройства в коде. Общего переключателя в системе нет: устройство задаёт программа. Варианты: CPU, GPU, NPU - конкретное устройство. Две видеокарты Intel получают имена GPU.0 и GPU.1; AUTO - OpenVINO выбирает сам; HETERO:NPU,CPU - неподдерживаемые NPU операции уходят на процессор. import openvino as ov core = ov.Core() model = core.read_model("model.xml") compiled = core.compile_model(model, "NPU", {"CACHE_DIR": r"C:\AI\ov_cache", "PERFORMANCE_HINT": "LATENCY"}) result = compiled(input_tensor)[0]sourcecraft.dev Здесь: PERFORMANCE_HINT задаёт стратегию: LATENCY - один запрос как можно быстрее, THROUGHPUT - максимум кадров в секунду через несколько параллельных запросов. Тест NPU на 99% выше сделан именно с THROUGHPUT и очередью из 8 запросов. Настройка LLM модели для работы с NPU Первая компиляция для NPU долгая: Qwen3-8B - 97 секунд, Depth Anything - 30-40 секунд, ESRGAN - 12 минут. С CACHE_DIR скомпилированная модель сохраняется на диск, и следующий запуск занимает секунды (Qwen3-8B 14,6 с). Дальше отмечу, что NPU принимает только фиксированный размер входа. Для картинок модель экспортируют сразу под нужное разрешение (например, 1×3×518×518) или вызывают model.reshape(...) перед компиляцией. Для языковых моделей это делает OpenVINO GenAI: достаточно задать максимальную длину промпта и ответа (см. ниже). Готовые модели для NPU лежат на Hugging Face в коллекции OpenVINO. Для NPU нужны варианты -int4-cw-ov: веса в 4 бита, симметрично, одним масштабом на канал. Свою модель в этом формате можно собрать инструментом optimum-cli (пакет optimum-intel): optimum-cli export openvino -m Qwen/Qwen3-4B --weight-format int4 --sym --group-size -1 --ratio 1.0 Qwen3-4B-int4-cw-ovsourcecraft.dev Я пользовался готовыми моделями, эту команду привожу для полноты. Продолжаю настройку: hf download OpenVINO/Qwen3-8B-int4-cw-ov --local-dir C:\AI\models\Qwen3-8B-int4-cw-ov import openvino_genai as og pipe = og.LLMPipeline(r"C:\AI\models\Qwen3-8B-int4-cw-ov", "NPU", CACHE_DIR=r"C:\AI\ov_cache", MAX_PROMPT_LEN=2048, MIN_RESPONSE_LEN=512) cfg = og.GenerationConfig(); cfg.max_new_tokens = 400 print(pipe.generate("Перескажи текст в пяти пунктах: ... /no_think", cfg))sourcecraft.dev MAX_PROMPT_LEN и MIN_RESPONSE_LEN нужны только NPU: под эти размеры GenAI «нарезает» модель. Приписка /no_think выключает у Qwen3 режим размышлений. Для удобства я сделал окно чата с выбором устройства, в котором видны скорость и мощность: Qwen3-8B на NPU: 1,8 с до первого токена, 15,8 ток/с, кристалл 17,3 Вт Во время генерации NPU загружен примерно на две трети: языковая модель упирается в скорость памяти. Загрузка NPU во время теста Синтез речи Qwen3-TTS на NPU Qwen3-TTS - синтез речи на основе языковой модели (1,7 млрд параметров), с встроенными голосами и клонированием голоса по образцу. У Intel есть официальный пример запуска Qwen3-TTS в OpenVINO (ноутбук qwen3-tts в репозитории openvino_notebooks). Я взял из него конвертер и конвейер. Для Qwen3-TTS нужен PyTorch для конвертации, нужно настроить дополнительное окружение: python -m venv C:\AI\tts\venv C:\AI\tts\venv\Scripts\activate pip install torch==2.8.0 torchaudio==2.8.0 --index-url download.pytorch.org pip install qwen-tts==0.1.1 openvino nncf soundfile git clone --depth 1 openvinotoolkit/openvino_notebooks hf download Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice --local-dir C:\AI\models\Qwen3-TTS-1.7B-CustomVoice hf download Qwen/Qwen3-TTS-12Hz-1.7B-Base --local-dir C:\AI\models\Qwen3-TTS-1.7B-Basesourcecraft.dev CustomVoice - модель со встроенными голосами, Base - для клонирования голоса по образцу. Каждая весит около 4,2 ГБ. Конвертация в IR - функцией из примера Intel, около 3 минут на модель: cd openvino_notebooks\notebooks\qwen3-tts python -c "from qwen_3_tts_helper import convert_qwen3_tts_model as c; c(r'C:\AI\models\Qwen3-TTS-1.7B-CustomVoice', r'C:\AI\models\Qwen3-TTS-CV-OV')"sourcecraft.dev Процесс запуска генерации: from qwen_3_tts_helper import OVQwen3TTSModel import soundfile as sf tts = OVQwen3TTSModel.from_pretrained(r"C:\AI\models\Qwen3-TTS-CV-OV", device="GPU") wavs, sr = tts.generate_custom_voice(text="Глава первая. ...", speaker="aiden", language="Russian", temperature=0.9, top_k=50, repetition_penalty=1.05, max_new_tokens=2048) sf.write("chapter1.wav", wavs[0], sr)sourcecraft.dev Параметры по умолчанию модели: temperature 0,9, top_k 50, repetition_penalty 1,05. За один проход модель озвучивает до 8192 токенов (около 11 минут звука), поэтому книгу я режу на куски около 1500 символов по абзацам и склеиваю результат. Пример Intel официально исключает NPU, и проверка это подтвердила. Основная часть модели (talker) и вокодер имеют динамические формы и KV-кэш, их компилятор NPU не принимает. Но в модели есть «предсказатель кодов» (code predictor), который вызывается 15 раз на каждый кадр звука. Я переэкспортировал его в статическую форму без состояния (вход 1×16×2048), и он заработал на NPU с тем же результатом, что в PyTorch. Программа озвучки: основная модель на графике, предсказатель кодов на NPU Qwen3-TTS 1.7B RTF Всё на графике (статический предсказатель) 1,73 Графика + предсказатель на NPU 2,0-2,1 Процессор + предсказатель на NPU 6,7 Всё на процессоре 8,8-9,9 RTF во сколько раз генерация дольше звука. Самый быстрый вариант - это графика ARC 130V. Вариант «процессор + NPU» в полтора раза быстрее чистого процессора и не трогает графику вовсе - удобно для озвучки книги ночью, пока компьютер занят чем-то ещё. Разборчивость проверялась распознаванием речи Whisper: 95-100% слов во всех вариантах. GIMP и нейросети OpenVINO Intel выпускает бесплатный набор плагинов для GIMP 3: увеличение разрешения, сегментация, Stable Diffusion (генерация и инпейнтинг) и FastSD. Устройство выбирается в окне плагина. Установка подобным образом: winget install --id GIMP.GIMP.3 --version 3.0.8.2 --scope user mkdir C:\AI\GIMP_OpenVINO cd C:\AI\GIMP_OpenVINO git clone --branch 3.3.0 intel/openvino-ai-plugins-gimp openvino-ai-plugins-gimp\install.bat gimpenv3\Scripts\python.exe -m pip install "optimum-intel==2.0.0" gimpenv3\Scripts\python.exe openvino-ai-plugins-gimp\model_setup.pysourcecraft.dev Версию GIMP я взял 3.0.x: на ней Intel проверяет плагины. install.bat создаёт для плагинов отдельное окружение gimpenv3 и копирует их в %APPDATA%\GIMP\3.0\plug-ins. model_setup.py - меню загрузки моделей Stable Diffusion. Super Resolution и сегментация входят в комплект. Модели инпейнтинга меню скачивает целым репозиторием (14 и 19 ГБ) и конвертирует сам. Я поступил экономнее: скачал только FP16-веса и сконвертировал той же командой, что вызывает плагин, положив результат в его папку моделей: hf download stable-diffusion-v1-5/stable-diffusion-inpainting --include ".json" ".txt" "*fp16.safetensors" gimpenv3\Scripts\optimum-cli export openvino --model <папка_скачанной_модели> --variant fp16 --weight-format fp16 --task image-to-image %USERPROFILE%\openvino-ai-plugins-gimp\weights\stable-diffusion-ov\stable-diffusion-1.5\inpaintingsourcecraft.dev Для SDXL - то же с репозиторием diffusers/stable-diffusion-xl-1.0-inpainting-0.1 и папкой stable-diffusion-xl\inpainting. Слой → OpenVINO-AI-Plugins: четыре плагина Нюанс: плагины работают только в интерактивном режиме. Из пакетного режима GIMP они ничего не делают. Устройство выбирается списком: CPU, GPU, NPU Тест апскейлинга 741×500 → 1482×1000 пх. Super Resolution на NPU, результат - новым слоем Модель CPU GPU NPU Super Resolution sr_1033 151 мс 32 мс 46 мс Super Resolution ESRGAN ×4 64 с 1,0 с 1,2 с Сегментация deeplabv3 200 мс 7,6 мс 19,5 мс Сегментация sseg-adas-0001 491 мс 31 мс неверный результат SD 1.5 Inpainting, 512×512, 20 шагов 284 с 25 с не компилируется SDXL Inpainting, 1024×1024, 20 шагов - 107 с не компилируется Для NPU в GIMP подходят Super Resolution и сегментация deeplabv3. Модель sseg-adas-0001 на NPU работает без ошибок, но результат неверный: с процессором совпадают 2,3% пикселей. Stable Diffusion - только на графике, в режиме Power Mode - Best performance. Так что для тяжелых генераций имеет смысл подключить eGPU (но это уже отдельная история). 3D-рельеф из фото: Depth Anything на NPU Depth Anything V2 строит карту глубины по одному фото. Из неё моя программа Depth & Relief Studio делает рельеф с основанием и рамкой и экспортирует STL для 3D-печати. Это идеальная задача для NPU: модель картиночная, размер входа фиксированный, а пакет из сотни фотографий можно поставить в фон. Настройка конвертации модели в IR под NPU (окружение с torch и transformers): import torch, openvino as ov from transformers import AutoModelForDepthEstimation class DepthOnly(torch.nn.Module): def init(self, m): super().init() self.m = m def forward(self, x): return self.m(pixel_values=x).predicted_depth m = AutoModelForDepthEstimation.from_pretrained("depth-anything/Depth-Anything-V2-Small-hf").eval() with torch.no_grad(): ovm = ov.convert_model(DepthOnly(m), example_input=torch.zeros(1, 3, 518, 518), input=[1, 3, 518, 518]) ov.save_model(ovm, "small_fp16_518/model.xml", compress_to_fp16=True)sourcecraft.dev Фиксированный вход 518×518 (кратно 14 - размеру патча ViT) сразу делает модель пригодной для NPU. Сжатие в INT8 инструментом NNCF, без переобучения. Для калибровки хватило восьми моих фото рельефов, размноженных отражениями и кадрированиями до 88 примеров. tensors - список этих примеров, подготовленных так же, как для инференса: размер 518×518, нормализация ImageNet, массив 1×3×518×518: import nncf q = nncf.quantize(ov.Core().read_model("small_fp16_518/model.xml"), nncf.Dataset(tensors), model_type=nncf.ModelType.TRANSFORMER, subset_size=len(tensors)) ov.save_model(q, "small_int8_518/model.xml")sourcecraft.dev FP16 против INT8 на восьми фото рельефов: время, энергия на кадр и точность Depth Anything V2 Small CPU GPU NPU FP16, мс на кадр 659 18,1 28,0 INT8, мс на кадр 336 18,1 23,6 INT8, Дж на кадр 3,58 0,31 0,36 INT8, отличие от FP16 (рельеф 5 мм) 0,063 мм 0,065 мм 0,062 мм INT8 уменьшает модель с 47 до 24 МБ, ускоряет NPU на 16% и процессор вдвое. Отличие от FP16 - в среднем 0,06 мм на рельефе высотой 5 мм, меньше слоя FDM-печати. Фото, FP16 и INT8 на NPU, разница (усилена в 5 раз) Разница собрана по резким контурам, а не по всей поверхности: Depth & Relief Studio: модель INT8, устройство NPU, карта высот парусника Рельеф Парусник 90 × 120 мм, STL прошёл проверку на замкнутость, можно отправлять на принтер для FDM печати. Парусник на основании со скруглёнными углами под фрезеровку и 3D печать Такой сценарий работы «поставить и забыть» удобен, особенно если в очереди много файлов для обработки: в программе есть пакетный режим (папка с фото → папка с картами глубины). На NPU в INT8 он идёт в фоне на 24 мс и 0,36 Дж на кадр, вентилятор при этом не слышно, а графика свободна для Blender или слайсера. Сравнение с Tesla V100 и флагманскими видеокартами Я не так давно рассказывал про приобретение Tesla V100 (и в качестве eGPU, и для домашнего ИИ-сервера). Для сравнения вот такой график. Указываю паспортную мощность видеокарт (реально могут быть другие цифры, нужно также прогонять на тестах для более детального сравнения), рядом с измеренной мощностью кристалла L20: Tesla V100 - 250 Вт (PCIe) или 300 Вт (SXM2), RTX 5070 Ti - 300 Вт, RTX 4090 - 450 Вт, RTX 5090 - 575 Вт. И это одна карта, без процессора, памяти и блока питания. L20 на языковой модели потребляет 15-21 Вт на кристалл, все три блока сразу - 27,5 Вт, фоновая задача на NPU - плюс 2 Вт к простою. Выводы NPU медленный. Языковая модель на нём работает вдвое медленнее, чем на Arc 130V, и тратит на токен даже больше энергии. Если результат нужен сейчас - считайте на графике. NPU экономный в фоне. На неполной нагрузке он добавляет к простою 1-2 Вт - это на треть меньше графики и в 4-10 раз меньше процессора. NPU почти не шумит. При работе нейросети на NPU шум L20 остаётся на уровне простоя (22-24 дБ). С графикой и процессором - 33-34 дБ. NPU работает параллельно. Отдав ему одну нейросеть, вы сохраняете графику и процессор: задача на графике теряет всего 8% скорости. Не всё запускается на NPU. Stable Diffusion, основная часть Qwen3-TTS и модели с динамическими формами не компилируются. Некоторые модели (sseg-adas-0001) дают неверный результат без ошибок - проверяйте на эталоне. Кэш и статические формы - обязательны. Без CACHE_DIR каждый запуск начинается с минутной компиляции. INT8 для картиночных моделей - да. Depth Anything в INT8 на NPU быстрее на 16%, вдвое меньше и почти не отличается от FP16. Итог простой: NPU в L20 - не ускоритель «для скорости», а тихий экономичный помощник. Подходящий вариант, чтобы поставить задачу и забыть, если результат не нужен срочно: пересказ документов, пакетная обработка фото в рельефы, озвучка книги в связке с процессором. Мини-ПК при этом не слышно, а графика и процессор свободны для основной работы. А какие фоновые задачи вы бы отдали NPU на своём компьютере?
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat) Hey everyone, Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs (like the XPS 14 and 13 that DHH likes to rave about). So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required. It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino) You can check out the umbrella project here: vinopilot.ca Below is an explanation of all the different projects I've worked on, with further details on implementation. VinoWhisper - Live Captioning (vinowhisper.com) This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones. VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca) This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use. Ovfetch - Runtime consistency (crates.io) This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem. This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus VinoOpenEffects - Camera Effects This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here! VinoSearch - Semantic Search for Text, Images, Documents This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge! VinoPop - Click to Do/PopClip for Linux This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline! VinoWatch - Performance Monitoring This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right. PRs and feedback welcome!
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat) **Disclaimer: AI was used extensively in the development of these applications, but these applications run entirely offline on the Intel Linux NPUs. I work as a professional software engineer** Hey everyone, Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required. It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino) You can check out the umbrella project here: vinopilot.ca Below is an explanation of all the different projects I've worked on, with further details on implementation. VinoWhisper - Live Captioning (vinowhisper.com) This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones. VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca) This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use. Ovfetch - Runtime consistency (crates.io) This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem. This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus VinoOpenEffects - Camera Effects This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here! VinoSearch - Semantic Search for Text, Images, Documents This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge! VinoPop - Click to Do/PopClip for Linux This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline! VinoWatch - Performance Monitoring This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right. PRs and feedback welcome!
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat) **Disclaimer: AI was used extensively in the development of these applications, but these applications run entirely offline on the Intel Linux NPUs. I work as a professional software engineer** Hey everyone, Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required. It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino) You can check out the umbrella project here: vinopilot.ca Below is an explanation of all the different projects I've worked on, with further details on implementation. VinoWhisper - Live Captioning (vinowhisper.com) This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones. VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca) This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use. Ovfetch - Runtime consistency (crates.io) This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem. This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus VinoOpenEffects - Camera Effects This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here! VinoSearch - Semantic Search for Text, Images, Documents This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge! VinoPop - Click to Do/PopClip for Linux This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline! VinoWatch - Performance Monitoring This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right. PRs and feedback welcome!
NPU accelerated semantic search (docs, images etc), live captioning, webcam effects and more on Linux - VinoPilot (all the good stuff from Copilot+ with zero bloat) **Disclaimer: AI was used extensively in the development of these applications, but these applications run entirely offline on the Intel Linux NPUs. I work as a professional software engineer** Hey everyone, Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required. It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino) You can check out the umbrella project here: vinopilot.ca Below is an explanation of all the different projects I've worked on, with further details on implementation. VinoWhisper - Live Captioning (vinowhisper.com) This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms on Linux, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries and model from OpenAI (before they worked on ChatGPT!), so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones. VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca) This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use. Ovfetch - Runtime consistency (crates.io) This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem. This is more of a "framework" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus VinoOpenEffects - Camera Effects This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here! VinoSearch - Semantic Search for Text, Images, Documents This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge! VinoPop - Click to Do/PopClip for Linux This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4 (the best small model). I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPUand RAM the most, so if you are using this, bear in mind its going to be much slower than cloud inference, but it works offline! VinoWatch - Performance Monitoring This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right. PRs and feedback welcome!
I've ported over (almost) all the useful Windows "Copilot+" features to Linux. All of them run offline, on any recent Intel CPU with a decent NPU. Hey everyone, Over the past couple of months I've been working on learning more about Linux and local AI, and I noticed that there really isn't much work done on the Linux side to use the NPU that comes free with Intel laptop CPUs. So I decided to bring over all the good stuff from Copilot+ on the Windows side (so no Recall!) while leveraging existing projects and libraries to reduce the amount of work required. It utilises Intel's existing framework, OpenVino (openvinotoolkit/openvino) You can check out the initiative here: vinopilot.ca All work was assisted by Claude Opus and Sonnet. Below is an explanation of all the different projects I've worked on, with further details on implementation VinoWhisper - Live Captioning (vinowhisper.com) This was my first project, and copies the existing Windows Live Captioning system. It brings system wide captions to Linux, alongside Voice Typing on Wayland devices. This already exists in many forms, but none of them use the NPU natively. The advantage of using the NPU for transcription and captioning is better battery life, with no change in quality. It leverages the existing Whisper libraries, so its pretty fast and consistent. Personally, I use it to live caption Twitch Streams in busy environments when I don't have access to headphones. VinoAuthFace - Face Unlock (vinoauthface.vinopilot.ca) This is a second project, and copies Windows Hello. It forks an existing project, but employs the NPU. The CPU works fine, but using the NPU allows it to use a more powerful model. There are many other options like Gaze (which I've contributed to as well!), but I wanted something specific to devices with an IR emitter, that I could control myself (more on ovfetch next), because Windows Hello removed IR emitter only authentication. This one I made for my own purposes, because I don't like typing in passwords. There are a ton of CPU only projects. This one has a more capable and secure model than what the others use. Ovfetch - Runtime consistency (crates.io) This was a project I should've taken on earlier. It automates the process of downloading the OpenVino enabled ONNX runtimes that the models require to run on the NPU. When I was working on Gaze, I realised that using the NPU and not the CPU requires building from source as there was no way to determine which ONNX runtime the NPU requires, and this solves the problem. This is more of a "plumbing" feature, but since its a separate binary, I can distribute binaries for my other projects without any NPU specific work, and then ovfetch can download the relevant runtime when installing the binary onto the user's device, no compiling from source required. This is super secure, and has CI jobs to project against package manager attacks, since it automates downloading. More details in the crates link, but it has a ton of failsafes to ensure that it never downloads any bad runtime which has a virus VinoOpenEffects - Camera Effects This forks an existing project, funinkina/openeffects, while adding NPU acceleration to the effects, which improves battery life on lower end devices. I don't particularly use this one, as most of the main applications for video conferencing have their own cloud accelerated effects, but if you want it for OBS or other features offline, its here! VinoSearch - Semantic Search for Text, Images, Documents This one is the most useful of the bunch. It allows you to search your laptop with fuzzy terms and meaning, and indexes images, documents, and text, all offline. Its super fast, with almost no battery life impact compared to CPU only solutions. I really like this one because you can search for pictures of cats or memes, and it'll surface them. Details are in the Github! It uses the new Gemma 2 Embedding, requantised for Intel NPUs, so its pretty bleeding edge! VinoPop - Click to Do/PopClip for Linux This also forks an existing project, but removes the cloud AI in favour of local AI with Gemma. It can do offline summarisation, translations, and OCR using Gemma 4. I particularly like the OCR functionality for generating alt-text for images. This one stresses the NPU the most, so if you are using this, bear in mind its going to be much slower than the Cloud, but it works offline! VinoWatch - Performance Monitoring This is a smaller project, but optional if you want it. It monitors the NPU and RAM usage of the other projects within the tray. All of the projects unload the models after 5 minutes by default, and I recommend at least 12-16gb of RAM. But you can still monitor it locally and make sure they're all behaving properly. I recommend also an NVME SSD to ensure that the NPU cache and loading works right. PRs and feedback welcome!
Intel Meteor Lake の NPU を Proxmox コンテナにパススルーして使ってみた ― embeddings は CPU 比 2.4 倍、LLM 生成は遅かった はじめに 「AI PC」世代の CPU には NPU(Neural Processing Unit)が載っています。手元のミニ PC(Beelink GTi14 Ultra / Intel Core Ultra 7 155H = Meteor Lake)にも Intel AI Boost NPU が搭載されているのですが、Proxmox 上のコンテナからは見えていませんでした。 本記事では NPU を非特権 LXC コンテナにパススルーし、次の用途で実際に計測した結果を共有します。 - A. embeddings(RAG のベクトル化) - B. 音声認識(Whisper) - C. NPU と内蔵GPU の同時実行 - (参考)LLM 生成 結論を先に言うと、Meteor Lake の NPU は「embeddings」と「音声認識」では CPU より明確に速く、LLM のトークン生成では内蔵GPU に大きく負ける、という結果でした。 > 関連記事:同じマシンの内蔵GPU で Ollama / llama.cpp(Vulkan・SYCL・OpenVINO) / OVMS を比較した記事も書いています。本記事はその「NPU編」です。 TL;DR | 用途 | NPU の結果 | CPU 比 | |---|---|---| | embeddings (bge-small) | 126.9 texts/s (7.9 ms/text) | 約 2.4 倍 | | Whisper (base, 20秒音声) | 0.42s (RTF 0.021) | 約 1.5 倍 | | LLM 生成 (1.2B) | 9.5 tok/s | GPU の 1/4〜1/5 | | NPU + GPU 同時 | 合計 +10%(コンテンション) | — | NPU の実用的な使い道は embeddings と音声認識でした。 検証環境 | 項目 | 内容 | |---|---| | マシン | Beelink GTi14 Ultra(DMI: AZW GTi14) | | SoC | Intel Core Ultra 7 155H(Meteor Lake, 6P+8E+2LP-E = 16C/22T) | | NPU | Intel AI Boost(NPU 3720, PCI 8086:7d1d) | | 内蔵GPU | Intel Arc Graphics(8 Xeコア) | | ホスト | Proxmox VE(カーネル 7.x-pve) | | ゲスト | 非特権 LXC(Ubuntu 24.04.4 LTS, 20GB RAM, 22 vCPU) | | コンテナ | Docker(LXC 内でネスト実行) | NPU の位置づけ | ユニット | 概算性能 | |---|---| | NPU (AI Boost) | 約 11 TOPS | | 内蔵GPU (Arc 8 Xe) | 約 18 TOPS | | CPU (22 スレッド) | 約 5 TOPS | NPU は 生のスループットでは内蔵GPU より非力です。売りは低消費電力(Intel の資料では GPU の半分以下の消費電力)で、「GPU が別作業で埋まっている間の常時 AI」に向きます。 1. NPU を LXC にパススルーする ハマりどころ①:手動の lxc.* では動かない 最初、よくある手順で lxc.cgroup2.devices.allow と lxc.mount.entry を手書きしたところ、デバイスノードは見えるのに root でも開けない(Permission denied)状態になりました。デバイスの所有者が nobody:nogroup になり、デバイス cgroup に反映されていなかったためです。 正解は、Proxmox の dev[n]: ショートカットを使うこと。/dev/dri のパススルーと同じ仕組みで、ノード生成と cgroup 許可をまとめて面倒見てくれます。 # /etc/pve/lxc/<CTID>.conf dev0: /dev/dri/renderD128 dev1: /dev/dri/card0 dev2: /dev/accel/accel0 # ← NPU を追加(これだけ) ハマりどころ②:非特権 LXC は自作 mknod 不可 非特権 LXC では mknod が Operation not permitted で弾かれます。デバイスノードを自分で作ることはできないので、必ずホスト側の設定変更が必要です。 手順 # ホスト(Proxmox)で ls -l /dev/accel/accel0 # 存在確認(261:0) # /etc/pve/lxc/<CTID>.conf に dev2: /dev/accel/accel0 を追記 pct snapshot <CTID> pre-npu # 念のためスナップショット pct reboot <CTID> 再起動後、ゲストで /dev/accel/accel0 が root:root で見え、開けるようになります。 ls -l /dev/accel/accel0 # crw-rw---- root root 261, 0 head -c0 /dev/accel/accel0 && echo OPEN_OK ハマりどころ③:NPU ドライバ(ユーザ空間)が必要 カーネル側は intel_vpu がロード済みでも、ユーザ空間の Level Zero NPU ドライバ(libze_intel_npu.so) が無いと使えません。今回は OpenVINO 同梱イメージ(後述)にドライバが入っていたため、それを利用しました。 # 例:イメージからドライバを取り出す ls /usr/lib/x86_64-linux-gnu/libze_intel_npu.so* 2. 環境構築(OpenVINO GenAI + optimum-intel) モデルの OpenVINO IR 変換と推論に Python 環境を用意します。落とし穴が多かったので、バージョン固定が重要です。 python3 -m venv /opt/ov-venv /opt/ov-venv/bin/pip install torch --index-url https://download.pytorch.org/whl/cpu /opt/ov-venv/bin/pip install openvino openvino-genai "optimum-intel[openvino]" \ "transformers>=5.4,<5.6" soundfile librosa > 注意:torch と torchvision のバージョンがずれると operator torchvision::nms does not exist で transformers の import が壊れます。CPU 版をセットで入れ直すこと。また transformers は 5.4 以上 5.6 未満に固定します(後述)。 3. A. embeddings を NPU で動かす bge-small-en-v1.5 を IR にエクスポートします。 /opt/ov-venv/bin/optimum-cli export openvino \ --model BAAI/bge-small-en-v1.5 --task feature-extraction \ /opt/ov-models/bge-small-ov ハマりどころ④:NPU は静的シェイプ必須 エクスポート直後のモデルは動的シェイプ([?,?])で、NPU コンパイラに拒否されます(INT64_MAX の次元エラー)。入力長を固定して reshape します。 import openvino as ov core = ov.Core() m = core.read_model("/opt/ov-models/bge-small-ov/openvino_model.xml") # 入力を [1,128] に固定 m.reshape({i.get_any_name(): [1, 128] for i in m.inputs}) # NPU プラットフォームを明示(Meteor Lake = 3720) cm = core.compile_model(m, "NPU", {"NPU_PLATFORM": "3720"}) 計測結果: | 実行先 | スループット | レイテンシ | |---|---|---| | NPU | 126.9 texts/s | 7.9 ms/text | | CPU | 52.4 texts/s | 19.1 ms/text | NPU は CPU の約 2.4 倍。埋め込みの一致度(cosine)も 0.99994 で、実質同一の出力が得られました。RAG のベクトル化を NPU に逃がせば、内蔵GPU を LLM に空けられます。 4. B. Whisper を NPU で動かす whisper-base をエクスポートします。ここが一番ハマりました。 /opt/ov-venv/bin/optimum-cli export openvino \ --model openai/whisper-base \ --task automatic-speech-recognition-with-past \ /opt/ov-models/whisper-past ハマりどころ⑤:--task ...-with-past が必須 --task automatic-speech-recognition(without past)でエクスポートすると、decoder に beam_idx が含まれず、WhisperPipeline が Port for tensor name beam_idx was not found で失敗します。-with-past を付けると decoder に beam_idx が入り、動くようになります。 ハマりどころ⑥:transformers のバージョン Whisper の NPU 実行は、エクスポート時の transformers >= 5.4 が事実上必須です(古い 4.x でエクスポートした IR は NPU で invalid unordered_map key を起こす既知バグがあります)。transformers>=5.4,<5.6 に固定しましょう。 実行と結果(20.06 秒の音声、3 回計測の最速値): | 実行先 | 処理時間 | RTF | 文字起こし | |---|---|---|---| | NPU | 0.42s | 0.021 | CPU と完全一致 | | CPU | 0.65s | 0.033 | — | NPU は CPU の約 1.5 倍速(20 秒の音声を 0.42 秒で文字起こし)。RTF 0.02 は「実時間の 1/50」で、常時文字起こしには十分です。 import openvino_genai as ov_genai pipe = ov_genai.WhisperPipeline("/opt/ov-models/whisper-past", "NPU", NPU_PLATFORM="3720") print(pipe.generate(wav).texts[0]) 5. C. NPU と内蔵GPU の同時実行 「GPU で LLM を回しつつ、NPU で別の小型モデルを回す」構成を検証しました。NPU に 1.2B、GPU に 4B を載せ、同時にリクエストを投げます。 | 構成 | スループット | |---|---| | NPU 単独(1.2B) | 8.7 tok/s | | GPU 単独(4B) | 13.9 tok/s | | 同時実行 合計 | 15.3 tok/s(NPU 6.5 + GPU 8.8) | 同時にすると各ストリームは 25〜37% 低下し、合計も GPU 単独比 +10% 程度にとどまりました。内蔵GPU と NPU がメモリ帯域や CPU を共有するため、コンテンションが発生しています。 → スループットを稼ぐ目的ではなく、「GPU を対話用に占有し、NPU で裏方処理(embeddings・ASR)を回す」という分離用途が現実的です。 6. 参考:NPU で LLM を生成すると 同じ仕組みで 1.2B の LLM を NPU 実行すると 9.5 tok/s。内蔵GPU の Vulkan 実行(同じ 1.2B で 45.9 tok/s)の 約 1/5 でした。4B クラスは NPU のグラフに載らず Compute error で失敗します。 NPU は LLM の生成速度目的では割に合いません。 モデルの対応範囲も限定的(対称 INT4 中心、コンテキスト上限が小さい)です。 まとめ | 用途 | NPU の評価 | 根拠 | |---|---|---| | Embeddings / RAG | ◎ | CPU 比 2.4 倍、低電力 | | ASR (Whisper) | ○ | CPU 比 1.5 倍、常時処理向き | | LLM 生成 | △ | GPU の 1/5、モデル対応も限定的 | | GPU との同時 | △ | 合計の伸びは限定的 | Meteor Lake の NPU は「埋め込み」と「音声認識」に使うのが結論です。どちらも GPU から切り離せるため、「GPU は LLM、NPU は RAG のベクトル化と文字起こし」という役割分担が有効です。 得られた教訓(Meteor Lake NPU) 1. パススルーは Proxmox の dev[n]: 方式で(手動 lxc.* は効かない) 2. NPU は静的シェイプ必須(動的シェイプはコンパイル不可) 3. NPU_PLATFORM=3720 を明示 4. Whisper は --task ...-with-past + transformers>=5.4 5. ユーザ空間の Level Zero NPU ドライバが必要 6. NPU 実行は OpenVINO 同梱イメージ内で行うと確実 参考リンク - Intel NPU / OpenVINO 設定: docs.openvino.ai - OpenVINO GenAI on NPU: docs.openvino.ai - Whisper on NPU の既知バグ(#4222): openvino.genai#4222 - OpenVINO Model Server(NPU 配信): docs.openvino.ai