# WebGPU vs CUDA

> CUDA is NVIDIA's native programming interface. WebGPU is the web standard that lets a page use the graphics card. They overlap in what they can do, but they are not the same thing.

<https://stresspc.com/guides/webgpu-vs-cuda/>

## The short answer

A web page cannot use CUDA. CUDA is a native interface from NVIDIA that is available to installed programs, and browsers do not expose it to web pages. A page can use **WebGPU**, a web standard that gives access to the graphics processor for drawing and for general-purpose computing. On an NVIDIA card, WebGPU compute shaders run on the same GPU cores that CUDA uses, through the Vulkan or Direct3D 12 driver, but with fewer features and less tuning.

## What is CUDA?

CUDA is a programming platform by NVIDIA for running general calculations on its graphics cards. It includes a compiler, libraries for linear algebra, deep learning and video, and tools for profiling. Most machine learning frameworks and many scientific programs use it. It works only with NVIDIA hardware, and only in programs that you install.

## What is WebGPU?

WebGPU is a modern web interface for graphics and compute. It sits on top of the native graphics interfaces of the operating system: Direct3D 12 on Windows, Metal on macOS and iOS, and Vulkan on Linux and Android. Programs written for it use a shading language called WGSL. Because it is built into the browser, it works on NVIDIA, AMD, Intel and Apple graphics without installing anything.

## How they compare

| | CUDA | WebGPU |
| --- | --- | --- |
| Where it runs | Installed programs | Web pages and browsers |
| Vendor support | NVIDIA only | NVIDIA, AMD, Intel, Apple, and others |
| Installation | Driver plus toolkit | Nothing, if the browser supports it |
| Performance | Highest; tuned libraries and direct hardware access | Lower; extra layers and safety checks, no vendor libraries |
| Special hardware | Tensor cores, ray tracing hardware and more | Mostly not exposed |
| Libraries | cuBLAS, cuDNN and many others | Few, usually written by hand |
| Safety | Full access to the machine | Sandboxed, with limits on memory and run time |

## Which is faster?

For heavy work, CUDA with vendor libraries is usually clearly faster. It gives the programmer tight control over memory and specialised units, and WebGPU deliberately hides much of that for safety and portability. For simple calculations, the gap can be smaller. The exact difference depends on the program, the card and the driver, so avoid taking any single number as a general rule.

## What the browser compute test shows

The [compute test](https://stresspc.com/cuda-stress-test/) multiplies 512×512 single-precision matrices with a WebGPU compute shader, reports the speed in GFLOPS and compares results with a reference calculated on the CPU. This tells you:

- that the GPU can run a sustained compute load without crashing;
- that the results are correct, which exposes unstable overclocks, overheating and failing video memory;
- roughly how your card compares with other cards on the same simple kernel.

## What it does not tell you

- **It is not a CUDA benchmark.** GFLOPS from this test is far below the theoretical figure for the card, because the kernel is simple and unoptimised.
- **It does not predict machine learning speed.** Real workloads depend on libraries, memory bandwidth and tensor cores, which the test does not use.
- **It does not read temperatures or clocks.** Use a monitoring tool.

Use it as a stability and comparison test. A downloadable test with real CUDA is planned for people who need to measure the native performance of an NVIDIA card.

## Related tests

If your question is about stability and not computing, the [GPU stress test](https://stresspc.com/gpu-stress-test/) draws a heavy scene and is closer to what a game does. The full procedure is in [how to stress test a GPU](https://stresspc.com/guides/how-to-stress-test-gpu/). More about how the site is built is on the [about page](https://stresspc.com/about/).
