BUG: WebGPU finds no adapter on Linux when a DRM card has no vendor file (ONNX Runtime 1.24.4)

Open Beginner friendly
#2,303 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, rust

Research direction

Read scripts/onnxruntime/fetch-runtimes.py and build.rs to see how Linux ONNX Runtime versions and hashes are selected. Update the Linux runtime to at least 1.25.1 for both architectures, then refresh the corresponding hashes. Done means Linux builds bundle the newer runtime and the WebGPU adapter is discovered on systems with a DRM card that lacks a vendor file.

Written by the indexing model from the issue text.

Description

What happened?

Follow-up to #2280: @CyberTimon asked me to test the WebGPU support for the AI models from 8e84c0aa on Linux.

On my machine the AI models stay on the CPU even with "Use GPU for AI models" on. app.log says:

[WARN] WebGPU acceleration for AI models is unavailable: no WebGPU adapter was found

The cause is in the bundled ONNX Runtime 1.24.4, not in RapidRAW. Its Linux GPU discovery reads /sys/class/drm/card*/device/vendor and gives up on the first card that has no such file, so it reports no GPUs at all and the WebGPU plugin has no device to offer. Here that card is an evdi (DisplayLink) device. ONNX Runtime logs:

GPU device discovery failed: device_discovery.cc:92 ReadFileContents Failed to open file: "/sys/class/drm/card3/device/vendor"
What did you expect to happen?

The AI models run on the GPU through WebGPU.

They do once that card is hidden from the process (a private mount namespace with a copy of /sys/class/drm without card3): the log shows AI models use WebGPU through .../libonnxruntime_providers_webgpu.so, and a headless export of a 24 MP image with AI denoise takes 10 s instead of 88 s on the CPU, with output within 3/255 of the CPU result.

How can we reproduce this?
  1. Linux with a DRM card that has no device/vendor file in sysfs, for example a DisplayLink adapter with evdi loaded (sudo modprobe vkms probably does the same; not tried).
  2. Turn on "Use GPU for AI models" and run AI denoise.
  3. app.log shows the warning above, and denoise runs on the CPU.

The same check without RapidRAW, using the bundled plugin and pip install onnxruntime==1.24.4:

import onnxruntime as ort
ort.register_execution_provider_library("WebGpuExecutionProvider", "/path/to/libonnxruntime_providers_webgpu.so")
print([d.ep_name for d in ort.get_ep_devices()])  # only CPUExecutionProvider
Operating System

Other Linux (Arch Linux)

RapidRAW Version

main at 70c3e369, built from source (after v1.7.1)

Additional information
  • NVIDIA driver 620.73.04.
  • With the same 0.6.0 WebGPU plugin, 1.24.4 and 1.25.0 find no GPUs here, while 1.25.1, 1.26.0, 1.27.0, 1.28.0, 1.29.0, 1.30.0, 1.31.1 and 1.32.0 all list them (checked with the device listing above).
Suggested fix

Bump the Linux runtime to ONNX Runtime 1.25.1 or later; 1.25.1 is the first release that handles such cards. It is the smallest step up from 1.24.4, and the Microsoft.ML.OnnxRuntime 1.25.1 NuGet package has both linux-x64 and linux-arm64 builds.

Tested in RapidRAW: with the linux-x64 libonnxruntime.so from that package in place of the bundled one, and card3 left as it is, the log shows AI models use WebGPU through ... and the 24 MP AI denoise export takes 10 s instead of 88 s with the switch off. The GPU output is byte-identical to the 1.24.4 GPU run with the card hidden, and within 3/255 of the CPU result.

This can stay Linux-only, the way macOS already has ORT_MACOS_VERSION: for example an ORT_LINUX_VERSION = "1.25.1" in scripts/onnxruntime/fetch-runtimes.py for the two Linux libonnxruntime.so entries, then the new hashes in build.rs. The WebGPU plugin can stay at 0.6.0, and Windows (DirectML) and Android are unaffected.

As far as I can tell RapidRAW can't work around this in its own code: the plugin only gets a device through ONNX Runtime's hardware discovery.

Acknowledgement
  • My issue is unrelated to camera/lens support.
  • I have searched all existing issues, both open and closed, and did not find a duplicate.

🤖 Generated with Claude Code

Dominant language
TypeScript
Stars
10.4k
Forks
592
Avg merge
1d 16h
Merged PRs (30d)
37

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 CyberTimon/RapidRAW

All issues in CyberTimon/RapidRAW

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.