Extension OES_texture_float not supported on this browser

383 views
Skip to first unread message

Jordan Last

unread,
Jul 18, 2018, 9:24:37 PM7/18/18
to TensorFlow.js Discussion
Hi there,

So I'm working with a Raspberry Pi 3B, and I've got a model that I would like to run in Chromium on the Raspberry Pi. I've enabled the OpenGL driver, and when I do that the registration of the webgl backend fails with this error:

Error: Extension "OES_texture_float" not supported on this browser.

I've done some research into it, but I'm wondering if anyone has a workaround for this. It's a little bit of a bummer that this won't work in the browser on a Raspberry Pi. Thanks!

Jordan Last

unread,
Jul 18, 2018, 9:26:58 PM7/18/18
to TensorFlow.js Discussion
Also, come to think of it, is there going to be any way to access the GPU using TensorFlow.js on a Raspberry Pi? Even if I use the Node.js implementation, it doesn't look like there is a GPU backend that will work for the Raspberry Pi's GPU, since I'm pretty sure it does not support CUDA. Thoughts?

Nikhil Thorat

unread,
Jul 19, 2018, 1:38:18 PM7/19/18
to jordan.mi...@gmail.com, TensorFlow.js Discussion
TensorFlow (py + C) support CPU instructions, which you could use (without GPU).

For TensorFlow.js, unfortunately we removed ability to use integer textures very recently. Are you running the chromium headless?

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/eabceaec-8d4e-4934-8c97-c61dc26fb2cd%40tensorflow.org.

Jeremy Ellis

unread,
Jul 23, 2018, 2:27:43 PM7/23/18
to TensorFlow.js Discussion, jordan.mi...@gmail.com


Having some success with the standard chromium browser


sudo apt update
sudo apt install chromium-browser


Need to figure out how to get my webcam working in a browser on the raspberryPi3 to test some of the main demos


I made an altra basic test webpage here which just loads a model from the web and then runs it.  (model trained on y=2X+3)
 
but even some much more complex models seem to work.



polynomial.jpg

Jeremy Ellis

unread,
Jul 24, 2018, 11:33:12 PM7/24/18
to TensorFlow.js Discussion, jordan.mi...@gmail.com
My thoughts on the Raspberry Pi 3B with Tensorflowjs 

Most of Tensorflowjs runs, but the 1Gb limit kills many apps.

I used a reasonably fresh raspian and installed the chromium-browser

Adjust the GPU from default 128 Mb to 256 Mb see image (preferences --> performance --> GPU). I tried higher GPU settings of 512 and 1024 (actually maxed at 888 Mb) but the browser then became to slow to do anything. 

Most simple models loaded.

My teaching pages were fine 

MNIST froze the browser

Pacman, was not fun, the response was too slow to be useable

My Posenet worked, automatically updated about once every 10 seconds.

Mobilenet and Squeezenet worked. Took about 6 seconds to fully load.

Some of the demos worked like the polynomial and Iris

Typically not much fun as the wait time was huge, but it did work.

Pi-gpu.jpg

Nikhil Thorat

unread,
Jul 25, 2018, 10:19:57 AM7/25/18
to keyfre...@gmail.com, TensorFlow.js Discussion, Jordan Last
Just to give you some updates, I've been thinking about this a little bit.

Few questions:
- In your demo, Jeremy, are you definitely using the GPU? If you call tf.getBackend() do you get 'webgl'?
- Jordan, we actually just turned off integer textures recently in favor of higher-precision floats on iOS. However, it seems like are a non-trivial amount of devices with no float extension. If we go back to using integer textures, naively we'll be using fixed point precision which has quite bad precision overall. If we do proper IEEE float packing, it will be super expensive to run. I'm going to discuss this a little bit more with some folks here as it's a non trivial decision, though I think it will generally be very cool to support raspberry pis.

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.

Nikhil Thorat

unread,
Jul 25, 2018, 10:22:55 AM7/25/18
to keyfre...@gmail.com, TensorFlow.js Discussion, Jordan Last
One more question, which WebGL version is the raspberry running? You can find this by logging:
tf.ENV.get('WEBGL_VERSION')

Jeremy Ellis

unread,
Jul 25, 2018, 5:37:37 PM7/25/18
to TensorFlow.js Discussion, keyfre...@gmail.com, jordan.mi...@gmail.com
So that was interesting. The RPI3b runs webGL version 1 but my desktop computer runs version 2. See attached image of the RPI3 running my test demo

I tried setting the GPU memory (preferences --> performance --> GPU 128 is the default I typically use 256) to 0 to force only CPU but the RPI defaulted to a memory of 16 Mb and still ran webGL!

I may have to change a few demos that were not working well and try the command tf.setBackend('cpu') to see if they work a bit better or at all. 

Once again everything is fairly slow on the Raspberry Pi 3.



webgl.jpg

Jordan Last

unread,
Jul 26, 2018, 12:48:39 PM7/26/18
to TensorFlow.js Discussion, keyfre...@gmail.com, jordan.mi...@gmail.com
Are you using the OpenGL driver, configurable from raspi-config?

Jordan Last

unread,
Jul 26, 2018, 1:14:36 PM7/26/18
to TensorFlow.js Discussion, keyfre...@gmail.com, jordan.mi...@gmail.com
I'm using the latest Chromium available from the default Raspberry Pi repositories, Chromium 65, and I'm still getting my original issues with OES_texture_float support. Jeremy, if you haven't enabled the OpenGL driver, could you try enabling it and running your tests again? I think you'll run into the same WebGL issues as me if you do so. Run sudo raspi-config, go to advanced setting, GL driver, and enable the full kms driver. My theory is that with the OpenGL driver enabled, WebGL will perform much better. Unfortunately, enabling the driver breaks WebGL. So the original issue of this thread remains.

Jordan Last

unread,
Jul 26, 2018, 6:55:33 PM7/26/18
to TensorFlow.js Discussion, keyfre...@gmail.com, jordan.mi...@gmail.com
Should I open an issue on the main repo requesting the features necessary for tfjs and tfjs-node to work on the Raspberry Pi?

Nikhil Thorat

unread,
Jul 26, 2018, 11:15:55 PM7/26/18
to Jordan Last, TensorFlow.js Discussion, Jeremy Ellis
Filed an issue to track it: https://github.com/tensorflow/tfjs/issues/551

Basically the only thing we're functionally missing is a shader which can convert a vec4 of bytes which represent the 32 bit float back to a float, which is the reverse of this shader: https://github.com/tensorflow/tfjs-core/blob/master/src/kernels/webgl/encode_float_gpu.ts

That implementation was based on one I found online, but I haven't spent the time to think about the reverse. I don't have the cycles right now, but if you want to try to write the reverse shader I could definitely review a PR (you could just implement the shader, and I could do the rest of the wiring).

Jeremy Ellis

unread,
Jul 28, 2018, 3:18:53 AM7/28/18
to TensorFlow.js Discussion, keyfre...@gmail.com, jordan.mi...@gmail.com
To Jordan Last


Jeremy, if you haven't enabled the OpenGL driver, could you try enabling it and running your tests again? I think you'll run into the same WebGL issues as me if you do so. Run sudo raspi-config, go to advanced setting, GL driver, and enable the full kms driver. 
Sorry Jordan, I don't even like thinking about trying to break my RPI, I have spent enough time with broken Linux machines. I am however reaching out to the RPI community to see if a few others with RaspberryPi's could join in.

By the way, do you have a link to the main page that is giving you the shader issue? Can your setup run "tf.version.tfjs "?
 
Reply all
Reply to author
Forward
0 new messages