Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

WSL2:intel GPU supported in docker image ?

den6
Novice
7,926 Views

I built a docker image using the following Dockerfile.

 

 

 

FROM nvcr.io/nvidia/cuda:12.2.0-devel-ubuntu22.04

#########################################
# Tools
#########################################
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget curl ca-certificates gpg-agent software-properties-common && \
rm -rf /var/lib/apt/lists/*

#########################################
# intel graphics driver
#########################################
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,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | \
tee /etc/apt/sources.list.d/intel-gpu-jammy.list

#########################################
# ???
#########################################
#RUN curl -fsSL https://repositories.intel.com/graphics/intel-graphics.key | apt-key add -
#RUN echo "deb [trusted=yes arch=amd64] https://repositories.intel.com/graphics/ubuntu jammy main" > /etc/apt/sources.list.d/intel-graphics.list

RUN apt-get update && apt-get upgrade -y && apt-get install -y \
intel-opencl-icd intel-level-zero-gpu level-zero \
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo
RUN apt-get install -y \
libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev level-zero-dev

#########################################
# neo
#########################################
COPY neo.sh /root/
WORKDIR /root
RUN ./neo.sh

#########################################
# OneAPI base/hpc kit
#########################################
RUN curl -fsSL 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
RUN 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

RUN apt-get --fix-broken install -y
RUN apt-get update && apt-get upgrade -y && apt-get install -y intel-basekit
RUN apt-get update && apt-get upgrade -y && apt-get install -y intel-hpckit

RUN useradd render && gpasswd -a root render

 

 

 

neo.sh is as follows

 

 

 

#########################################
# neo.sh
#########################################
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.14828.8/intel-igc-core_1.0.14828.8_amd64.deb
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.14828.8/intel-igc-opencl_1.0.14828.8_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/23.30.26918.9/intel-level-zero-gpu-dbgsym_1.3.26918.9_amd64.ddeb
wget https://github.com/intel/compute-runtime/releases/download/23.30.26918.9/intel-level-zero-gpu_1.3.26918.9_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/23.30.26918.9/intel-opencl-icd-dbgsym_23.30.26918.9_amd64.ddeb
wget https://github.com/intel/compute-runtime/releases/download/23.30.26918.9/intel-opencl-icd_23.30.26918.9_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/23.30.26918.9/libigdgmm12_22.3.0_amd64.deb

wget https://github.com/intel/compute-runtime/releases/download/23.30.26918.9/ww30.sum
sha256sum -c ww30.sum

dpkg -i *.deb

 

 

 

docker run command is as follows

 

 

 

docker run --gpus all --device=/dev/dri -it --rm  $image

 

 

 

 

Same as this article, sycl-ls does not work in the docker image.

https://community.intel.com/t5/Intel-oneAPI-Base-Toolkit/WSL2-GPU-supported-in-docker-image/m-p/1454995

 

Any help would be greatly appreciated.

 

Labels (1)
12 Replies
Vipin_S_Intel
Moderator
7,871 Views

Hi Shinji, we are routing your query to the respective team for the further help. They will get back to you as soon as possible.



0 Kudos
den6
Novice
7,853 Views

Thank you for your prompt reply. I look forward to the support team's response.

0 Kudos
SeshaP_Intel
Moderator
7,824 Views

Hi,

 

Thank you for posting in Intel Communities.

 

Could you kindly provide a screenshot of the output when running the following command in WSL2:

sycl-ls

In order to detect the GPU using sycl-ls in the Docker image, it should be accessible within WSL2. If you haven't installed the oneAPI toolkits yet, please consider installing them in WSL2 before proceeding.

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
den6
Novice
7,808 Views

Screen shot of sycl-ls in WSL2.

sycl-ls-on-WlS2.png

 

This is in Docker.

sycl-ls-on-Docker.png

0 Kudos
den6
Novice
7,769 Views

Sorry I forget to exec "sh oneapi-for-nvidia-gpus-2023.2.1-cuda-12.0-linux.sh”.

After doing that, Nvidia gpu is dtetected.

 

sycl-ls-on-Docker-with-cuda.png

0 Kudos
den6
Novice
7,642 Views

Does anyone have any advice?
I would be very grateful if you could give me some advice.

0 Kudos
SeshaP_Intel
Moderator
7,583 Views

Hi,


We were able to reproduce the issue.

We are working on it internally. We will get back to you soon.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
den6
Novice
7,539 Views

Hi, 

 

Thank you kindly for your progress report !

I look forward to resolving the issue !

 

Thanks and Regards,

den6

0 Kudos
den6
Novice
7,106 Views

Hi,

 

I heard that OneAPI version 2024 has been released, but when I run ’apt list intel-basekit -a’, 2024 is still not displayed.
If I were able to update to 2024, would that solve the problem?

 

Thanks and Regards,

den6

0 Kudos
sebbalint
Beginner
6,621 Views

Hi den6 and dear Intel-Support-Team,


any updates on this matter or does someone know of a viable workaround?

I have been looking forward to using intel gpus in docker with wsl for a while now and have not been successful myself.


With kind regards,

sebbalint

0 Kudos
den6
Novice
6,513 Views

Hi, sebbalint


OneAPI 2024.0 is now installed with apt, so I tried it, but unfortunately there was no change in the situation.

I would appreciate it if you could let me know what you have tried.

Thanks and regards.
den6

0 Kudos
den6
Novice
3,676 Views

Hi everyone !

 

I succeeded in recognizing the Intel built-in GPU by executing docker run with the following options:

 

 

--device /dev/dxg --volume /usr/lib/wsl:/usr/lib/wsl 

 

 

sycl-ls output:

 

root@dcb28c3f8794:~/work/OneAPI/codeplay# sycl-ls
[opencl:cpu][opencl:0] Intel(R) OpenCL, 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000]
[opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Graphics [0x9a49] OpenCL 3.0 NEO  [24.13.29138.29]
[level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Graphics [0x9a49] 1.3 [1.3.29138]
[cuda:gpu][cuda:0] NVIDIA CUDA BACKEND, NVIDIA GeForce MX450 7.5 [CUDA 12.4]

 

 

0 Kudos
Reply