question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add WebGL Support

See original GitHub issue

Hello,

I spent all day experimenting and got WebGL working with headless shell. See the thumbnails here: https://www.reddit.com/r/pplay/ - they are rendered by lambda function from webgl scene.

To enable WebGL:

  1. I built osmesa using this script: https://github.com/devernay/osmesa-install . I changed disable_shared to enable_shared (line 534) to create libOSMesa32.so file). On EC2 instance, then final file was called libMangledOSMesa32 - just copy it next to the headless chrome binary as libosmesa.so.
  2. Remove disable-gpu flag, and tweak serverless-plugin-chrome, so that libosmesa.so is included into distribution.

PS: I don’t remember whether I used headless_shell from this repository.It might be from https://github.com/universalbasket/aws-lambda-chrome But still - the WebGL in AWS lambda is possible, and I’m very happy to share it 😃.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:42 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rthomps7commented, Jul 20, 2018

@vsantosu

I was hoping you still had that build somewhere. @mvoropaiev pointed out the link doesn’t work.

I tried what @anvaka suggested without any luck. I have a zip with both headless_shell and libosmesa.so in there. The headless_shell works, but things fail with webgl.

Here are my CLI args:

args: [
              '--use-gl=osmesa',
              '--enable-webgl',
              '--hide-scrollbars',
              '--mute-audio',
              '--no-sandbox',
              '--single-process',
              '--disable-breakpad',
              '--ignore-gpu-blacklist',
              '--homedir=/tmp',
              '--data-path=/tmp/data-path',
              '--disk-cache-dir=/tmp/cache-dir'
]

I’m actually firing this up with Puppeteer. The same command works locally, but I get errors on the lambda. My lambda works fine for non-webgl stuff.

1reaction
whyvezcommented, Jun 14, 2018

Has anyone had experience using swiftshader instead of mesa when no GPU available?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a WebGL Implementation
WebGL 1.0 is supported in the stable releases of most major browsers on both desktop and mobile platforms. Chrome, Firefox, Internet Explorer, Opera,...
Read more >
Getting started with WebGL development - Unity - Manual
To build a WebGL application, you must first install the Unity Hub and then add the WebGL Build Support module. See how install...
Read more >
downloading webGL module - Unity Forum
I'm trying to download the WebGL module. I clicked the button in build settings and it takes me here: http://download.unity3d.com/unity/f.
Read more >
How to turn on WebGL in my browser - Human Support
Chrome offers full support for WebGL on all platforms, so if you are having trouble running WebGL on Chrome, you simply may need...
Read more >
Activate WebGL on my computer - Assistance VR Offshore
To find out if WebGL is enabled in your browser, go to http://get.webgl.org/. To enable WebGL on your browser: Chrome: type "about: flags"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found