Skip to content

Commit

Permalink
Add NPU packages to Ubuntu 22
Browse files Browse the repository at this point in the history
  • Loading branch information
culhatsker committed Jul 29, 2024
1 parent ac11cae commit 36cf4fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
10 changes: 10 additions & 0 deletions templates/ubuntu22/hw/npu.dockerfile.j2
Original file line number Diff line number Diff line change
@@ -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/*
16 changes: 8 additions & 8 deletions utils/arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
)

Expand Down Expand Up @@ -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'

Expand All @@ -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']

Expand Down

0 comments on commit 36cf4fe

Please sign in to comment.