iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🌟

Strix Halo (Ubuntu 25.10) + Distrobox (Ubuntu 24.04) ROCm Setup Guide

に公開

Overview

This document is a procedural guide for setting up ROCm and the ComfyUI execution environment on machines equipped with AMD Strix Halo (Ryzen AI MAX+ 395).
Since a recent kernel is required, Ubuntu 25.10 is used as the host, while a Ubuntu 24.04 environment is utilized via Distrobox to ensure the stable operation of ROCm.

I also referred to the following guide:
https://github.com/bkpaine1/AMD-Strix-Halo-AI-Guide

Basic Policy

  • Host OS: Ubuntu 25.10 (to apply the latest Kernel / Firmware)
  • Guest OS: Ubuntu 24.04 (built with Distrobox for official ROCm support)
  • Advantages:
    • Ease of Environment Setup: The environment can be built with a single command without cluttering the host OS.
    • Hardware Integration: Unlike Docker, no GPU passthrough configuration is required.
    • Workflow Efficiency: Data handling is easy due to home directory sharing.

1. Checking the Host Environment

Here is the host environment information at the start of the process.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 25.10
Release:	25.10
Codename:	questing

$ uname -a
Linux mss1 6.18.6-061806-generic #202601171700 SMP PREEMPT_DYNAMIC Sat Jan 17 19:29:30 UTC 2026 x86_64 GNU/Linux

We will configure ComfyUI later, but let's prepare it now.
This can be executed on either the host or the container.
Just keep the location in mind.

I proceeded with the work in ~/ComfyUI for the time being.

# Install Git if not present
$ sudo apt update && sudo apt install git -y
$ git clone https://github.com/Comfy-Org/ComfyUI

2. Creating the Container (Distrobox)

Create a Ubuntu 24.04 container to use as the working environment.

# Create container
$ distrobox create -i ubuntu:24.04 -n strix-ai

# Enter container
$ distrobox enter strix-ai

3. [Host Side] GPU Performance Settings

Note: This step must be performed on the host OS side. Since GUI tools (like CoreCtrl) are environment-dependent, we will configure settings by directly manipulating sysfs.

Procedure

First, check the default status.

# Check performance level (no configuration needed if it is already "high")
$ cat /sys/class/drm/card*/device/power_dpm_force_performance_level
auto

# Real-time check of current GPU clock
$ watch -n 1 "cat /sys/class/drm/card*/device/pp_dpm_sclk"
Every 1.0s: cat /sys/class/drm/card*/device/pp_dpm_sclk                                                 mss1: Wed Jan 21 09:36:31 2026

0: 600Mhz *
1: 1100Mhz
2: 2900Mhz

Manually change to Performance Mode and confirm that the clock speed increases.

# First, check which number is assigned to the APU (Strix Halo)
$ ls /sys/class/drm/card*/device/power_dpm_force_performance_level
/sys/class/drm/card0/device/power_dpm_force_performance_level

# For card0 (please adjust according to your environment)
$ echo "high" | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level

Here is the confirmation log after the setting.

# Check performance level
$ cat /sys/class/drm/card*/device/power_dpm_force_performance_level
high

# Real-time check of current GPU clock (confirm it stabilizes at 2900MHz)
$ watch -n 1 "cat /sys/class/drm/card*/device/pp_dpm_sclk"
Every 1.0s: cat /sys/class/drm/card*/device/pp_dpm_sclk                                                 mss1: Wed Jan 21 09:40:06 2026

0: 2900Mhz
1: 1100Mhz
2: 2900Mhz *

Reference: About BIOS Settings

BIOS settings determine the hardware's power ceiling (TDP).

  • Balance Mode: Standard power consumption (around 45W~65W). Prioritizes quietness.
  • Performance Mode: Expands the TDP limit (80W~120W+). Recommended for drawing out the full performance of the Strix Halo (especially when handling heavy tasks that utilize the 128GB shared memory).

4. [Container Side] Environment Setup

From here on, the work will be performed inside the Distrobox container (strix-ai).

4.1 Improving the Prompt Display (Recommended)

To make it easier to distinguish between inside and outside the container, add the following to .bashrc.

$ vi ~/.bashrc

# Add to the end of .bashrc
# Execute only when inside Distrobox (container)
if [ -f "/run/.containerenv" ]; then
    # 1. Get container name
    CONTAINER_NAME=$(grep "name=" /run/.containerenv | cut -d'"' -f2)

    # 2. Get ROCm version (repurposing existing logic)
    ROCM_VER=$(cat /opt/rocm-*/.info/version 2>/dev/null | head -n 1 | cut -d. -f1,2)
    if [ -z "$ROCM_VER" ]; then ROCM_VER="no-rocm"; fi

    # 3. Display both in the prompt (e.g., (strix-ai:6.3) hisayan@...)
    # Using colors like bold blue for the container name and magenta for ROCm makes it easier to read.
    export PS1="\[\e[1;34m\]($CONTAINER_NAME:\[\e[1;35m\]$ROCM_VER\[\e[1;34m\])\[\e[m\] ${PS1}"
fi 

4.2 Installing ROCm and the Python Environment

Add the ROCm repository and install the necessary packages. Also, create a Python 3.12 virtual environment.

# Add ROCm repository and install tools
$ wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
$ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/latest noble main" | sudo tee /etc/apt/sources.list.d/rocm.list
$ sudo apt update
$ sudo apt install rocm-dev rocm-libs -y

# Python environment setup (using standard 3.12 from Ubuntu 24.04)
$ sudo apt install python3.12-venv python3.12-dev
$ mkdir -p ~/ComfyUI && cd ~/ComfyUI
$ python3.12 -m venv venv_rocm711
$ source venv_rocm711/bin/activate

# [Important] Installing TheROCk 7.11 (Nightly)
# Install by specifying the index dedicated to Strix Halo (gfx1151)
$ pip install --index-url https://rocm.nightlies.amd.com/v2/gfx1151/ \
    torch torchvision torchaudio --force-reinstall

4.3 Adding Missing Libraries and Verifying Operation

Since some libraries are missing when running rocminfo, we will perform additional installations.

# Install dependent libraries
$ sudo apt update
$ sudo apt install libatomic1 libnuma1 -y
$ sudo apt install libgomp1 libgl1 libglx-mesa0 libglib2.0-0 -y

Run rocminfo and confirm that the GPU (gfx1151) is correctly recognized.

$ rocminfo
ROCk module is loaded
=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.18
Runtime Ext Version:     1.15
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE                              
System Endianness:       LITTLE                             
Mwaitx:                  DISABLED
XNACK enabled:           NO
DMAbuf Support:          YES
VMM Support:             YES

==========               
HSA Agents               
==========               
*******                  
Agent 1                  
*******                  
  Name:                    AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
  Uuid:                    CPU-XX                             
  Marketing Name:          AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
  Vendor Name:             CPU                                
  Feature:                 None specified                     
  Profile:                 FULL_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        0(0x0)                             
  Queue Min Size:          0(0x0)                             
  Queue Max Size:          0(0x0)                             
  Queue Type:              MULTI                              
  Node:                    0                                  
  Device Type:             CPU                                
  Cache Info:              
    L1:                      49152(0xc000) KB                   
  Chip ID:                 0(0x0)                             
  ASIC Revision:           0(0x0)                             
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   5187                               
  BDFID:                   0                                  
  Internal Node ID:        0                                  
  Compute Unit:            32                                 
  SIMDs per CU:            0                                  
  Shader Engines:          0                                  
  Shader Arrs. per Eng.:   0                                  
  WatchPts on Addr. Ranges:1                                  
  Memory Properties:       
  Features:                None
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: FINE GRAINED        
      Size:                    128135472(0x7a33130) KB            
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: EXTENDED FINE GRAINED
      Size:                    128135472(0x7a33130) KB            
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 3                   
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    128135472(0x7a33130) KB            
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 4                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    128135472(0x7a33130) KB            
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
  ISA Info:                
*******                  
Agent 2                  
*******                  
  Name:                    gfx1151                            
  Uuid:                    GPU-XX                             
  Marketing Name:          Radeon 8060S Graphics              
  Vendor Name:             AMD                                
  Feature:                 KERNEL_DISPATCH                    
  Profile:                 BASE_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        128(0x80)                          
  Queue Min Size:          64(0x40)                           
  Queue Max Size:          131072(0x20000)                    
  Queue Type:              MULTI                              
  Node:                    1                                  
  Device Type:             GPU                                
  Cache Info:              
    L1:                      32(0x20) KB                        
    L2:                      2048(0x800) KB                     
    L3:                      32768(0x8000) KB                   
  Chip ID:                 5510(0x1586)                       
  ASIC Revision:           0(0x0)                             
  Cacheline Size:          128(0x80)                          
  Max Clock Freq. (MHz):   2900                               
  BDFID:                   48640                              
  Internal Node ID:        1                                  
  Compute Unit:            40                                 
  SIMDs per CU:            2                                  
  Shader Engines:          2                                  
  Shader Arrs. per Eng.:   2                                  
  WatchPts on Addr. Ranges:4                                  
  Coherent Host Access:    FALSE                              
  Memory Properties:       APU
  Features:                KERNEL_DISPATCH 
  Fast F16 Operation:      TRUE                               
  Wavefront Size:          32(0x20)                           
  Workgroup Max Size:      1024(0x400)                        
  Workgroup Max Size per Dimension:
    x                        1024(0x400)                        
    y                        1024(0x400)                        
    z                        1024(0x400)                        
  Max Waves Per CU:        32(0x20)                           
  Max Work-item Per CU:    1024(0x400)                        
  Grid Max Size:           4294967295(0xffffffff)             
  Grid Max Size per Dimension:
    x                        2147483647(0x7fffffff)             
    y                        65535(0xffff)                      
    z                        65535(0xffff)                      
  Max fbarriers/Workgrp:   32                                 
  Packet Processor uCode:: 32                                 
  SDMA engine uCode::      17                                 
  IOMMU Support::          None                               
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    130023424(0x7c00000) KB            
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:2048KB                             
      Alloc Alignment:         4KB                                
      Accessible by all:       FALSE                              
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: EXTENDED FINE GRAINED
      Size:                    130023424(0x7c00000) KB            
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:2048KB                             
      Alloc Alignment:         4KB                                
      Accessible by all:       FALSE                              
    Pool 3                   
      Segment:                 GROUP                              
      Size:                    64(0x40) KB                        
      Allocatable:             FALSE                              
      Alloc Granule:           0KB                                
      Alloc Recommended Granule:0KB                                
      Alloc Alignment:         0KB                                
      Accessible by all:       FALSE                              
  ISA Info:                
    ISA 1                    
      Name:                    amdgcn-amd-amdhsa--gfx1151         
      Machine Models:          HSA_MACHINE_MODEL_LARGE            
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Size:      1024(0x400)                        
      Workgroup Max Size per Dimension:
        x                        1024(0x400)                        
        y                        1024(0x400)                        
        z                        1024(0x400)                        
      Grid Max Size:           4294967295(0xffffffff)             
      Grid Max Size per Dimension:
        x                        2147483647(0x7fffffff)             
        y                        65535(0xffff)                      
        z                        65535(0xffff)                      
      FBarrier Max Size:       32                                 
    ISA 2                    
      Name:                    amdgcn-amd-amdhsa--gfx11-generic   
      Machine Models:          HSA_MACHINE_MODEL_LARGE            
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Size:      1024(0x400)                        
      Workgroup Max Size per Dimension:
        x                        1024(0x400)                        
        y                        1024(0x400)                        
        z                        1024(0x400)                        
      Grid Max Size:           4294967295(0xffffffff)             
      Grid Max Size per Dimension:
        x                        2147483647(0x7fffffff)             
        y                        65535(0xffff)                      
        z                        65535(0xffff)                      
      FBarrier Max Size:       32                                 
*** Done ***             

5. ComfyUI Setup

Install the ComfyUI core and its dependent packages.

$ cd ~/ComfyUI
$ pip install -r requirements.txt
$ pip install -r manager-requirements.txt
$ pip install deepdiff gguf aiohttp_sse piexif

# Suppress Git warnings
$ export GIT_PYTHON_REFRESH=quiet

Verifying Startup:

# Startup command (Manager enabled, Legacy UI)
$ python main.py --listen --enable-manager --enable-manager-legacy-ui

Access http://hostname.local:8188 from any browser to confirm that ComfyUI is running.


6. Automatic Startup Configuration (Systemd)

This configuration automatically starts ComfyUI within Distrobox when the PC boots up.

Create ~/.config/systemd/user/comfyui.service.

$ mkdir -p ~/.config/systemd/user
$ vi ~/.config/systemd/user/comfyui.service

Contents of comfyui.service:

[Unit]
Description=ComfyUI inside Distrobox (strix-ai)
After=network.target

[Service]
Type=simple
# By using bash -i, the .bashrc settings are loaded and environment variables are applied
ExecStart=/usr/bin/distrobox-enter -n strix-ai -- bash -i -c "source ~/ComfyUI/venv_rocm711/bin/activate && python ~/ComfyUI/main.py --listen --enable-manager --enable-manager-legacy-ui"
Restart=always
RestartSec=10
WorkingDirectory=%h/ComfyUI

[Install]
WantedBy=default.target

Enable and start the service.

# Reload configuration
$ systemctl --user daemon-reload

# Enable automatic startup
$ systemctl --user enable comfyui.service

# Start immediately
$ systemctl --user start comfyui.service

Discussion