Programming Metal in OSX

  1. MTLLibrary can only be used if any .metal files are available. Else it throws runtime error “failed assertion `Metal default library not found’”. Define it only when you are using the source.
  2. One cannot use newBufferWithBytesNoCopy with memory allocated using malloc. Only vm_allocate or mmap can be used.
  3. The size of a buffer should not exceed 256MB. And there is no limit on number of buffers used. The cap is 261 buffers on my Mac Mini (8GB DDR3, 1536MB framebuffer). This sums up to 261*256MB. After running on 10MB chunks, around 67.6 GB of GPU memory has been allocated. When was the last time you heard of such a big GPU memory? (The biggest I heard was 12GB).
How many 258MB chunks of GPU memory is allocated
Around 6760 of 10MB chunks are allocated making up to 67.6 GB of GPU memory.

Seems like Apple is updating their Metal Programming Guide Docs. New features to MTLDevice has been added yesterday (5 July 2015).

depth24Stencil8PixelFormatSupported Required Property (New in OS X 10.11)

headless Required Property (New in OS X 10.11)

lowPower Required Property (New in OS X 10.11)

Like what you read? Give Aditya Atluri a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.