[webkit-dev] Feature announcement: WebCL

Antonio Gomes tonikitoo at webkit.org
Wed May 1 18:41:18 PDT 2013

On Wed, May 1, 2013 at 8:41 PM, Oliver Hunt <oliver at apple.com> wrote:

> On May 1, 2013, at 5:29 PM, Antonio Gomes <tonikitoo at webkit.org> wrote:
> - 4.3 Out-of-Range Memory Access
> The validator will perform static analysis on WebCL kernels to
> determine violations of WebCL kernel behavior and language restrictions.
> The results from the analysis will also be used to determine any
> necessary instrumentation to bring the WebCL kernels in compliance with
> security and syntactic requirements of the WebCL API.  The RFQ for the
> WebCL Validator located at
> https://cvs.khronos.org/wiki/index.php/WebCL_Validator provides
> information on the approach recommended by the WebCL working group.
> How do you statically verify the all memory accesses are within bounds
> without limiting a WebCL kernel to the functionality already offered by
> shaders in WebGL?

Basically there are three different cases to consider when adding checks to
a memory access:
1. We know at compile time that the access will be inside memory allocated
to the program.
2. We know at compile time the limits which the access must respect.
3. We don’t even know the limits at compile time (this causes most overhead
to support).

I think you are talking about 3? If that is the case, the WebCL validator
will handle this case.

> - 4.6 Prevention of potential denial of service (DoS) from long running
> kernels:
> This is addressed by the OpenCL CL_CONTEXT_TERMINATE extension. In
> http://www.khronos.org/registry/cl/specs/opencl-1.2-extensions.pdf ,
> please refer to section "9.16 Terminating OpenCL contexts".
> I haven't seen any real evidence of widespread support for responsive
> termination in WebGL shaders yet, and given that the same hardware is
> involved when you want GPU backed WebCL I don't see how much this will help.

First, from a GPU vendor perspective, OpenCL and OpenGL drivers are
different things.

When WebCL working group proposed this OpenCL security extension, it had to
pass through an internal approval process, by vote, where the Khronos
members, including GPU vendors,  approved it.

In the case of OpenGL/WebGL, I would prefer to defer to someone who is part
of these WGs to state on why it was not requested.

> It is chicken-egg problem: without Browser vendors commitment to WebCL,
> the  motivation for hardware vendors to implement, for example, OpenCL 1.2
> "Memory Initialization" and "Context termination" extensions, required by
> WebCL, is not as strong.
> The extensions mentioned above are required by WebGL shaders, and WebGL
> has been around for a lot longer (and has even more stringent requirements
> than WebCL) - are there any GPUs that support the WebGL restrictions
> natively?
> If you are talking about  GL_ARB_robustness, it is supported by NVIDIA and
Mesa3D, among others.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130501/ffdfb635/attachment.html>

More information about the webkit-dev mailing list