I have a single graphics card in a remote headless ubuntu server.
I have set nvidia-xconfig to make a virtual display.
I need virtual x server, but not xvfb, to run a unity game headless, yet record a video of rendering of the game.
Xvfb does work fine, but it does not use graphics card, which makes rendering very slow.
This works fine with xinit if I run a single game.
xinit ./game.x86_64
Starts game and renders game play without any problem.
However, when I try to start multiple games simultaneously with different x-servers:
xinit ./game1.x86_64 -- :0
xinit ./game2.x86_64 -- :1
This does not render properly. One of the game (the one that started first) does not render. (Checked with the recorded video) As far as I know, this is because a single graphics card can only have a single x-server running.
Then, I set multiple screens by tweaking xorg.conf and tried
xinit ./game1.x86_64 -- :0.0
xinit ./game2.x86_64 -- :0.1
However, since xinit tries to start a new server, the latter one does not work, telling there's already an x-server running at X:0
If I search for multiple monitor x-server setting, what I can find is real monitor setup only, yet what I need is virtual monitor setup.
Is there a way to start multiple applications that need a screen in a headless server?
What I think I need to know is
A way to start a x-server with multiple screens and tell the application to use which screen OR
A way to use windows manager remotely on console
If there's any better solutions, or if I have missed something, it would be really helpful too.
question from:
https://stackoverflow.com/questions/65870117/how-to-run-multiple-applications-that-need-x-server-in-headless-ubuntu-server 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…