denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.96k stars 5.23k forks source link

Unexpected backend Vulkan #24844

Open db213 opened 1 month ago

db213 commented 1 month ago

Hi there,

I'm trying to use deno as an environment to run tests that require a GPU device. However, I'm running into the following error whenever I try to run them. The command I'm using is

DENO_DISABLE_PEDANTIC_NODE_WARNINGS=1 RUST_BACKTRACE=full deno test **/*.gpu-test.ts --unstable-webgpu --unstable-sloppy-imports

and the output is

$ DENO_DISABLE_PEDANTIC_NODE_WARNINGS=1 RUST_BACKTRACE=full deno test **/*.gpu-test.ts --unstable-webgpu --unstable-sloppy-imports
running 1 test from ./packages/engine/src/pipelines/__tests__/selection-pipeline.gpu-test.ts
makeSelectionPipeline ...
  exists and its id = "selection" ...
============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 1.45.2
Args: ["deno", "test", "**/*.gpu-test.ts", "--unstable-webgpu", "--unstable-sloppy-imports"]

thread 'tokio-runtime-worker' panicked at ext/webgpu/lib.rs:452:5:
Unexpected backend Vulkan
stack backtrace:
   0:        0x105e7af68 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7fda799bfa435f0f
   1:        0x1050e8a18 - core::fmt::write::h149c43f8c649a127
   2:        0x105e697ec - std::io::Write::write_fmt::hc658f220ee6401ee
   3:        0x105e7adc4 - std::sys_common::backtrace::print::hd320cb51e23d85e7
   4:        0x105e7615c - std::panicking::default_hook::{{closure}}::h2a019217d59e304e
   5:        0x105e75e30 - std::panicking::default_hook::h7115745ac0da2b42
   6:        0x1050524fc - deno::setup_panic_hook::{{closure}}::h07df5a82c6247caf
   7:        0x105e76e64 - std::panicking::rust_panic_with_hook::hcaae50c6a8446a46
   8:        0x105e7b2dc - std::panicking::begin_panic_handler::{{closure}}::h3511e01278c0eee1
   9:        0x105e7b244 - std::sys_common::backtrace::__rust_end_short_backtrace::hb40ac48f98b88c7f
  10:        0x105e76850 - _rust_begin_unwind
  11:        0x1050ef0e0 - core::panicking::panic_fmt::hd81673e1b116ffee
  12:        0x105b1ca04 - deno_webgpu::op_webgpu_request_adapter::op_webgpu_request_adapter::v8_fn_ptr_metrics::h4854d9cc28136acb
error: script "gputest" exited with code 1

It is only reliably reproducible on my machine, others I am working with have not had the same issue.

We have exactly one test file that we're trying to run so far, but I don't think it's even getting as far as really trying to run it. If it's useful I can copy in the source code for the test.

Could use some help as I'm pretty stumped!

crowlKats commented 1 month ago

@db213 as a temporary workaround, could you try running with DENO_WEBGPU_BACKEND=metal?

db213 commented 1 month ago

@db213 as a temporary workaround, could you try running with DENO_WEBGPU_BACKEND=metal?

Great yes this fixes the issue for me, thank you!

lucacasonato commented 3 weeks ago

@db213 Are you on a Hackintosh?

db213 commented 3 weeks ago

@db213 Are you on a Hackintosh?

Yes, I'm on a Mac, an M1. My coworkers who are not having this issue are on M2s or M3s.