diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 782d828136..853cf7f9e4 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -390,11 +390,12 @@ FROM $BASE_IMAGE as release ARG INSTALL_RPMS_FROM_URL= ARG INSTALL_DRIVER_VERSION="24.26.30049" ARG GPU=0 +ARG NPU=0 ARG NVIDIA=0 ENV DEBIAN_FRONTEND=noninteractive ARG debug_bazel_flags= LABEL bazel-build-flags=${debug_bazel_flags} -LABEL supported-devices="CPU=1 GPU=${GPU} NVIDIA=${NVIDIA}" +LABEL supported-devices="CPU=1 GPU=${GPU} NPU=${NPU} NVIDIA=${NVIDIA}" ARG BASE_IMAGE LABEL base-image=${BASE_IMAGE} ENV PYTHONPATH=/ovms/lib/python:/ovms/python_deps @@ -438,21 +439,19 @@ RUN apt-get update -y ; \ ;; \ "23.13.26032") \ mkdir /tmp/gpu_deps && cd /tmp/gpu_deps ; \ - curl -L -O https://github.com/intel/compute-runtime/releases/download/23.05.25593.11/libigdgmm12_22.3.0_amd64.deb ; \ curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.13700.14/intel-igc-core_1.0.13700.14_amd64.deb ; \ curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.13700.14/intel-igc-opencl_1.0.13700.14_amd64.deb ; \ curl -L -O https://github.com/intel/compute-runtime/releases/download/23.13.26032.30/intel-opencl-icd_23.13.26032.30_amd64.deb ; \ curl -L -O https://github.com/intel/compute-runtime/releases/download/23.13.26032.30/libigdgmm12_22.3.0_amd64.deb ; \ - dpkg -i *.deb && rm -Rf /tmp/gpu_deps ; \ + dpkg -i ./*.deb && rm -Rf /tmp/gpu_deps ; \ ;; \ "23.22.26516") \ mkdir /tmp/gpu_deps && cd /tmp/gpu_deps ; \ - curl -L -O https://github.com/intel/compute-runtime/releases/download/23.22.26516.18/intel-level-zero-gpu_1.3.26516.18_amd64.deb ; \ curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.14062.11/intel-igc-core_1.0.14062.11_amd64.deb ; \ curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.14062.11/intel-igc-opencl_1.0.14062.11_amd64.deb ; \ curl -L -O https://github.com/intel/compute-runtime/releases/download/23.22.26516.18/intel-opencl-icd_23.22.26516.18_amd64.deb ; \ curl -L -O https://github.com/intel/compute-runtime/releases/download/23.22.26516.18/libigdgmm12_22.3.0_amd64.deb ; \ - dpkg -i *.deb && rm -Rf /tmp/gpu_deps ; \ + dpkg -i ./*.deb && rm -Rf /tmp/gpu_deps ; \ ;; \ "24.26.30049") \ mkdir /tmp/gpu_deps && cd /tmp/gpu_deps ; \ @@ -479,6 +478,15 @@ RUN apt-get update -y ; \ rm -rf /var/lib/apt/lists/* ; \ esac ; \ fi ; \ + if [ "$NPU" == "1" ] ; then \ + mkdir /tmp/npu_deps && cd /tmp/npu_deps ; \ + apt-get update && apt-get install -y --no-install-recommends libtbb12 && \ + curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.6.0/intel-driver-compiler-npu_1.6.0.20240814-10390978568_ubuntu22.04_amd64.deb ; \ + curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.6.0/intel-fw-npu_1.6.0.20240814-10390978568_ubuntu22.04_amd64.deb ; \ + curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.6.0/intel-level-zero-npu_1.6.0.20240814-10390978568_ubuntu22.04_amd64.deb ; \ + curl -L -O https://github.com/oneapi-src/level-zero/releases/download/v1.17.6/level-zero_1.17.6+u22.04_amd64.deb ; \ + dpkg -i ./*.deb && rm -Rf /tmp/npu_deps ; \ + fi ; \ apt-get clean ; \ rm -rf /var/lib/apt/lists/* && rm -rf /tmp/* ; \ groupadd --gid 5000 ovms ; \ diff --git a/Makefile b/Makefile index 811a120e58..4b635a35a4 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,7 @@ CHECK_COVERAGE ?=0 RUN_TESTS ?= 0 NVIDIA ?=0 GPU ?= 0 +NPU ?= 0 BUILD_NGINX ?= 0 MEDIAPIPE_DISABLE ?= 0 PYTHON_DISABLE ?= 0 @@ -239,6 +240,7 @@ BUILD_ARGS = --build-arg http_proxy=$(HTTP_PROXY)\ --build-arg INSTALL_RPMS_FROM_URL=$(INSTALL_RPMS_FROM_URL)\ --build-arg INSTALL_DRIVER_VERSION=$(INSTALL_DRIVER_VERSION)\ --build-arg GPU=$(GPU)\ + --build-arg NPU=$(NPU)\ --build-arg RELEASE_BASE_IMAGE=$(BASE_IMAGE_RELEASE)\ --build-arg JOBS=$(JOBS)\ --build-arg CAPI_FLAGS=$(CAPI_FLAGS)\ diff --git a/docs/accelerators.md b/docs/accelerators.md index 1ea0e74de3..e22d4d9fd7 100644 --- a/docs/accelerators.md +++ b/docs/accelerators.md @@ -170,7 +170,7 @@ The docker image of OpenVINO Model Server including support for NVIDIA can be bu ```bash git clone https://github.com/openvinotoolkit/model_server.git cd model_server -make docker_build NVIDIA=1 OV_USE_BINARY=0 +make docker_build NVIDIA=1 cd .. ``` Check also [building from sources](https://github.com/openvinotoolkit/model_server/blob/main/docs/build_from_source.md). @@ -188,4 +188,24 @@ docker run -it --gpus all -p 9000:9000 -v ${PWD}/models/public/resnet-50-tf:/opt Check the supported [configuration parameters](https://github.com/openvinotoolkit/openvino_contrib/tree/master/modules/nvidia_plugin#supported-configuration-parameters) and [supported layers](https://github.com/openvinotoolkit/openvino_contrib/tree/master/modules/nvidia_plugin#supported-layers-and-limitations) -Currently the AUTO and MULTI virtual plugins do not support NVIDIA plugin as an alternative device. + +## Using NPU device Plugin + +OpenVINO Model Server can support using [NPU device](https://docs.openvino.ai/canonical/openvino_docs_install_guides_configurations_for_intel_npu.html) + +Docker image with required dependencies can be build using this procedure: +The docker image of OpenVINO Model Server including support for NVIDIA can be built from sources + +```bash +git clone https://github.com/openvinotoolkit/model_server.git +cd model_server +make release_image NPU=1 +cd .. +``` + +Example command to run container with NPU: +```bash +docker run --device /dev/accel -p 9000:9000 --group-add=$(stat -c "%g" /dev/dri/render* | head -n 1) -u $(id -u):$(id -g) +-v ${PWD}/models/public/resnet-50-tf:/opt/model openvino/model_server:latest --model_path /opt/model --model_name resnet --port 9000 --target_device NPU +``` +Check more info about the [NPU driver for Linux](https://github.com/intel/linux-npu-driver). \ No newline at end of file