Skip to content

Commit

Permalink
Docs: update unified memory system requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
MKKnorr committed Nov 26, 2024
1 parent 4a7d4f1 commit 24856f9
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions docs/how-to/hip_runtime_api/memory_management/unified_memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ System requirements
================================================================================

Unified memory is supported on Linux by all modern AMD GPUs from the Vega
series onward. Unified memory management can be achieved by explicitly
allocating managed memory using :cpp:func:`hipMallocManaged` or marking variables
with the ``__managed__`` attribute, or, for the latest GPUs, with the normal
system allocator, as shown in the following table.
series onward, as shown in the following table. Unified memory management can
be achieved by explicitly allocating managed memory using
:cpp:func:`hipMallocManaged` or marking variables with the ``__managed__``
attribute. For the latest GPUs, with a Linux kernel that supports
`Heterogeneous Memory Management (HMM)
<https://www.kernel.org/doc/html/latest/mm/hmm.html>`_, the normal system
allocator can be used.

.. list-table:: Supported Unified Memory Allocators by GPU architecture
:widths: 40, 25, 25
Expand Down Expand Up @@ -107,9 +110,9 @@ system allocator, as shown in the following table.

❌: **Unsupported**

:sup:`1` Works only with ``XNACK=1``. First GPU access causes recoverable
page-fault. For more details, visit
`GPU memory <https://rocm.docs.amd.com/en/latest/conceptual/gpu-memory.html#xnack>`_.
:sup:`1` Works only with ``XNACK=1`` and kernels with HMM support. First GPU
access causes recoverable page-fault. For more details, visit `GPU memory
<https://rocm.docs.amd.com/en/latest/conceptual/gpu-memory.html#xnack>`_.

.. _unified memory allocators:

Expand All @@ -131,14 +134,14 @@ system requirements` and :ref:`checking unified memory management support`.

- **System allocated unified memory**

Starting with CDNA2, the ``new`` and `malloc()`` system allocators allow
Starting with CDNA2, the ``new`` and ``malloc()`` system allocators allow
you to reserve unified memory. The system allocator is more versatile and
offers an easy transition for code written for CPUs to HIP code as the
same system allocation API is used.

To ensure the proper functioning of system allocated unified memory on supported
GPUs, it is essential to configure the environment variable ``XNACK=1`` and use
a kernel that supports `Heterogeneous Memory Management (HMM)
a kernel that supports `HMM
<https://www.kernel.org/doc/html/latest/mm/hmm.html>`_. Without this
configuration, the behavior will be similar to that of systems without HMM
support. For more details, visit
Expand Down Expand Up @@ -383,6 +386,7 @@ explicit memory management example is presented in the last tab.
*c = *a + *b;
}
// This example requires HMM support and the environment variable HSA_XNACK needs to be set to 1
int main() {
// Allocate memory for a, b, and c.
int *a = new int[1];
Expand Down

0 comments on commit 24856f9

Please sign in to comment.