gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.59k stars 921 forks source link

hello-compute tests fail on Raspberry Pi 4 #1583

Open cwfitzgerald opened 3 years ago

cwfitzgerald commented 3 years ago

Description

The output of the hello-compute tests is partially garbage.

Repro steps

Run WGPU_BACKEND=gl cargo test --example hello-compute -- --test-threads=1 --nocapture on a raspeberry pi 4.

Expected vs observed behavior

Expected: Correct tests Observed:

running 4 tests
test tests::test_compute_1 ... thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `[0, 2, 3, 4]`,
 right: `[0, 1, 7, 2]`', wgpu/examples/hello-compute/tests.rs:89:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
GOT EXPECTED TEST FAILURE: BACKEND | VENDOR | ADAPTER
ok
test tests::test_compute_2 ... thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `[5, 23, 10, 9]`,
 right: `[5, 15, 6, 19]`', wgpu/examples/hello-compute/tests.rs:89:9
GOT EXPECTED TEST FAILURE: BACKEND | VENDOR | ADAPTER
ok
test tests::test_compute_overflow ... thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `[350, 837799, 8400511, 63728127]`,
 right: `[350, 524, 4294967295, 4294967295]`', wgpu/examples/hello-compute/tests.rs:89:9
GOT EXPECTED TEST FAILURE: BACKEND | VENDOR | ADAPTER

Extra materials I expect this to be a driver bug, but we shouldn't rule out us messing up, or us being able to compensate in some way.

Platform raspbian buster running a compiled-from-source version of mesa dating like 4-6 months back.

kvark commented 3 years ago

The test works on AMD 3500U fwiw.

cwfitzgerald commented 3 years ago

And on an intel 620, so this is almost definitely a driver bug of some kind.

kvark commented 3 years ago

Barriers, perhaps?.. I.e. we need to double-check if we place them correctly there

cwfitzgerald commented 3 years ago

Turns out they are spurious failures on both VK and GL. Both possibly driver bugs.

Lokathor commented 1 year ago

I ran the tests just now using both the GL and the VK backends. There were no failures at all. I ran it five times just to check for intermittent failures, and both backends passed all five times.

lokathor@spiral:~/wgpu $ WGPU_BACKEND=gl cargo test --example hello-compute -- --test-threads=1 --nocapture
    Finished test [unoptimized + debuginfo] target(s) in 0.51s
     Running unittests examples/hello-compute/main.rs (target/debug/examples/hello_compute-fcdbd2ee7d2f3381)

running 4 tests
test tests::test_compute_1 ... ok
test tests::test_compute_2 ... ok
test tests::test_compute_overflow ... ok
test tests::test_multithreaded_compute ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.74s

lokathor@spiral:~/wgpu $ cargo test --example hello-compute -- --test-threads=1 --nocapture
    Finished test [unoptimized + debuginfo] target(s) in 0.51s
     Running unittests examples/hello-compute/main.rs (target/debug/examples/hello_compute-fcdbd2ee7d2f3381)

running 4 tests
test tests::test_compute_1 ... WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.
ok
test tests::test_compute_2 ... WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.
ok
test tests::test_compute_overflow ... WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.
ok
test tests::test_multithreaded_compute ... WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.
ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.81s
cwfitzgerald commented 1 year ago

These are hard skipped on v3d https://github.com/gfx-rs/wgpu/blob/master/wgpu/examples/hello-compute/tests.rs#L18 so it's not actually running the test

cwfitzgerald commented 1 year ago

This misunderstanding of test results are actually a pretty big problem in our test ux - I've been recently musing about how to make this better, unfortunately the default test harnesses is pretty limiting.

teoxoy commented 11 months ago

WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.

V3D seems to be conformant now, it would be worth checking again.

https://www.khronos.org/conformance/adopters/conformant-products

Lokathor commented 11 months ago

Are those drivers shown the versions in apt?

Because there's a significant time lag between the driver existing and it actually being in apt for standard users to install.