Compare commits

...

11 Commits

Author SHA1 Message Date
spolifroni-amd
5b2b420b4c Updated based 2024-11-15 15:27:43 -05:00
spolifroni-amd
1ae916fea5 Update docs/conceptual/iommu.rst
Co-authored-by: Leo Paoletti <164940351+lpaoletti@users.noreply.github.com>
2024-11-15 15:24:17 -05:00
spolifroni-amd
372320a69f Update docs/conceptual/iommu.rst
Co-authored-by: Leo Paoletti <164940351+lpaoletti@users.noreply.github.com>
2024-11-15 15:09:37 -05:00
spolifroni-amd
bc66a82de4 Update docs/conceptual/iommu.rst
Co-authored-by: Leo Paoletti <164940351+lpaoletti@users.noreply.github.com>
2024-11-15 15:08:59 -05:00
spolifroni-amd
cad5640d73 Update docs/conceptual/iommu.rst
Co-authored-by: Leo Paoletti <164940351+lpaoletti@users.noreply.github.com>
2024-11-15 15:08:12 -05:00
spolifroni-amd
7834149f27 Update docs/conceptual/iommu.rst
Co-authored-by: Leo Paoletti <164940351+lpaoletti@users.noreply.github.com>
2024-11-15 15:04:12 -05:00
spolifroni-amd
dfa4ac9cc4 changed onwards bc the spellcheck didn't like it 2024-11-14 15:10:19 -05:00
spolifroni-amd
04083a0a6e streamlined the iommu section (#3947)
* streamlined the iommu section

* made changes based on feedback

* tweaked some language around xgmi etc

* removed the reference to the MI300 to ensure a long shelf-life for this content
2024-11-13 16:31:45 -05:00
Alex Xu
911fa6b10b fix typo 2024-10-03 10:59:40 -04:00
Alex Xu
15a10b7780 fix typo, expand wordlist 2024-10-02 10:17:52 -04:00
Alex Xu
b8a91de79b Add a page explaining IOMMU to Conceptual section 2024-10-01 16:13:44 -04:00
4 changed files with 64 additions and 0 deletions

View File

@@ -211,6 +211,7 @@ MLM
MMA
MMIO
MMIOH
MMU
MNIST
MPI
MSVC
@@ -499,6 +500,7 @@ datatypes
dbgapi
de
deallocation
debuggability
denoise
denoised
denoises
@@ -513,6 +515,7 @@ devsel
dimensionality
disambiguates
distro
distros
el
embeddings
enablement
@@ -746,6 +749,7 @@ uncached
uncorrectable
unhandled
uninstallation
unmapped
unsqueeze
unstacking
unswitching
@@ -765,6 +769,8 @@ vectorize
vectorized
vectorizer
vectorizes
virtualize
virtualized
vjxb
voxel
walkthrough

55
docs/conceptual/iommu.rst Normal file
View File

@@ -0,0 +1,55 @@
.. meta::
:description: Input-Output Memory Management Unit (IOMMU)
:keywords: IOMMU, DMA, PCIe, xGMI, AMD, ROCm
****************************************************************
Input-Output Memory Management Unit (IOMMU)
****************************************************************
The I/O Memory Management Unit (IOMMU) provides memory remapping services for I/O devices. It adds support for address translation and system memory access protection on direct memory access (DMA) transfers from peripheral devices.
The IOMMU's memory remapping services:
* provide private I/O space for devices used in a guest virtual machine.
* prevent unauthorized DMA requests to system memory and to memory-mapped I/O (MMIO).
* help in debugging memory access issues.
* facilitate peer-to-peer DMA.
The IOMMU also provides interrupt remapping, which is used by devices that support multiple interrupts and for interrupt delivery on hardware platforms with a large number of cores.
.. note::
AMD Instinct accelerators are connected via XGMI links and don't use PCI/PCIe for peer-to-peer DMA. Because PCI/PCIe is not used for peer-to-peer DMA, there are no device physical addressing limitations or platform root port limitations. However, because non-GPU devices such as RDMA NICs use PCIe for peer-to-peer DMA, there might still be physical addressing and platform root port limitations when these non-GPU devices interact with other devices, including GPUs.
Linux supports IOMMU in both virtualized environments and bare metal.
The IOMMU is enabled by default but can be disabled or put into passthrough mode through the Linux kernel command line:
.. list-table::
:widths: 25 25 50
:header-rows: 1
* - IOMMU Mode
- Kernel command
- Description
* - Enabled
- default setting
- The IOMMU is enabled in remapping mode. Each device gets its own I/O virtual address space. All devices on Linux register their DMA addressing capabilities, and the kernel will ensure that any address space mapped for DMA is mapped within the device's DMA addressing limits. Only address space explicitly mapped by the devices will be mapped into virtual address space. Attempts to access an unmapped page will generate an IOMMU page fault. This setting is recommended for AMD Radeon GPUs that need peer-to-peer DMA.
* - Passthrough
- ``iommu=pt``
- Interrupt remapping is enabled but I/O remapping is disabled. The entire platform shares a common platform address space for system memory and MMIO spaces, ensuring compatibility with drivers from external vendors, while still supporting CPUs with a large number of cores. This setting is recommended for AMD Instinct Accelerators and for AMD Radeon GPUs that don't need peer-to-peer DMA.
* - Disabled
- ``iommu=off``
- The IOMMU is disabled and the entire platform shares a common platform address space for system memory and MMIO spaces.
The IOMMU also provides virtualized access to the MMIO portions of the platform address space for peer-to-peer DMA.
Because peer-to-peer DMA is not officially part of the PCI/PCIe specification, the behavior of peer-to-peer DMA varies between hardware platforms.
AMD CPUs earlier than AMD Zen only supported peer-to-peer DMA for writes. On CPUs from AMD Zen and later, peer-to-peer DMA is fully supported.
To use peer-to-peer DMA on Linux, enable the following options in your Linux kernel configuration:
* ``CONFIG_PCI_P2PDMA``
* ``CONFIG_DMABUF_MOVE_NOTIFY``
* ``CONFIG_HSA_AMD_P2P``

View File

@@ -58,6 +58,7 @@ ROCm documentation is organized into the following categories:
* [GPU architecture overview](./conceptual/gpu-arch.md)
* [GPU memory](./conceptual/gpu-memory.md)
* [Input-Output Memory Management Unit (IOMMU)](./conceptual/iommu.rst)
* [File structure (Linux FHS)](./conceptual/file-reorg.md)
* [GPU isolation techniques](./conceptual/gpu-isolation.md)
* [Using CMake](./conceptual/cmake-packages.rst)

View File

@@ -146,6 +146,8 @@ subtrees:
title: White paper
- file: conceptual/gpu-memory.md
title: GPU memory
- file: conceptual/iommu.rst
title: Input-Output Memory Management Unit (IOMMU)
- file: conceptual/file-reorg.md
title: File structure (Linux FHS)
- file: conceptual/gpu-isolation.md