Vulkan Graphics API for future OS X

Discussion in 'macOS' started by leman, Mar 4, 2015.

  1. leman macrumors 604

    Oct 14, 2008
    I am surprised that this has not yet been covered in a broader fashion (it at least belongs on the MR newspage), so I decided to make a thread on a topic.

    In short, Khronos (the group managing OpenCL/OpenGL/OpenGL ES etc.) has announced its next-gen open-source cross-platform graphics API —Vulkan. It promises high-performance GPU games and applications, by offering a software abstraction that is more suitable for modern GPUs and giving fine-grained control over how graphics is rendered to the programmer. In addition, it is supposed to be a single API that rules them all — desktop, mobile, you name it. Same rendering code would run on Windows, Linux, Mac, Android and iOS, opening unprecedented possibilities for developers.

    Why is this important for the Mac community? Well,there are multiple reasons why Vulkan is an ideal API for OS X. First of all, its implementation model is extremely close to what Apple does today for its OpenGL stack. Second, it directly or indirectly leverages technologies that have been popularised (and in part, created) by Apple such as the LLVM compiler chain. Third, by simplifying and intelligently modularising the API, a Vulkan driver is much easier to write than an OpenGL driver and should also trivially deliver much higher application performance. It is also likely to seamlessly interact with OpenCL, as both share a number of technologies. For the software developer, Vulkan offers standard developer consistent behaviour and performance — something which has always been the biggest issue of OpenGL and ultimately the reason why OpenGL is not a popular choice among game developers.

    On practice, what this means are much more stable and speedy graphics drivers. With Vulkan, OS X should automatically gain GPU performance parity with Windows, which might make it more attractive for game developers.

    Despite some claims to the contrary, Apple obviously cares for graphical performance. Their introduction of Metal (an API that Vulkan will be fairly similar to) proves this. As a member of Khronos, there is no doubt that Apple took part in designing Vulkan. If the API spec is finalised before summer, I optimistically expect Apple to deliver Vulkan and OpenCL 2/2.1 with 10.11. This also gives them to opportunity to drop support for older GPUs, which is an ideal transition condition to a new graphical API. I would also expect them to freeze OpenGL, possibly implementing it on top of Vulkan in the future.
  2. lpetrich macrumors newbie

    Nov 26, 2009
    From what I've been able to learn about Vulkan, it seems to work much like Metal. WWDC 2014 Session Videos - Apple Developer has "Working with Metal: Fundamentals", which is a good introduction to it.

    One creates objects for the GPU, a command queue, command buffers, vertex buffers, texture buffers, etc. Unlike OpenGL, Vulkan has no global state.

    Vulkan was designed so that one can have several CPU threads working on several command buffers at the same time, thus taking advantage of multicore CPU chips.

    Vulkan uses a shader language called SPIR-V, an intermediate language much like Java bytecode. One would compile GLSL or whatever to make SPIR-V shaders. Since SPIR-V is much easier to parse than most programmer-friendly languages, that helps simplify Vulkan drivers. OpenGL currently accepts shaders as GLSL source, something that makes OpenGL drivers have to include GLSL compilers.

    OpenCL 2.1 also uses SPIR-V, something that helps there also.

    Vulkan is still being worked on, but so far, it can be much more efficient than OpenGL drivers.
  3. jblagden macrumors 65816


    Aug 16, 2013
    Since Vulkan is made for dedicated GPUs while Metal seems to be made more for integrated (CPU-based) GPUs, it will be a welcome change. Since most modern Macs can use Thunderbolt eGPUs and don’t have upgradeable processors, Vulkan would likely be welcomed by many Mac users. You can get an adequate GPU for around $100. A new Mac on the other hand, will be at least $500, if not $2000, depending on the Mac you choose.
  4. leman thread starter macrumors 604

    Oct 14, 2008
    I am afraid your reply is half a year too late :) Apple has appeared to drop out of the Vulcan bandwagon, for reasons unknown. Anyway, Metal works fine with dedicated GPUs after some minor adjustments and it seems like it's what Apple is investing into. It is far from being as low-level or feature-complete than Vukcan, but it's also much easier to program for, so there are obviously drawbacks and benefits.

    Also, I don't really understand your point about upgrading GPUs. You can't upgrade a GPU in a modern Mac. It only applies to a dwindling group of old Mac Pro owners.
  5. jblagden macrumors 65816


    Aug 16, 2013
    Okay. I was under the impression that Metal was only for integrated graphics. Which graphics cards are able to use Metal?

    My point about upgrading GPUs applies to anyone who owns a Mac which has a Thunderbolt port because Thunderbolt can be used for external GPUs.
  6. leman thread starter macrumors 604

    Oct 14, 2008
    Any Mac made in 2012 and later.

    AFAIK, OS X does not support this. Also, the only commercially available TB enclosure for GPUs is prohibitively expensive.
  7. jblagden, Oct 26, 2015
    Last edited: Oct 26, 2015

    jblagden macrumors 65816


    Aug 16, 2013
    Yeah, I knew that it's only for Macs made in 2012 and later. That's why I thought it was only for integrated graphics.

    By the way, there are less expensive enclosures. For one thing, Sonnet now has a $300 enclosure. Also, there's the Akitio Thunder2, which costs $220 and can be used for a GPU if you buy a better power supply, which should cost around $20 on eBay or Amazon. Through the PCIe slot, the Akitio Thunder2 can provide up to 75 watts. If you need more power, you'll need another power supply and a barrel to six-pin molex adapter.

    While it's true that OS X doesn't support it, it's possible to enable it by editing kext files. This process can even be automated with Besides, the reason why OS X doesn't support it out-of-the-box is likely due to some arm-twisting from Intel.

Share This Page