Open biwugang opened 4 years ago
Yes, the problem is that the docker container needs access to the XWindow environment in order to enable GPU. This requires the use of vglrun, for which our containers are not yet ready. Let me see if i can make this easier.
Hi, it looks like I was completely wrong with what I wrote above as virtualgl does not yet provide a mechanism to access the GPU without running an X server. It looks like you will have to undertake the following steps:
Make sure that the DISPLAY environment variable is pointing to your local X service. Make sure that you have the rights to display something on the local X service.
For example for me to run the emulator in a container over ssh I do the following:
DISPLAY=:0 sudo service lightdm restart
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo xhost +
./run-with-gpu.sh $CONTAINER_ID
Let me know if this helps.
Some more background on how to run X headless can be found on this blog.
@pokowaka
Thanks for your help! My Linux version is Ubuntu 18.04 and the X manager is gdm3. I try to execute
DISPLAY=:0 sudo service gdm3 restart
DISPLAY=:0 XAUTHORITY=/var/run/gdm3/root/:0 sudo xhost +
the result is
No protocol specified
xhost: unable to open display ":0"
@pokowaka I followed your instructions:
DISPLAY=:0 sudo service lightdm restart
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo xhost +
./run-with-gpu.sh $CONTAINER_ID
and the result is:
localuser:root being added to access control list
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 109 (X_ChangeHosts)
Value in failed request: 0x5
Serial number of failed request: 6
Current serial number in output stream: 8
cat: /root/.emulator_console_auth_token: No such file or directory
b313fef60192be544ae734ed65ae1a06a6d3d05d3d7d316f529a6705bc9f9a77
Hello,
run-with-gpu.sh must be executed on Linux local session?
When I login the local linux, it can execute run-with-gpu.sh successfully. But when I login thorugh ssh, run-with-gpu.sh return fail! And I have tried to execute run-with-gpu.sh in crontab task, it also failed.
the error log is as following: