Palats / mapshot

Factorio mod to export maps as zoomable html
Apache License 2.0
77 stars 12 forks source link

Headless, OpenGL context: Could not create GL context: BadValue #8

Closed drouarb closed 3 years ago

drouarb commented 3 years ago

Hey,

I had a hard time running factorio with Xvfb on ubuntu, factorio keep crashing with the message

Failed to create OpenGL context: Could not create GL context: BadValue (integer parameter out of range for operation)

I found a workaround so i'm sharing it here. You can fix the OpenGL context by installing VirtualGL https://sourceforge.net/projects/virtualgl/files/

Then execute this script

#!/bin/bash

# Start Xvfb
Xvfb :0.0 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset &

# Set display and run with vglrun (virtualgl), add your mapshot args here
DISPLAY=:0 vglrun ./mapshot-linux render <args>

echo "Killing Xvfb"
jobs
kill %1
Palats commented 3 years ago

Thanks a lot for the suggestion & sharing! I've added a link to your comment in the README.