From 36cf4fef33ea668ea9b68a33ce270a07dc03791d Mon Sep 17 00:00:00 2001 From: Egor Tiuvaev Date: Mon, 29 Jul 2024 16:10:38 +0200 Subject: [PATCH] Add NPU packages to Ubuntu 22 --- templates/ubuntu22/hw/npu.dockerfile.j2 | 10 ++++++++++ utils/arg_parser.py | 16 ++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 templates/ubuntu22/hw/npu.dockerfile.j2 diff --git a/templates/ubuntu22/hw/npu.dockerfile.j2 b/templates/ubuntu22/hw/npu.dockerfile.j2 new file mode 100644 index 00000000..2ac147c3 --- /dev/null +++ b/templates/ubuntu22/hw/npu.dockerfile.j2 @@ -0,0 +1,10 @@ +# NPU dependencies +# hadolint ignore=DL3003 +RUN apt-get update && \ + mkdir /tmp/npu_deps && \ + cd /tmp/npu_deps && \ + curl -LO https://github.com/intel/linux-npu-driver/releases/download/v1.5.1/intel-driver-compiler-npu_1.5.1.20240708-9842236399_ubuntu22.04_amd64.deb && \ + curl -LO https://github.com/intel/linux-npu-driver/releases/download/v1.5.1/intel-level-zero-npu_1.5.1.20240708-9842236399_ubuntu22.04_amd64.deb && \ + curl -LO https://github.com/oneapi-src/level-zero/releases/download/v1.17.19/level-zero_1.17.19+u22.04_amd64.deb && \ + apt install -y ./*.deb && \ + rm -rf /var/lib/apt/lists/* /tmp/* diff --git a/utils/arg_parser.py b/utils/arg_parser.py index 26bbb627..3844ae74 100644 --- a/utils/arg_parser.py +++ b/utils/arg_parser.py @@ -21,7 +21,7 @@ class DockerCIArgumentParser(argparse.ArgumentParser): """CLI argument parser for this framework""" - SUPPORTED_OS: typing.List = ['ubuntu18', 'ubuntu20', 'ubuntu22', 'winserver2019', 'windows20h2', 'rhel8'] + SUPPORTED_OS: typing.List = ['ubuntu18', 'ubuntu20', 'ubuntu22', 'ubuntu24', 'winserver2019', 'windows20h2', 'rhel8'] def __init__(self, prog: typing.Optional[str] = None, description: typing.Optional[str] = None): super().__init__(prog=prog, description=description, @@ -105,7 +105,7 @@ def add_build_args(parser: argparse.ArgumentParser): parser.add_argument( '-py', '--python', - choices=['python37', 'python38', 'python310'], + choices=['python37', 'python38', 'python310', 'python311', 'python312', 'python313'], help='Python interpreter for docker image, currently default is python38', ) @@ -455,8 +455,10 @@ def parse_args(name: str, description: str): # noqa 'It is an insecure way.') if not args.python: - if args.os in ('ubuntu22'): + if args.os in ('ubuntu22', ): args.python = 'python310' + elif args.os in ('ubuntu24', ): + args.python = 'python312' else: args.python = 'python38' @@ -478,12 +480,10 @@ def parse_args(name: str, description: str): # noqa # workaround for https://bugs.python.org/issue16399 issue if not args.device and 'win' not in args.os: - if args.distribution == 'base': - args.device = ['cpu'] - elif args.os == 'rhel8': - args.device = ['cpu', 'gpu'] + if args.os in ('ubuntu22', 'ubuntu24'): + args.device = ['cpu', 'gpu', 'npu'] else: - args.device = ['cpu', 'gpu'] # 2022.3 v/h not supported + args.device = ['cpu', 'gpu'] elif not args.device: args.device = ['cpu']