AMD GPU: Difference between revisions
Remove 24.05 |
→Blender: Converted to a general section on ROCm and HIP enabling for packages, linked to the Blender page HIP section for Blender-specific information. |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 10: | Line 10: | ||
== Special Configuration == | == Special Configuration == | ||
The following configurations are only required if you have a specific reason for needing them. They are not expected to be necessary for a typical desktop / gaming setup. | The following configurations are only required if you have a specific reason for needing them. They are not expected to be necessary for a typical desktop / gaming setup. | ||
=== AMD iGPU with high amount of RAM (usecase: large language models) === | |||
The iGPU uses system RAM and has no dedicated VRAM. It can use up to the full available system RAM for example for large LLM models. On many systems its possible to set the amount of VRAM in BIOS: „Auto“ or the lowest amount is enough. The driver knows, to expand with GTT. | |||
Documentation: | |||
* [https://docs.kernel.org/gpu/amdgpu/module-parameters.html amdgpu gttsize] | |||
* [https://www.kernel.org/doc/html/v4.14/gpu/drm-mm.html#the-translation-table-manager-ttm ttm pages_limit and ttm pages_pool] | |||
Example for 128GB system RAM, in this example the LLM can use 120 GB „VRAM/GTT“: | |||
<syntaxhighlight lang="nix"> | |||
boot.kernelParams = [ | |||
# The kernel module parameter gttsize is a is deprecated and will be removed in the future. | |||
options amdgpu gttsize=120000 | |||
# specified as 4KiB pages: 120 GB GTT | |||
options ttm pages_limit=31457280 | |||
# specified as 4KiB pages: 60 GB pre-allocated | |||
options ttm page_pool_size=15728640 | |||
];</syntaxhighlight> | |||
=== Enable Southern Islands (SI) and Sea Islands (CIK) support (eg. HD 7000/8000) === | === Enable Southern Islands (SI) and Sea Islands (CIK) support (eg. HD 7000/8000) === | ||
| Line 51: | Line 70: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === Enabling ROCm & HIP For Packages === | ||
Whether or not a package is built with ROCm support is controlled by the <code>rocmSupport</code> nixpkgs config variable. As HIP is a component of ROCm, anything that needs HIP support (e.g. Blender) gets that enabled through <code>rocmSupport</code> too. | |||
You can set it globally with this line | |||
<syntaxhighlight lang="nix"> | |||
nixpkgs.config.rocmSupport = true; | |||
</syntaxhighlight> | |||
Or override specific packages | |||
<syntaxhighlight lang="nix"> | |||
environment.systemPackages = with pkgs; [ | |||
(ffmpeg-full.override {config.rocmSupport=true;}) | |||
pkgsRocm.ffmpeg-full # equivalent to (ffmpeg-full.override {config.rocmSupport=true;}) for packages in ROCm Release attrPaths | |||
]; | |||
</syntaxhighlight> | |||
While most if not all packages that support ROCm should be in the [https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/rocm-modules/release-attrPaths.json ROCm Release attrPaths], and therefore built by Hydra and cached in cache.nixos.org with <code>rocmSupport</code>, enabling it globally still has a slight chance of pointless compiling on your machine. | |||
For Blender-specific information on setting up HIP support, see: [[Blender#HIP]]. | |||
=== OpenCL === | === OpenCL === | ||