Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OS versions that support the system allocator for CUDA Unified Memory?

From the slides posted here, it seems that using the system allocator through calls to malloc or new instead of Nvidia's cudaMallocManaged is only supported on Linux kernel versions 4.14 or newer?... If so, is there a way to query the Nvidia driver or the CUDA runtime to know whether the system allocator can be used to properly allocate a memory block for use within the CUDA unified memory model? Or would this have to be something where you keep a white-list of operating systems/kernel versions and fallback to the traditional cudaMallocManaged if the detected operating system is not on the white-list? If the latter, does anyone know of an approved white-list of operating system versions?

like image 523
Jason Avatar asked Dec 11 '25 18:12

Jason


1 Answers

So I ran into this problem, because I thought my system was supported, but it's not. Long story short, since this "feature" seems to require a perfect storm of compatible hardware and software, I am sticking to the old API. I know that is probably not the answer you wanted.

If you really want to use malloc or new, I would say your query would be a combination of:

  1. Asking the OS what kernel version its running. See the uname syscall.
  2. Running deviceQuery (or similar) to check for CUDA version (8.0 or better) and GPU (looking for compute capability greater than or equal to 6.0).

More info regarding OS support can be found here: https://www.phoronix.com/scan.php?page=news_item&px=HMM-In-Linux-4.14. It does seem that kernel version 4.14 or greater should have this feature.

like image 200
It'sPete Avatar answered Dec 14 '25 08:12

It'sPete



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!