harfang3d / dogfight-sandbox-hg2

Air to air combat sandbox, created in Python 3 using the HARFANG 3D 2 framework.
GNU General Public License v3.0
153 stars 47 forks source link

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast #7

Open TUY3 opened 2 years ago

TUY3 commented 2 years ago

when i run python main.py , running to hg.RenderInit(Main.win, hg.RT_OpenGL), it give me an Error:

image

astrofra commented 2 years ago

Hi! I would need a bit more context about this issue. Are you running it on a Windows machine ? What is the hardware configuration (CPU, GPU) ?

astrofra commented 2 years ago

Also, I case you are running on Windows, can you try to switch to DirectX instead? For this you simply need to edit the config.json file (found at the root of the project) as following :

{
    "Resolution": [1920, 1080],
    "FullScreen": false,
    "OpenGL": false,
    "AntiAliasing": 4,
    "ShadowMap": true
}
TUY3 commented 2 years ago

I run it on Ubuntu18.04 with a 2080Ti, I try to modify the config file, but it doesn't work. How can i do to run it in renderless mode?

astrofra commented 2 years ago

I got it working on Ubuntu 20.04.4 LTS, both on the Intel HD internal graphics chipset and on a GeForce 750M GPU. Make sure that the Nvidia proprietary drivers are properly installed and enabled. And yes, sorry, in your case, when running on Linux, you HAVE to let the OpenGL flag set to True.

image

Regarding the renderless mode, it will still use the renderer for the main menu and will display the 2D radar, so it requires the GPU to be functionning. The way to use it is detailed here : https://github.com/harfang3d/dogfight-sandbox-hg2/blob/f174f1dc03e6c3033db61edb81e44b3393b3c383/documentation_network.md

TUY3 commented 2 years ago

I have tried to use the renderless mode, it runs fast. Can i modify the code to realize displaying nothing, because i just want to get the kinetics vector which used for RL training.

astrofra commented 2 years ago

Feel free to modify the code as you need. That's why the sandbox is open-source :) May I ask how you fixed the swrast error ?

TUY3 commented 2 years ago

I don't solve the problem on ubuntu, i run it on windows now. With respect to the renderless mode, i have some other troubles which the running speed is slowing down with time, i don't know why did it happend.