Skip to content

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

Open

Description

@MiniX16

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions