Skip to content

Commit

Permalink
2.1.20+xpu docker update (#3887)
Browse files Browse the repository at this point in the history
* prepare docker with release candidate wheels.

* remove copy

* add IMAGE_TYPE

* Update README.md

* change build names
  • Loading branch information
sramakintel authored Mar 15, 2024
1 parent d3b9bee commit 8d5d715
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 51 deletions.
49 changes: 19 additions & 30 deletions docker/Dockerfile.prebuilt
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends --fix-missing \
apt-utils \
build-essential \
ca-certificates \
clinfo \
curl \
git \
gnupg2 \
gpg-agent \
rsync \
sudo \
unzip \
wget && \
apt-utils \
build-essential \
ca-certificates \
clinfo \
curl \
git \
gnupg2 \
gpg-agent \
rsync \
sudo \
unzip \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy unified" | \
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy/lts/2350 unified" | \
tee /etc/apt/sources.list.d/intel-gpu-jammy.list

ARG ICD_VER
Expand All @@ -56,7 +56,7 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN no_proxy=$no_proxy wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
| tee /etc/apt/sources.list.d/oneAPI.list
Expand All @@ -67,9 +67,11 @@ ARG CCL_VER

RUN apt-get update && \
apt-get install -y --no-install-recommends --fix-missing \
intel-oneapi-runtime-dpcpp-cpp=${DPCPP_VER} \
intel-oneapi-runtime-mkl=${MKL_VER} \
intel-oneapi-runtime-ccl=${CCL_VER}
intel-oneapi-runtime-dpcpp-cpp=${DPCPP_VER} \
intel-oneapi-runtime-mkl=${MKL_VER} \
intel-oneapi-runtime-ccl=${CCL_VER} && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ARG PYTHON
RUN apt-get update && apt install -y software-properties-common
Expand Down Expand Up @@ -112,16 +114,3 @@ RUN python -m pip install torch==${TORCH_VERSION} --extra-index-url ${TORCH_WHL_
python -m pip install oneccl_bind_pt==${ONECCL_BIND_PT_VERSION} --extra-index-url ${ONECCL_BIND_PT_WHL_URL}

ENV LD_LIBRARY_PATH=/opt/intel/oneapi/lib:/opt/intel/oneapi/lib/intel64:$LD_LIBRARY_PATH

ARG UNAME
ARG GID
ARG GNAME=render
ARG VNAME=video

RUN useradd -m -s /bin/bash $UNAME

RUN groupadd -g $GID $GNAME

RUN usermod -a -G $VNAME,$GNAME $UNAME

USER $UNAME
12 changes: 6 additions & 6 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ docker build -f docker/Dockerfile.compile --build-arg GID_RENDER=$(getent group
Alternatively, `./build.sh` script has docker build command to install prebuilt wheel files, update all the relevant build arguments and execute the script. Run the command below in current directory.

```bash
export IMAGE_TYPE="xpu"
./build.sh
```
To pull docker images use the following command:

```bash
docker pull intel/intel-extension-for-pytorch:xpu
docker pull intel/intel-extension-for-pytorch:2.1.20-xpu
```
### Running container:

Run the following commands to start Intel® Extension for PyTorch\* GPU container. You can use `-v` option to mount your
local directory into the container. The `-v` argument can be omitted if you do not need
access to a local directory in the container. Pass the video and render groups to your
docker container so that the GPU is accessible.
access to a local directory in the container.

```
IMAGE_NAME=intel/intel-extension-for-pytorch:xpu
IMAGE_NAME=intel/intel-extension-for-pytorch:2.1.20-xpu
```
```bash
docker run --rm \
Expand Down Expand Up @@ -88,8 +88,8 @@ python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch

Sample output looks like below:
```
2.1.0a0+cxx11.abi
2.1.10+xpu
2.1.0.post0+cxx11.abi
2.1.20+xpu
[0]: _DeviceProperties(name='Intel(R) Data Center GPU Max 1550', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=1, total_memory=65536MB, max_compute_units=512, gpu_eu_count=512)
[1]: _DeviceProperties(name='Intel(R) Data Center GPU Max 1550', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=1, total_memory=65536MB, max_compute_units=512, gpu_eu_count=512)
[2]: _DeviceProperties(name='Intel(R) Data Center GPU Max 1550', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=1, total_memory=65536MB, max_compute_units=512, gpu_eu_count=512)
Expand Down
29 changes: 14 additions & 15 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
#!/bin/bash

if [[ ${IMAGE_NAME} != "" ]]; then
if [[ ${IMAGE_TYPE} = "xpu" ]]; then
IMAGE_NAME=intel/intel-extension-for-pytorch:2.1.20-$IMAGE_TYPE
docker build --build-arg http_proxy=$http_proxy \
--build-arg https_proxy=$https_proxy \
--build-arg no_proxy=" " \
--build-arg NO_PROXY=" " \
--build-arg UNAME=ubuntu \
--build-arg GID=$(getent group render | sed -E 's,^render:[^:]*:([^:]*):.*$,\1,') \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg PYTHON=python3.10 \
--build-arg ICD_VER=23.30.26918.50-736~22.04 \
--build-arg LEVEL_ZERO_GPU_VER=1.3.26918.50-736~22.04 \
--build-arg LEVEL_ZERO_VER=1.13.1-719~22.04 \
--build-arg LEVEL_ZERO_DEV_VER=1.13.1-719~22.04 \
--build-arg DPCPP_VER=2024.0.0-49819 \
--build-arg MKL_VER=2024.0.0-49656 \
--build-arg TORCH_VERSION=2.1.0a0+cxx11.abi \
--build-arg IPEX_VERSION=2.1.10+xpu \
--build-arg TORCHVISION_VERSION=0.16.0a0+cxx11.abi \
--build-arg TORCHAUDIO_VERSION=2.1.0a0+cxx11.abi \
--build-arg ICD_VER=23.43.27642.40-803~22.04 \
--build-arg LEVEL_ZERO_GPU_VER=1.3.27642.40-803~22.04 \
--build-arg LEVEL_ZERO_VER=1.14.0-744~22.04 \
--build-arg LEVEL_ZERO_DEV_VER=1.14.0-744~22.04 \
--build-arg DPCPP_VER=2024.1.0-958 \
--build-arg MKL_VER=2024.1.0-688 \
--build-arg CCL_VER=2021.12.0-307 \
--build-arg TORCH_VERSION=2.1.0.post0+cxx11.abi \
--build-arg IPEX_VERSION=2.1.20+xpu \
--build-arg TORCHVISION_VERSION=0.16.0.post0+cxx11.abi \
--build-arg TORCHAUDIO_VERSION=2.1.0.post0+cxx11.abi \
--build-arg ONECCL_BIND_PT_VERSION=2.1.200 \
--build-arg TORCH_WHL_URL=https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \
--build-arg IPEX_WHL_URL=https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \
--build-arg TORCHVISION_WHL_URL=https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \
--build-arg TORCHAUDIO_WHL_URL=https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \
--build-arg CCL_VER=2021.11.1-6 \
--build-arg ONECCL_BIND_PT_VERSION=2.1.100 \
--build-arg ONECCL_BIND_PT_WHL_URL=https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \
-t ${IMAGE_NAME} \
-f Dockerfile.prebuilt .
Expand Down

0 comments on commit 8d5d715

Please sign in to comment.