Give your Web App superpowers by using GPUs

Speck&Tech
Speck&TechSpeck&Tech
Speck&Tech 55
Give your Web App
superpowers by using GPUs
Hi, IÕm Giulio! !
" → #
$ % & '
@giuliozausa
I think GPUs are cool
Give your Web App superpowers by using GPUs
Skia
GPU Accelerated
2D Engine
(used by Chrome)
GPUs are insanely parallel processors
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Ok but I build websites,
how does this affects me?
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Figma
React & C++
2D GPU accelerated
Multi-level tile-based
rendering
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Challenges
Giant documents with thousands of parts
The entire document can be viewed at once
Everything at 60 FPS on medium-end hardware
Electrical properties calculation
Always running SPICE circuit simulator
Collaborative real-time multiplayer
Give your Web App superpowers by using GPUs
The OpenGL Pipeline
Shaders: vertex attributes
• Position (vec3)
• UV coord (vec2)
• Normal Vector (vec3)
• É
[posX,posY,posZ,uvX,uvY,nrmX,nrmY,nrmZ, posX,posY,posZ,uvX,uvY,nrmX,nrmY,nrmZ, ...]
Vertex Data:
Index Data:
|0 |1 |2
[0,2,1, 1,2,3, 2,4,3]
Shaders with GLSL
https://slidetodoc.com/objectives-simple-shaders-vertex-shader-fragment-shaders-programming/
Vertex + Fragment Shader
For each Vertex For each Pixel
Vertex Shader
Fragment Shader
Tooling & Ecosystem
Give your Web App superpowers by using GPUs
≈60 LOC
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
CPU/GPU Bottleneck
PCIe + RPC
Overhead
CPU/GPU Bottleneck
4kb 10000x drawMesh()
10000 instances
GPU
4kb x 10000
= 40mb
for (instance in instances) {
drawMesh(instance);
}
CPU/GPU Bottleneck 33 FPS
for (instance in instances) {
drawMesh(instance);
}
Instanced Rendering
4kb drawMeshes(10000)
10000 instances
GPU
4kb
for (instance in instances) {
drawMesh(instance);
}
drawMeshes(instances);
Instanced Rendering 120 FPS
for (instance in instances) {
drawMesh(instance);
}
drawMeshes(instances);
Instanced Rendering at scale
Index "T"
109,169,0
121,196,0
133,194,252
...
...
Ok, but what about
number crunching?
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Almost every browser Chrome/Edge only (for now)
Low Level Even Lower Level
One context per <canvas> Independent from <canvas>
GLSL Shading Language (C++ like) WGSL Shading Language (Rust like)
Fixed pipeline Customisable pipeline
Suitable for General Purpose
Computing!
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
Thank you!
Give your Web App superpowers by using GPUs
WebGPU: API
WGSL
2D Rendering: Text
https://css-tricks.com/techniques-for-rendering-text-with-webgl/
2D Rendering: Text
https://css-tricks.com/techniques-for-rendering-text-with-webgl/
Signed Distance Functions
https://css-tricks.com/techniques-for-rendering-text-with-webgl/
Multichannel Signed Distance Functions
Multichannel Signed Distance Functions
1 de 60

Mais conteúdo relacionado

Similar a Give your Web App superpowers by using GPUs

Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
1.1K visualizações16 slides
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
441 visualizações16 slides
Computing using GPUsComputing using GPUs
Computing using GPUsShree Kumar
392 visualizações24 slides

Similar a Give your Web App superpowers by using GPUs(20)

Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
Arka Ghosh1.1K visualizações
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
Arka Ghosh1 visão
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
Arka Ghosh441 visualizações
SDVIs and In-Situ Visualization on TACC's StampedeSDVIs and In-Situ Visualization on TACC's Stampede
SDVIs and In-Situ Visualization on TACC's Stampede
Intel® Software1K visualizações
Computing using GPUsComputing using GPUs
Computing using GPUs
Shree Kumar392 visualizações
Writing 3D Applications Using ruby-processingWriting 3D Applications Using ruby-processing
Writing 3D Applications Using ruby-processing
Preston Lee2K visualizações
Developing Next-Generation Games with Stage3D (Molehill) Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill)
Jean-Philippe Doiron1.8K visualizações
A funtro to real-time ray-tracingA funtro to real-time ray-tracing
A funtro to real-time ray-tracing
Péter Ádám Wiesner245 visualizações
Transparent GPU Exploitation for JavaTransparent GPU Exploitation for Java
Transparent GPU Exploitation for Java
Kazuaki Ishizaki1.2K visualizações
Introduction to GPUs for Machine LearningIntroduction to GPUs for Machine Learning
Introduction to GPUs for Machine Learning
Sri Ambati1.8K visualizações
Html5 Game Development with CanvasHtml5 Game Development with Canvas
Html5 Game Development with Canvas
Pham Huy Tung930 visualizações
Optimizing unity games (Google IO 2014)Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)
Alexander Dolbilov39K visualizações
The Visual Computing CompanyThe Visual Computing Company
The Visual Computing Company
Grupo Texium418 visualizações
GPU accelerated path rendering fastforwardGPU accelerated path rendering fastforward
GPU accelerated path rendering fastforward
Mark Kilgard1.2K visualizações
Capstone Project Final PresentationCapstone Project Final Presentation
Capstone Project Final Presentation
Matthew Chang801 visualizações
Cuda meetup presentation 5Cuda meetup presentation 5
Cuda meetup presentation 5
Rihards Gailums626 visualizações
Html5 devconf nodejs_devops_shubhraHtml5 devconf nodejs_devops_shubhra
Html5 devconf nodejs_devops_shubhra
Shubhra Kar841 visualizações

Mais de Speck&Tech(20)

Why LLMs should be handled with careWhy LLMs should be handled with care
Why LLMs should be handled with care
Speck&Tech83 visualizações
Privacy in the era of quantum computersPrivacy in the era of quantum computers
Privacy in the era of quantum computers
Speck&Tech202 visualizações
Machine learning with quantum computersMachine learning with quantum computers
Machine learning with quantum computers
Speck&Tech212 visualizações
Innovating WoodInnovating Wood
Innovating Wood
Speck&Tech140 visualizações
Truck planning: how to certify the right routeTruck planning: how to certify the right route
Truck planning: how to certify the right route
Speck&Tech228 visualizações
Space is open for businessSpace is open for business
Space is open for business
Speck&Tech176 visualizações
Building large science space projectsBuilding large science space projects
Building large science space projects
Speck&Tech161 visualizações
Log Stealers - Shopping time for Threat Actors!Log Stealers - Shopping time for Threat Actors!
Log Stealers - Shopping time for Threat Actors!
Speck&Tech363 visualizações
Design beyond deliverablesDesign beyond deliverables
Design beyond deliverables
Speck&Tech192 visualizações
Why you should get a worse computerWhy you should get a worse computer
Why you should get a worse computer
Speck&Tech228 visualizações

Último(20)

METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation24 visualizações
.conf Go 2023 - SIEM project @ SNF.conf Go 2023 - SIEM project @ SNF
.conf Go 2023 - SIEM project @ SNF
Splunk178 visualizações
Green Leaf Consulting: Capabilities DeckGreen Leaf Consulting: Capabilities Deck
Green Leaf Consulting: Capabilities Deck
GreenLeafConsulting177 visualizações
ThroughputThroughput
Throughput
Moisés Armani Ramírez31 visualizações
AMD: 4th Generation EPYC CXL DemoAMD: 4th Generation EPYC CXL Demo
AMD: 4th Generation EPYC CXL Demo
CXL Forum123 visualizações
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman22 visualizações
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver24 visualizações
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum120 visualizações
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web Developers
Maximiliano Firtman161 visualizações

Give your Web App superpowers by using GPUs