gfx-rs / wgpu

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

I can only render things after reinstalling NVIDIA drivers and before rebooting my system #3881

Closed VCode28629 closed 3 months ago

VCode28629 commented 1 year ago

Description I found that I can only render things after reinstalling NVIDIA drivers and before rebooting. After I reboot my system, I need to reinstalling NVIDIA drivers or wgpu renders nothing.

It seems that vulkan is used defaultly, and cargo nextest run --no-fail-fast goes slow(over 10 min) when testing something like player::test test_api or skybox.

I'm working on Win10,

GPU 1 AMD Radeon(TM) Graphics driver: 27.20.11032.6002 driver update date: 2020/12/28 DirectX: 12 (FL 12.1) GPU 2 NVIDIA GeForce GTX 1650 Ti driver: 31.0.15.3623 driver update date: 2023/6/8 DirectX: 12 (FL 12.1)

By the way, there is my test after reinstalling NVIDIA drivers and before rebooting my system, I CAN render things now.

D:\Users\VCode\Desktop\caht\wgpu>cargo nextest run --no-fail-fast
    Finished test [unoptimized + debuginfo] target(s) in 0.39s
    Starting 103 tests across 27 binaries (1 skipped)
        PASS [   0.041s] wgpu-core identity::test_epoch_end_of_life
        PASS [   0.094s] wgpu context::tests::object_safe
        PASS [   0.047s] wgpu-core id::test_id_backend
        PASS [   0.099s] wgpu macros::test_vertex_attr_array
        PASS [   0.095s] wgpu tests::range_to_offset_size_panics_for_empty_range
        PASS [   0.091s] wgpu tests::range_to_offset_size_panics_for_unbounded_empty_range
        PASS [   0.067s] wgpu-core command::bind::compat::test_compatibility
        PASS [   0.088s] wgpu tests::range_to_offset_size_works
        PASS [   0.061s] wgpu-core id::test_id
        PASS [   0.045s] wgpu-core init_tracker::test::check_for_drained_tracker
        PASS [   0.035s] wgpu-core init_tracker::test::check_for_partially_filled_tracker
        PASS [   0.031s] wgpu-core init_tracker::test::discard_adds_range_on_cleared
        PASS [   0.045s] wgpu-core init_tracker::test::check_for_newly_created_tracker
        PASS [   0.024s] wgpu-core init_tracker::test::discard_merges_ranges
        PASS [   0.020s] wgpu-core init_tracker::test::drain_already_drained
        PASS [   0.016s] wgpu-core init_tracker::test::drain_never_returns_ranges_twice_for_same_range
        PASS [   0.043s] wgpu-core init_tracker::test::discard_does_nothing_on_uncleared
        PASS [   0.039s] wgpu-core init_tracker::test::discard_extends_ranges
        PASS [   0.023s] wgpu-core track::range::test::isolate
        PASS [   0.040s] wgpu-core instance::downlevel_default_limits_less_than_default_limits
        PASS [   0.036s] wgpu-core test_gcd
        PASS [   0.044s] wgpu-core init_tracker::test::drain_splits_ranges_correctly
        PASS [   0.028s] wgpu-core track::range::test::sane_empty
        PASS [   0.071s] wgpu-core test_lcd
        PASS [   0.056s] wgpu-core track::range::test::sane_good
        PASS [   0.052s] wgpu-core track::range::test::sane_intersect
        PASS [   0.067s] wgpu-core track::range::test::coalesce
        PASS [   0.065s] wgpu-hal dx12::test_dirty_mask
        PASS [   0.057s] wgpu-hal test_default_limits
        PASS [   0.066s] wgpu-hal gles::adapter::tests::test_version_parse
        PASS [   0.068s] wgpu-hal vulkan::command::check_dst_image_layout
        PASS [   2.127s] wgpu-capture-example::bin/capture tests::ensure_generated_data_matches_expected
        PASS [   9.352s] wgpu-skybox-example::bin/skybox skybox_astc
        PASS [   3.511s] wgpu-skybox-example::bin/skybox skybox_etc2
        FAIL [  14.789s] wgpu-hello-compute-example::bin/hello-compute tests::test_multithreaded_compute

--- STDOUT:              wgpu-hello-compute-example::bin/hello-compute tests::test_multithreaded_compute ---

running 1 test
test tests::test_multithreaded_compute ... FAILED

failures:

failures:
    tests::test_multithreaded_compute

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out; finished in 14.18s

--- STDERR:              wgpu-hello-compute-example::bin/hello-compute tests::test_multithreaded_compute ---
[2023-06-21T01:22:09Z ERROR wgpu_hal::vulkan::instance] enumerate_adapters: A return array was too small for the result
thread 'tests::test_multithreaded_compute' panicked at 'A thread never completed.: Timeout', examples\hello-compute\src\tests.rs:105:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tests::test_multithreaded_compute' panicked at 'UNEXPECTED TEST FAILURE DUE TO PANIC', D:\Users\VCode\Desktop\caht\wgpu\tests\src\lib.rs:332:9

        PASS [  25.794s] player::test test_api
        PASS [  30.432s] wgpu-hello-compute-example::bin/hello-compute tests::test_compute_overflow
        PASS [  30.463s] wgpu-hello-compute-example::bin/hello-compute tests::test_compute_2
        PASS [  30.467s] wgpu-hello-compute-example::bin/hello-compute tests::test_compute_1
        PASS [   2.277s] wgpu-test::wgpu-tests clear_texture::clear_texture_astc
        FAIL [  34.346s] wgpu-msaa-line-example::bin/msaa-line msaa_line

--- STDOUT:              wgpu-msaa-line-example::bin/msaa-line msaa_line ---

running 1 test
Starting image comparison test with reference image "D:\Users\VCode\Desktop\caht\wgpu\examples\common/../..//examples/msaa-line/screenshot.png"
        Mean: 0.044724
        Min Value: 0.000000
              25%: 0.132042
              50%: 0.226964
              75%: 0.301959
              95%: 0.380933
              99%: 0.428187
        Max Value: 0.570951
        Expected Mean (0.044724) to be under expected maximum (0.065): PASS
        Expected 50% (0.226964) to be under expected maximum (0.29): PASS
test msaa_line ... FAILED

failures:

failures:
    msaa_line

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 34.21s

--- STDERR:              wgpu-msaa-line-example::bin/msaa-line msaa_line ---
[2023-06-21T01:22:09Z ERROR wgpu_hal::vulkan::instance] enumerate_adapters: A return array was too small for the result
thread 'msaa_line' panicked at 'UNEXPECTED TEST PASS: FailureReasons(BACKEND | VENDOR)', D:\Users\VCode\Desktop\caht\wgpu\tests\src\lib.rs:330:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [  34.808s] wgpu-boids-example::bin/boids boids
        PASS [   4.144s] wgpu-test::wgpu-tests clear_texture::clear_texture_etc2
        PASS [  39.144s] wgpu-skybox-example::bin/skybox skybox
        PASS [  37.380s] wgpu-skybox-example::bin/skybox skybox_bc1
        PASS [   8.965s] wgpu-test::wgpu-tests buffer_usages::buffer_usage
        PASS [  39.377s] wgpu-shadow-example::bin/shadow shadow
        PASS [  39.773s] wgpu-cube-example::bin/cube cube_lines
        PASS [  39.777s] wgpu-cube-example::bin/cube cube
        PASS [  25.066s] wgpu-test::wgpu-tests buffer::test_map_offset
        PASS [   0.398s] wgpu-test::wgpu-tests example_wgsl::parse_example_wgsl
        PASS [   7.372s] wgpu-test::wgpu-tests clear_texture::clear_texture_d32_s8
        PASS [   0.836s] wgpu-test::wgpu-tests instance::initialize
        PASS [   2.409s] wgpu-test::wgpu-tests device::device_initialization
        PASS [   2.135s] wgpu-test::wgpu-tests instance::request_adapter_high_power
        PASS [   2.001s] wgpu-test::wgpu-tests instance::request_adapter_low_power
        PASS [  11.192s] wgpu-test::wgpu-tests clear_texture::clear_texture_bc
        PASS [   2.579s] wgpu-test::wgpu-tests encoder::drop_encoder
        PASS [   3.221s] wgpu-test::wgpu-tests clear_texture::clear_texture_uncompressed
        PASS [  17.093s] wgpu-test::wgpu-tests buffer_copy::copy_alignment
        PASS [   2.200s] wgpu-test::wgpu-tests poll::wait
        PASS [   2.680s] wgpu-test::wgpu-tests poll::double_wait
        PASS [   2.493s] wgpu-test::wgpu-tests poll::double_wait_on_submission
        PASS [   1.850s] wgpu-test::wgpu-tests poll::wait_on_submission
        PASS [   1.741s] wgpu-test::wgpu-tests poll::wait_out_of_order
        PASS [   9.311s] wgpu-test::wgpu-tests clear_texture::clear_texture_depth
        PASS [   1.752s] wgpu-test::wgpu-tests resource_error::bad_buffer
        PASS [   1.916s] wgpu-test::wgpu-tests queue_transfer::queue_write_texture_overflow
        PASS [   2.031s] wgpu-test::wgpu-tests resource_descriptor_accessor::buffer_size_and_usage
        PASS [   1.919s] wgpu-test::wgpu-tests resource_error::bad_texture
        PASS [   2.808s] wgpu-test::wgpu-tests regression::issue_3457::pass_reset_vertex_buffer
        PASS [   2.368s] wgpu-test::wgpu-tests shader::numeric_builtins::numeric_builtins
        PASS [   1.618s] wgpu-test::wgpu-tests transfer::copy_overflow_z
        PASS [  46.682s] wgpu-conservative-raster-example::bin/conservative-raster conservative_raster
        PASS [   3.201s] wgpu-test::wgpu-tests shader_primitive_index::draw
        PASS [   3.158s] wgpu-test::wgpu-tests shader_view_format::reinterpret_srgb_ness
        PASS [   3.182s] wgpu-test::wgpu-tests shader_primitive_index::draw_indexed
        PASS [   2.288s] wgpu-test::wgpu-tests vertex_indices::draw
        PASS [   4.389s] wgpu-test::wgpu-tests shader::struct_layout::push_constant_input
        PASS [   4.542s] wgpu-test::wgpu-tests shader::struct_layout::storage_input
        PASS [  47.346s] wgpu-mipmap-example::bin/mipmap mipmap
        PASS [  48.377s] wgpu-bunnymark-example::bin/bunnymark bunnymark
        PASS [   3.061s] wgpu-test::wgpu-tests vertex_indices::draw_instanced
        PASS [   4.583s] wgpu-test::wgpu-tests shader::zero_init_workgroup_mem::zero_init_workgroup_mem
        PASS [   5.076s] wgpu-test::wgpu-tests shader::struct_layout::uniform_input
        PASS [   2.465s] wgpu-test::wgpu-tests vertex_indices::draw_instanced_offset
        PASS [   2.301s] wgpu-test::wgpu-tests write_texture::write_texture_subset_3d
        PASS [   2.805s] wgpu-test::wgpu-tests vertex_indices::draw_vertex_offset
        LEAK [   2.747s] wgpu-test::wgpu-tests zero_init_texture_after_discard::discarding_color_target_resets_texture_init_state_check_visible_on_copy_in_same_encoder
        LEAK [   2.772s] wgpu-test::wgpu-tests zero_init_texture_after_discard::discarding_color_target_resets_texture_init_state_check_visible_on_copy_after_submit
        LEAK [   2.434s] wgpu-test::wgpu-tests zero_init_texture_after_discard::discarding_either_depth_or_stencil_aspect
        PASS [   2.606s] wgpu-test::wgpu-tests zero_init_texture_after_discard::discarding_depth_target_resets_texture_init_state_check_visible_on_copy_in_same_encoder
        PASS [   2.908s] wgpu-test::wgpu-tests write_texture::write_texture_subset_2d
        PASS [   1.132s] wgpu-types test_physical_size
        PASS [   1.128s] wgpu-types texture_format_deserialize
        PASS [   1.112s] wgpu-types texture_format_serialize
        PASS [   1.592s] wgpu-types test_max_mips
        PASS [  10.975s] wgpu-test::wgpu-tests clear_texture::clear_texture_uncompressed_gles_compat
        PASS [   6.164s] wgpu-test::wgpu-tests texture_bounds::bad_copy_origin
        PASS [  37.430s] wgpu-stencil-triangle-example::bin/stencil-triangles stencil_triangles
        PASS [  16.163s] wgpu-texture-arrays-example::bin/texture-arrays texture_arrays_non_uniform
        PASS [  15.366s] wgpu-texture-arrays-example::bin/texture-arrays texture_arrays_uniform
        PASS [  14.822s] wgpu-water-example::bin/water water
------------
     Summary [  64.348s] 103 tests run: 101 passed (3 leaky), 2 failed, 1 skipped
        FAIL [  14.789s] wgpu-hello-compute-example::bin/hello-compute tests::test_multithreaded_compute
        FAIL [  34.346s] wgpu-msaa-line-example::bin/msaa-line msaa_line
error: test run failed
teoxoy commented 11 months ago
[2023-06-21T01:22:09Z ERROR wgpu_hal::vulkan::instance] enumerate_adapters: A return array was too small for the result

VK_INCOMPLETE = "A return array was too small for the result" (ref)

Since ash v0.33.2 we should no longer observe VK_INCOMPLETE when calling enumerate_physical_devices (https://github.com/ash-rs/ash/pull/465).

We updated to ash v0.34 in https://github.com/gfx-rs/wgpu/commit/890f326461169eb566a779e6138a534d8f55b5c2 which is part of all wgpu releases starting with v0.13.

Which wgpu version are you running?

Wumpf commented 5 months ago

@VCode28629 ping. Can you confirm or disconfirm that this was fixed?