COMPOTE: Working On HMM/Compute For Open-Source NVIDIA Driver

Written by Michael Larabel in Nouveau on 10 August 2017 at 11:03 AM EDT. Add A Comment
The long-awaited Heterogeneous Memory Management (HMM) work for the Linux kernel may be a step closer to mainlining now that Nouveau patches are in the works for this functionality as part of a seemingly new compute effort for this open-source NVIDIA driver.

HMM has long been in development and NVIDIA has been preparing to support their binary Linux driver with this new API while now open-source NVIDIA work via Nouveau is moving in this direction. As a reminder, this is about allowing device memory to be transparently used by any device process and to mirror process address space on a device. NVIDIA's GPUs now fully support this behavior, AMD can make use of HMM too if desired, and other areas of interest from FPGAs to other CUDA/OpenCL implementations. There's been a push to get the HMM patches mainline the past few kernel cycles, but it hasn't happen yet, in part for open-source "users" of this HMM functionality.

With this Nouveau implementation is also a related effort called "Compote" where they are working on bringing up compute support. The experimental Nouveau Compote Kconfig option explains, "Compote provide experimental API for GPU compute outside of nouveau reguler userspace API. It is experimental and it should not be use for any production development." The commit also explains, "Starting with Kepler GPU we can do unified memory for compute. With Pascal we can even transparently share the same virtual address space on the GPU as on the CPU. Compote is an attempt to prototype a new set of API for userspace to leverage those features."

There doesn't appear to be much of Compote yet as a Nouveau GPGPU compute-side implementation but most of the code so far is in regards to memory setup. Besides Jérôme Glisse of Red Hat working on this code, Ben Skeggs at Red Hat who is the Nouveau DRM maintainer has been working on the Nouveau bits including setting up code for virtual memory management.

This new, experimental code based off of HMM v25 can be found via this Git branch. Glisse also setup a Compote Git repository where he's working on the basics of the user-space API interface.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week