This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tips:rocm [2025/12/20 18:03] โ [Benchmark] sscipioni | tips:rocm [2026/02/15 08:33] (current) โ [1\. Kernel and Firmware] sscipioni | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | References: | ||
| + | - https:// | ||
| + | - https:// | ||
| + | - https:// | ||
| + | |||
| This report outlines the deployment of the **Ollama LLM runtime** on **Arch Linux** specifically tailored for the **AMD Ryzen AI Max+ 395 APU**. The primary focus is optimizing performance by leveraging the integrated **Radeon 8060S iGPU** through the **Vulkan** backend, and considering the potential of the **XDNA 2 NPU** for heterogeneous acceleration. | This report outlines the deployment of the **Ollama LLM runtime** on **Arch Linux** specifically tailored for the **AMD Ryzen AI Max+ 395 APU**. The primary focus is optimizing performance by leveraging the integrated **Radeon 8060S iGPU** through the **Vulkan** backend, and considering the potential of the **XDNA 2 NPU** for heterogeneous acceleration. | ||
| Line 15: | Line 20: | ||
| Before deploying Ollama, the base Arch Linux installation must have the correct drivers and utilities to fully expose the APU's capabilities, | Before deploying Ollama, the base Arch Linux installation must have the correct drivers and utilities to fully expose the APU's capabilities, | ||
| ### 1\. Kernel and Firmware | ### 1\. Kernel and Firmware | ||
| + | |||
| + | Set in bios UMA buffer size to 8G or lower. | ||
| + | |||
| Ensure the system is running a recent kernel (e.g., $6.10+$ or later) for optimal Zen 5 and RDNA 3.5 support. | Ensure the system is running a recent kernel (e.g., $6.10+$ or later) for optimal Zen 5 and RDNA 3.5 support. | ||
| Line 25: | Line 33: | ||
| sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target | sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target | ||
| ``` | ``` | ||
| + | |||
| + | add to kernel parameters | ||
| + | ``` | ||
| + | iommu=pt amdgpu.gttsize=126976 ttm.pages_limit=32505856 | ||
| + | ``` | ||
| + | |||
| ### 2\. Graphics and Compute Drivers (Vulkan) | ### 2\. Graphics and Compute Drivers (Vulkan) | ||
| Line 33: | Line 47: | ||
| sudo pacman -S mesa vulkan-radeon lib32-vulkan-radeon vulkan-headers | sudo pacman -S mesa vulkan-radeon lib32-vulkan-radeon vulkan-headers | ||
| ``` | ``` | ||
| + | ` | ||
| ### 3\. ROCm (Optional but Recommended) | ### 3\. ROCm (Optional but Recommended) | ||
| Line 39: | Line 54: | ||
| ```bash | ```bash | ||
| # Install essential ROCm packages | # Install essential ROCm packages | ||
| - | yay -S rocm-core amdgpu_top rocminfo | + | yay -S rocm-core amdgpu_top rocminfo |
| yay -S rocm-hip-sdk rocm-opencl-runtime | yay -S rocm-hip-sdk rocm-opencl-runtime | ||
| sudo usermod -a -G render, | sudo usermod -a -G render, | ||
| + | |||
| + | # xdna | ||
| + | yay -S amdxdna-driver-bin xrt-npu-git | ||
| + | |||
| ``` | ``` | ||
| Line 132: | Line 151: | ||
| + | ====== lemonade-server ====== | ||
| + | |||
| + | <code | download> | ||
| + | yay -S lemonade-server | ||
| + | </ | ||
| + | |||
| + | oga-hybrid mode: this splits the work, the NPU handles the prefill (prompt processing), | ||
| + | <code | download> | ||
| + | lemonade-server run Qwen3-Coder-30B-A3B-Instruct-GGUF --recipe oga-hybrid --llamacpp rocm | ||
| + | </ | ||
| + | |||
| + | <code | download> | ||
| + | curl http:// | ||
| + | -H " | ||
| + | -d '{ | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }' | ||
| + | curl http:// | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====== Comfyui ====== | ||
| + | |||
| + | pypi packages | ||
| + | |||
| + | download from https:// | ||
| + | <code | download> | ||
| + | cd wheels | ||
| + | wget https:// | ||
| + | wget https:// | ||
| + | wget https:// | ||
| + | wget https:// | ||
| + | |||
| + | # install | ||
| + | pip install triton* | ||
| + | pip install torch* | ||
| + | |||
| + | </ | ||
| + | |||
| + | install comfyui packages | ||
| + | <code | download> | ||
| + | pip install -r requirements.txt | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | native packages **to be checked** after rocm 7.2 | ||
| + | <code bash> | ||
| + | yay -S python-pytorch-rocm python-torchvision-rocm python-torchaudio-rocm | ||
| + | #uv pip install --pre torchvision torchaudio --index-url https:// | ||
| + | </ | ||
| ====== Benchmark ====== | ====== Benchmark ====== | ||