I'm not sure how to attach an Xcode project here, it won't let me select the Xcode project file (or folder) to attach.
But creating a command line app with single file main.m below gives me the output:
2022-12-12 18:49:36.578621-0500 counter test[70895:1590946] Metal GPU Frame Capture Enabled
2022-12-12 18:49:36.581789-0500 counter test[70895:1590946] Metal API Validation Enabled
2022-12-12 18:49:36.652955-0500 counter test[70895:1590946] Error Domain=com.apple.mtlrenderer Code=14 "out of memory" UserInfo={NSLocalizedDescription=out of memory}
Program ended with exit code: 1
Here's the file
#import <Foundation/Foundation.h>
#import <Metal/Metal.h>
int main() {
@autoreleasepool {
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
MTLCounterSampleBufferDescriptor * descriptor = [MTLCounterSampleBufferDescriptor new];
NSError * error = nil;
id<MTLCounterSampleBuffer> sample_buffer = [device newCounterSampleBufferWithDescriptor:descriptor error:&error];
if(sample_buffer == nil) {
NSLog(@"%@", error);
return 1;
} else {
return 0;
}
}
}
Let me know what else to provide. I also submitted the attachment on Feedback Assistant, but I'm not sure what numbers you're talking about.
Post
Replies
Boosts
Views
Activity
Oops, outside of that sample I've been setting all properties but missed sampleCount, and setting that it works. Leaving out sampleCount or counterSet gives the same out of memory error.
Thanks for your help
Does this mean 'Metal3' can indeed be relied upon (with that correction)?
For example, could I target Metal3 features rather than
Apple7, Apple8, Mac2 features? which GPU's supporting Metal3 don't support Apple7, Apple8, and Mac2? There must be some, as some Metal3 features don't exist for Mac2 (eg indirect compute commands).
On Wikipedia, for example, it says
"The M1 integrates an Apple designed[17] eight-core (seven in some base models) graphics processing unit (GPU). Each GPU core is split into 16 Execution Units, which each contain eight Arithmetic Logic Units (ALUs)."