Persistent Memory Programming Part 3: Intro to the NVM Libraries

Intel’s Andy Rudoff describes persistent memory and delves into why there’s so much activity around it in the industry lately. Andy describes how persistent memory is connected to a computer platform, how it performs, and what are some of the challenges for programmers. Andy is a Non-volatile Memory Software Architect and a member of the SNIA (Storage Networking Industry Association) Non-volatile Memory Programming Technical Work Group.

Hi, I'm Andy Rudolph from Intel. Both Windows and Linux exposed persistent memory to applications as memory mapped files allowing direct load store access. In this video I'll introduce the NVM libraries which provide convenient APIs as for using that persistent memory. 

Once the application has access to potentially very large ranges of persistent memory what does it do next? How is the persistent memory allocated when creating data structures? And how does the application make changes to those data structures transactional? 

You may be relieved to hear that there are libraries to help with these common tasks. These libraries, known collectively as the NVM libraries, are open source, available today for both Linux and Windows, and are documented at the website pmem.io. NVML is actually a suite of libraries allowing you to choose the libraries that meet your needs as a programmer. I'll be diving into the programming details of specific libraries in this video series, but first we need to talk about how to setup your environment to use NVML. 

If you are a Linux programmer you may find your Linux distro already delivers and NVML. For example, you can see the Fedora DNF tool can be used to install NVML library called libpmemobj. That's the library we'll be using for the examples in this video series. Notice that I'm installing the developer version of the package. That's why the name ends with dash devel, that installs the header files required for program development. 

If your distro doesn't already include NVML you can download it from Git Hub and build it yourself in a few short steps. The same Git Hub area contains pre-built NVML binaries for Windows, as well. First use the git clone command to create a local copy of the NVML source, as I'm showing here. Use the make command to build it, and make install to install the libraries on your system. See the read me file at the top level for more details on this process if you need them. 

Now that you have NVML installed for development you can use it to write programs that access persistent memory. You might think we can't go any farther without installing some actual persistent memory in the machine, but remember that the persistent memory programming model is based on memory mapped files and that model is supported by most modern file systems. So even if you don't have real persistent memory installed in your system just using a regular file will allow you to get started. 

Here you can see me using the pmempool command to create a libpmemobj pool inside of a file. That creates the layout that allows libpmemobj to use the file as persistent memory. The pmempool info command now shows the file is ready to be used by libpmemobj. Now that the programming environment is ready, and you know how to create a file containing a pool for libpmemobj, continue watching the videos in this playlist for more details on that library. 

Thanks for watching. To learn more check out the persistent memory programming playlist, and visit the links in the description below. Don't forget to like this video and subscribe to the Intel software YouTube channel.