GPU is used by Xwayland in Docker image

101 views Asked by At

I'm currently trying to use a docker image for training of a generative adversarial network. Unfortunately, when I try to run the skript, I get the following error:

[2023-07-29 11:02:47 @__init__.py:80] Saving logging to file: neuralgym_logs/20230729110247859123.
# gpu         pid  type    sm    mem    enc    dec    command
# Idx           #   C/G     %      %      %      %    name
    0         20     G     -     -     -     -   /Xwayland      
    0         22     G     -     -     -     -   /Xwayland      
    0         31     G     -     -     -     -   /Xwayland      

Traceback (most recent call last):
  File "test.py", line 23, in <module>
    ng.get_gpus(1)
  File "/usr/local/lib/python3.5/dist-packages/neuralgym/utils/gpus.py", line 70, in get_gpus
    ' [(gpu id: num of processes)]: {}'.format(sorted_gpus))
SystemError: No enough gpus for dedicated usage. [(gpu id: num of processes)]: [(0, 3)]

nvidia-smi also shows 3 Xwayland processes using the gpu.

I used the following base images in the Dockerfile:

FROM tensorflow/tensorflow:1.7.0-gpu-py3

and

FROM nvcr.io/nvidia/tensorflow:18.03-py3

both the same problem. Do I need to set a variable in the Dockerfile? I also don't understand, why Xwayland is even necessary, because I don't have a gui application running...

Thanks in advance!

1

There are 1 answers

0
Сирожиддин Саидмуродов On

I had similar problem, there was gpu usage when Docker Desktop is running on windows. I could fix it only after adding config file in %USERPROFILE%/.wslconfig with following content:

[wsl2]
guiApplications=false