How do I enable WebGL in headless chrome in Ubuntu?

后端 未结 1 1111
礼貌的吻别
礼貌的吻别 2020-11-29 09:39

How do I enable webgl or install webgl in headless chrome in Ubuntu 14? I tried installing libosmesa6, but that did not help.

Can someone please point me in the righ

相关标签:
1条回答
  • 2020-11-29 10:25

    This worked for me to get chrome to use osmesa

    sudo apt-get install libosmesa
    sudo ln -s /usr/lib/x86_64-linux-gnu/libOSMesa.so.6 /opt/google/chrome/libosmesa.so
    google-chrome --no-first-run --user-data-dir=~/chrome-stuff --use-gl=osmesa
    

    Warning: When running with osmesa the entire page is rendered with osmesa making it pretty slow. So, if there are tests you have that can run without WebGL you probably want to run them without osmesa.

    Also note that chrome itself uses osmesa to headless test but it uses a specific version. At the time of this answer it was version 9.0.3. It also makes a few changes listed here

    Otherwise to run headless in general I found this

    https://gist.github.com/addyosmani/5336747

    0 讨论(0)
提交回复
热议问题