AMD GPU: Difference between revisions
m fix formatting and syntax highlighting :-) |
amdgpu.ids |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 11: | Line 11: | ||
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 | === AMD iGPU with high amount of RAM === | ||
The iGPU uses system RAM and has no dedicated VRAM | The iGPU uses system RAM and has no dedicated VRAM. On many systems its possible to set the amount of VRAM in BIOS: "Auto" or the lowest amount is enough. To set the maximum RAM that the iGPU use, you can add <code>ttm pages_limit</code> and <code>ttm page_pool_size</code> in <code>boot.extraModprobeConfig</code> option.<syntaxhighlight lang="nix"># Sets a high amount of GTT size for LLM usage. | ||
boot.extraModprobeConfig = '' | |||
# 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 | |||
options | |||
# | # `amdgpu gttsize' is deprecated and should not be used. | ||
# options amdgpu gttsize=120000 | |||
# | '';</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 70: | Line 64: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Enabling | === 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. | 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. | ||
| Line 280: | Line 274: | ||
hardware.firmware = [ pkgs.linux-firmware ]; | hardware.firmware = [ pkgs.linux-firmware ]; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== PyTorch does not show the the GPU model and prints <code>(null): No such file or directory</code> === | |||
<syntaxhighlight lang="shell">$ python -c "import torch; print(torch.cuda.is_available(), torch.cuda.get_device_name(0))" | |||
(null): No such file or directory | |||
(null): No such file or directory | |||
True AMD Radeon Graphics</syntaxhighlight>It happens because torch cannot find <code>amdgpu.ids</code><syntaxhighlight lang="nix">systemd.tmpfiles.rules = [ | |||
"L+ /opt/amdgpu/share/libdrm/amdgpu.ids - - - - ${pkgs.libdrm}/share/libdrm/amdgpu.ids" | |||
];</syntaxhighlight><code>True AMD Radeon RX 9060 XT</code> | |||
== See Also == | == See Also == | ||