Reducing power consumption and optimizing CPU utilization in a multi-core architecture are key to satisfy the increasing demand of delivering sustained high-quality graphics meanwhile maintaining a lasting battery life. The new Vulkan API facilitates this and this blog covers a real demo recording showing the improvements on power efficiency and CPU usage that Vulkan provides compared to OpenGL ES.
Vulkan unifies graphics and compute across multiple platforms in a single API. Up to now, developers had OpenGL graphics API for desktop environments and OpenGL ES for mobile platforms. The GL APIs were designed for previous generations of GPU hardware and whilst the capabilities of hardware and technology evolved, the API evolution took a little bit longer. With Vulkan, the latest capabilities of modern GPUs can be exploited.
Vulkan gives developers far more control of the hardware resources than OpenGL ES. For instance, memory management in the Vulkan API is much more explicit than in previous APIs. Developers can allocate and deallocate memory in Vulkan, whereas in OpenGL the memory management is hidden from the programmer.
Vulkan API has a much lower CPU overhead compared to OpenGL ES thanks to supporting multithreading. Multithreading is a key feature for mobile as mainstream mobile devices generally have between four to eight cores.
On the left hand side of the video image, you can see the OpenGL ES CPU utilization at the bottom. The OpenGL ES API makes a single core CPU work very hard. On the right hand side, you can see the difference the Vulkan API brings with improved threading. The multithreading capability allows the system to balance the workload across multiple CPUs and to lower the voltage and frequency as well as enabling the code to run on little core CPUs.
Fig.1 Video screen capture, showcasing CPU utilisation
With regards to energy consumption, the video shows an energy dial on top which demonstrates the improved system efficiency that Vulkan brings. If we run the sequence up until the end and this is measured in a real SoC, the multithreading benefits bring a considerable saving in energy consumption. Even at this very early stage of software development on Vulkan, we could see an overall system power saving of around 15%.
Fig.2 Video screen capture, showcasing overall system power saving
Fig.3 Huawei Mate 9 Vulkan vs OpenGL ES demo comparison
(Picture source: Huawei Device Official Weibo:
http://www.weibo.com/huaweidevice)
On November the 3rd, soon after the making of the first video comparison between Vulkan and OpenGL ES, Huawei launched their new Mate 9 smartphone. This new generation smartphone is based on the latest SoC from HiSilicon, Kirin 960, which has a 180% GPU performance boost compared to Kirin 950. This is the very first mobile device using Mali-G71, our high performance GPU launched early in 2016, as well as ARM’s new Cortex-A73 CPU in a big.LITTLE® octacore configuration, delivering 18% faster performance. This cutting edge device also comes with the latest Android 7 Nougat, so it has native support for Vulkan.
The Huawei Mate 9 launch showcases a Vulkan demo, “The Machines”, from Directive Games. This demo features considerable performance uplift from OpenGL ES to Vulkan from 17FPS to 35FPS and Huawei claims that Vulkan boosts the power efficiency of their new devices by up to 400%.
To get you started using the Vulkan API, there is a wealth of developer resources here, from an SDK with sample code, to tutorials and developer tools to profile and debug your Vulkan application.