Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

WSL2: GPU supported in docker image ?

Ticino
Beginner
3,883 Views

According to using-containers-with-the-command-line 

 

image=intel/oneapi-basekit
# --device=/dev/dri enables the gpu (if available). May not be available in Linux VM or Windows
docker run --device=/dev/dri -it "$image"

 

the gpu should be available in the docker image. 

I use WSL2 and gpu is available

$ sycl-ls
[opencl:acc:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device 1.2 [2022.15.12.0.01_081451]
[opencl:cpu:1] Intel(R) OpenCL, 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz 3.0 [2022.15.12.0.01_081451]
[opencl:gpu:2] Intel(R) OpenCL HD Graphics, Intel(R) Graphics [0x9a49] 3.0 [22.49.25018.21]
[ext_oneapi_level_zero:gpu:0] Intel(R) Level-Zero, Intel(R) Graphics [0x9a49] 1.3 [1.3.25018]

but not in the docker image.

root@cddfbb46417c:/# sycl-ls
[opencl:acc:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device 1.2 [2022.15.12.0.01_081451]
[opencl:cpu:1] Intel(R) OpenCL, 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz 3.0 [2022.15.12.0.01_081451]

 

0 Kudos
6 Replies
ShanmukhS_Intel
Moderator
3,844 Views

Hi Werner,


Thanks for posting on Intel communities.


You can get the GPU in docker by installing GPU drivers in the Docker file using the below commands


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 focal main" > /etc/apt/sources.list.d/intel-graphics.list


and then install intel-opencl-icd intel-level-zero-gpu level-zero level-zero-dev through apt-get command.


Best Regards,

Shanmukh.SS


0 Kudos
Ticino
Beginner
3,776 Views

Thank you for your answer, I installed the additional packages but unfortunately it did not work, any idea ?

0 Kudos
handaryn
Beginner
2,391 Views

HI i'm trying to get a docker container to use my intel integrated gpu to for transcoding but no luck, when i add /dev/dri the container fails to load, i have installed all that's above  but still no luck. I'm tuning ubuntu 22.10.

 

any help would be much appreciated as this is all new to me.

 

regards Ryan 

0 Kudos
ShanmukhS_Intel
Moderator
3,752 Views

Hi Werner,


You can mount the folder while starting the Docker container, it helps you in finding the GPU. Could you please try this and update us if it works,


Best Regards,

Shanmukh.SS



0 Kudos
ShanmukhS_Intel
Moderator
3,689 Views

Hi Werner,


A gentle reminder:

Could you please confirm whether your issue is resolved? Please let us know if you need any other information.


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
3,635 Views

Hi Werner,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Best Regards,

Shanmukh.SS


0 Kudos
Reply