I suggest you to read the comprehensive article "Optimizing Parallel Reduction in Metal for Apple M1" from Matthew Kieber-Emmons : https://kieber-emmons.medium.com/optimizing-parallel-reduction-in-metal-for-apple-m1-8e8677b49b01
Post
Replies
Boosts
Views
Activity
You can use __fp16 or _Float16 data types.
__fp16 is not an arithmetic data type and should be used for storage purposes. It allows conversion from and to floats.
_Float16 is an arithmetic data type and have supports for standard operations.
_Float16 is more modern and a better choice. You can set a half constant with the f16 suffix following your real number.
Thanks Ceylo, I'll give it a try, the next time I suspect such a situation!
If applicable, in the case I detect any remaining activity, could it be attached to a killed application?
An in this case, would it not be occuring below any monitoring?
I have exactly the same error on a M1 Max (MacBook Pro 16") :
Execution of the command buffer was aborted due to an error during execution. Invalid Resource (00000009:kIOGPUCommandBufferCallbackErrorInvalidResource)
There is no crash, only a slowdown when the log is displayed.
MTKView has a colorspace property. And to paraphrase Apple documentation :
The default value is nil, indicating that the rendered content isn’t color-matched. If you set this to a different color space, Core Animation performs any necessary color transformations when compositing the view’s contents.
Sorry, I meant wantsExtendedDynamicRangeContent and not maximumExtendedDynamicRangeColorComponentValue
And a direct construction of the CGImage via:
CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)url, nil);
CGImageRef image = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL);
contains 8bits components too...
And finally, it seems that
CGImageRef cgImage = imageRep.CGImage;
destroys the original representation, as CGImageGetBitsPerComponent(cgImage) returns 8 (initially 10) and CGImageGetBitsPerPixel(cgImage) 32 (initially 40).
I have the exact same annoying messages...