This is a port of libvfn for macOS and implemented into xNVMe. It utilizes DriverKit to hook an external PCI NVMe device (through PCIDriverKit), and allows user-space applications to take control of the device.
This is not suitable for production, as it requires disabling SIP, and everything has to be self-signed. The code might also be buggy or have improper memory management, as this is just a proof-of-concept at this point.
Consider this a beta release. It works fine for prototyping, testing, and development.
Although it's a port of libvfn, there is no way of running any of the example code from the libvfn project, as they heavily depend on Linux-only APIs. Instead, MacVFN has been implemented in xNVMe as a reference solution. All the examples from xNVMe should work.
These are the basic steps to build and install the driver:
systemextensionsctl developer on
to allow System Extensions from any directorygit clone --recurse-submodules https://github.com/openmpdk/MacVFN.git
make build install kill log
, approve system extension and type sudo-password as neededdriverkit
branch: git clone -b driverkit https://github.com/baekalfen/xnvme
make config build install
./builddir/tools/xnvme enum
./builddir/tools/xnvme idfy MacVFN-1234ABCD --cns 0 --be=driverkit
./builddir/examples/xnvme_single_sync MacVFN-1234ABCD
./builddir/examples/xnvme_single_async MacVFN-1234ABCD
Optionally, you can clone and build fio with xNVMe support:
git clone https://github.com/axboe/fio
brew install make
gmake
to build it: gmake -j
./fio --name=test1 --iodepth=64 --rw=write --bs=512 --size=1GB --loops=1 --numjobs=1 --direct=1 --ioengine=xnvme --filename=MacVFN-1234ABCD --thread=1 --xnvme_dev_nsid=1 --xnvme_be=driverkit --xnvme_sync=driverkit --xnvme_async=driverkit --verify=crc32