-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quad example cannot run on Metal #2058
Comments
My rustc is 1.26.0 (a77568041 2018-05-07) |
Could you provide the backtrace as mentioned in the error message? i.e.: Also, which version of macOS are you running? |
macOS sierra version 10.12.6 |
there is the backtrace: Date/Time: 2018-05-22 07:36:20.188 +0800 Sleep/Wake UUID: 2B45BD0D-0620-4F5E-967B-1ECD4A9FC770 Time Awake Since Boot: 270000 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Termination Signal: Segmentation fault: 11 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread Thread 1: Thread 2: Thread 3: Thread 0 crashed with X86 Thread State (64-bit): Logical CPU: 4 Binary Images: External Modification Summary: VM Region Summary:
REGION TYPE SIZE COUNT (non-coalesced) Model: MacBookPro11,4, BootROM MBP114.0177.B00, 4 processors, Intel Core i7, 2.2 GHz, 16 GB, SMC 2.29f24 |
Thanks! Is that the backtrace you get when running the example with
? I thought it would be in that backtrace. I'm trying to see which selector is failing – maybe we are accidentally using a feature that was added in Metal 2, since the quad example runs fine on my Macbook (on 10.13.4). |
2018-05-22 10:26:45.746 quad[30921:3786940] -[MTLComputePipelineDescriptorInternal buffers]: unrecognized selector sent to instance 0x7fc04ec2dbc0
fatal runtime error: failed to initiate panic, error 5 |
Ok great, this is helpful. Thanks! It looks like it's simply the So it seems like we should just avoid this optimization for older macOS/iOS/tvOS, unless there is another way to set mutability (cc @kvark and #1999) |
It seems like we can reliably feature detect this case (and other selectors) with the following: MTLComputePipelineDescriptor *desc = [MTLComputePipelineDescriptor new];
BOOL supportsBuffers = [desc respondsToSelector:@selector(buffers)]; This is preferable to version checking IMO. I don't know how this fits into our Metal bindings though. Maybe we simply have |
2325: [mtl] New vertex binding logic r=grovesNL a=kvark Fixes #2324 Fixes #2307 Fixes #2058 (unrelated to the PR, but harmless) PR checklist: - [ ] `make` succeeds (on *nix) - [x] `make reftests` succeeds - [x] tested examples with the following backends: metal - [ ] `rustfmt` run on changed code Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Short info header:
cargo run --bin quad --features metal
Compiling hal-examples v0.1.0 (file:///Users/inmath/GitHub/gfx/examples/hal)
Finished dev [unoptimized + debuginfo] target(s) in 9.17 secs
Running
/Users/inmath/GitHub/gfx/target/debug/quad
2018-05-21 23:56:50.472 quad[28500:3579820] -[MTLComputePipelineDescriptorInternal buffers]: unrecognized selector sent to instance 0x7fad8d5324e0
thread 'main' panicked at 'called
Option::unwrap()
on aNone
value', libcore/option.rs:335:21note: Run with
RUST_BACKTRACE=1
for a backtrace.fatal runtime error: failed to initiate panic, error 5
Abort trap: 6
The text was updated successfully, but these errors were encountered: