GPU tests on Linux run on SwiftShader instead of the real GPU

Open
#121 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
playwright, typescript
Domain
testing

Research direction

Start with the launchOptions.args in packages/runntime/vitest.config.ts and bench/vitest.config.ts, which currently pass only --enable-unsafe-webgpu. Run pnpm --filter runntime test:gpu on Linux and check navigator.gpu.requestAdapter(); it should report SwiftShader with shader-f16 missing. Done means that on Linux with a Vulkan driver the adapter is the real GPU with no skipped tests, while macOS and Windows keep their current args. Wait for a maintainer to confirm the Linux-only flag change before opening a PR.

Written by the indexing model from the issue text.

Description

Area

Core (engine, ops, kernels)

Description

On Linux, pnpm --filter runntime test:gpu does not run on the machine's GPU. Headless Chromium launched with only --enable-unsafe-webgpu (packages/runntime/vitest.config.ts) gets a SwiftShader adapter, the CPU fallback, which has no shader-f16. Nothing says so: the shader-f16 cases skip with their reason and the run looks like a normal one.

Same machine, same code (the branch of #120), 1849 tests:

adapter passed skipped failed time
SwiftShader (current config) 858 949 35 338 s
AMD GPU (with the flags below) 1840 0 1 47 s

On SwiftShader half the suite is skipped, and the 35 failures are timeouts, SwiftShader rounding and leak lists written for the f16 routes. #57 was found on the real GPU, where main fails 97 tests.

bench/vitest.config.ts has the same problem, so bench:ab on Linux measures SwiftShader.

The real GPU needs both --enable-features=Vulkan and --use-angle=vulkan. Either one alone still gives SwiftShader.

Steps to reproduce
  1. On Linux with a Vulkan driver, run pnpm --filter runntime test:gpu.
  2. 949 tests are skipped. navigator.gpu.requestAdapter() in that browser reports google / swiftshader, shader-f16 missing.
  3. Add '--enable-features=Vulkan', '--use-angle=vulkan' to launchOptions.args and run again: the adapter is the GPU, with shader-f16, and nothing is skipped.

Proposed fix: add those two flags to both vitest configs only when process.platform === 'linux', so macOS and Windows keep their current setup. I don't know if the current config is meant to fall back to SwiftShader on Linux, so I'll wait for your confirmation: if this sounds right, let me know and I'll open the PR.

Platform

Browser (please name which one)

ruNNtime version

0.2.0 (main, 43053ee, plus #120)

Browser

Chromium 156.0.8078.4 (Playwright, headless)

Operating system

Arch Linux, kernel 7.2.2

GPU

AMD Radeon 610M (Mendocino, RDNA2, PCI 1002:1506), Mesa 26.2.1 RADV

WebGPU features

shader-f16, subgroups

AI model

No response

Console output and performance logs

Acknowledgements

Yes

Dominant language
TypeScript
Stars
121
Forks
7
Avg merge
3d 12h
Merged PRs (30d)
48

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from software-mansion/runntime

All issues in software-mansion/runntime

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.