Post

Replies

Boosts

Views

Activity

Is Metal 4.1 `interleave` available on M4 Pro? Pipeline creation fails with "unlowered function call"
The Metal Shading Language Specification 4.1, section 6.4, lists interleave and deinterleave as "All OS: Metal 4.1 and later", with no GPU family restriction. The Metal Feature Set Tables list the M4 series as Apple9 and have no row for interleave. On an M4 Pro, a kernel that calls interleave compiles, but creating its compute pipeline fails. Which GPUs and macOS versions support interleave and deinterleave, and is the M4 family expected to? import Metal let src = """ #include <metal_stdlib> kernel void k(device const metal::uchar2 *a [[buffer(0)]], device metal::ushort *b [[buffer(1)]], uint i [[thread_position_in_grid]]) { b[i] = metal::interleave(a[i]); } """ let device = MTLCreateSystemDefaultDevice()! let options = MTLCompileOptions() options.languageVersion = .version4_1 let function = try! device.makeLibrary(source: src, options: options).makeFunction(name: "k")! do { _ = try device.makeComputePipelineState(function: function) print(device.name, "| pipeline created") } catch { print(device.name, "| pipeline failed:", error.localizedDescription) }The library compiles, but creating the pipeline fails. ushort2/uint, uint2/ulong and deinterleave fail the same way. Apple M4 Pro | pipeline failed: Encountered unlowered function call to air.interleave.i16. Verify device or GPU architecture supports this featureIf I replace the kernel line b[i] = metal::interleave(a[i]); with b[i] = metal::ushort(a[i].x) | (metal::ushort(a[i].y) << 8);, it prints Apple M4 Pro | pipeline created. Configuration Apple M4 Pro, macOS 27.2.1 (26B131), Xcode 27.1 (27A9275), Swift 6.4, metal 32023.921. Software Update shows nothing newer.
1
0
180
1w
Is Metal 4.1 `interleave` available on M4 Pro? Pipeline creation fails with "unlowered function call"
The Metal Shading Language Specification 4.1, section 6.4, lists interleave and deinterleave as "All OS: Metal 4.1 and later", with no GPU family restriction. The Metal Feature Set Tables list the M4 series as Apple9 and have no row for interleave. On an M4 Pro, a kernel that calls interleave compiles, but creating its compute pipeline fails. Which GPUs and macOS versions support interleave and deinterleave, and is the M4 family expected to? import Metal let src = """ #include <metal_stdlib> kernel void k(device const metal::uchar2 *a [[buffer(0)]], device metal::ushort *b [[buffer(1)]], uint i [[thread_position_in_grid]]) { b[i] = metal::interleave(a[i]); } """ let device = MTLCreateSystemDefaultDevice()! let options = MTLCompileOptions() options.languageVersion = .version4_1 let function = try! device.makeLibrary(source: src, options: options).makeFunction(name: "k")! do { _ = try device.makeComputePipelineState(function: function) print(device.name, "| pipeline created") } catch { print(device.name, "| pipeline failed:", error.localizedDescription) }The library compiles, but creating the pipeline fails. ushort2/uint, uint2/ulong and deinterleave fail the same way. Apple M4 Pro | pipeline failed: Encountered unlowered function call to air.interleave.i16. Verify device or GPU architecture supports this featureIf I replace the kernel line b[i] = metal::interleave(a[i]); with b[i] = metal::ushort(a[i].x) | (metal::ushort(a[i].y) << 8);, it prints Apple M4 Pro | pipeline created. Configuration Apple M4 Pro, macOS 27.2.1 (26B131), Xcode 27.1 (27A9275), Swift 6.4, metal 32023.921. Software Update shows nothing newer.
Replies
1
Boosts
0
Views
180
Activity
1w