Chatterbox-TTS-Server icon indicating copy to clipboard operation
Chatterbox-TTS-Server copied to clipboard

contradictory torch requirements for ROCm

Open doctorcolossus opened this issue 11 months ago • 21 comments

Hi. docker compose --file docker-compose-rocm.yml up fails for me with:

ERROR: Cannot install -r requirements.txt (line 4) and torch 2.6.0+rocm6.4.1.git1ded221d (from https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torch-2.6.0%2Brocm6.4.1.git1ded221d-cp310-cp310-linux_x86_64.whl) because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested torch 2.6.0+rocm6.4.1.git1ded221d (from https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torch-2.6.0%2Brocm6.4.1.git1ded221d-cp310-cp310-linux_x86_64.whl)
    chatterbox-tts 0.1.6 depends on torch==2.5.1

Basically requirements-rocm.txt is specifying torch==2.6.0 and requirements.txt is specifying torch=2.5.1, so both can't be satisfied.

A comment in requirements.txt says: # Updated to use PyTorch 2.5.1 for compatibility with our Colab-compatible chatterbox fork

doctorcolossus avatar Dec 19 '25 10:12 doctorcolossus

You can copy/paste these updated requirements-rocm.txt, Dockerfile.rocm, and docker-compose-rocm.yml file. I cannot test this on an AMD GPU, so please try the changes below and report back if it works (GPU detection + successful synthesis) so I can update the repo.

The install failure is a dependency conflict in our ROCm path: the current requirements-rocm.txt forces Torch 2.6.0 (ROCm 6.4.1), while our chatterbox-v2 fork requires Torch 2.5.1, so pip cannot satisfy both at once.

Good news: the ROCm 6.4.1 wheel index already contains a Torch 2.5.1+rocm6.4.1 wheel (and matching torchvision 0.20.1 build), so we can pin ROCm to that instead of 2.6.0.

✅ Proposed fix (ROCm stays on 6.4.1, Torch becomes 2.5.1)

1) requirements-rocm.txt (replace the file with this)

# requirements-rocm.txt
#
# ROCm wheels: pin to Torch 2.5.1 (matches chatterbox-v2 fork requirement)
# The ROCm 6.4.1 index contains torch 2.5.1+rocm6.4.1 and torchvision 0.20.1+rocm6.4.1. [page:0]

# --- Chatterbox TTS engine - MUST use the chatterbox-v2 fork ---
chatterbox-tts @ git+https://github.com/devnen/chatterbox-v2.git@master

# --- ROCm PyTorch stack (CPython 3.10 wheels; matches Ubuntu 22.04 default python3.10) ---
torch @ https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torch-2.5.1%2Brocm6.4.1.git47a02624-cp310-cp310-linux_x86_64.whl
torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torchvision-0.20.1%2Brocm6.4.1.git04d8fc4a-cp310-cp310-linux_x86_64.whl
torchaudio @ https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torchaudio-2.5.0%2Brocm6.4.1.git56bc006d-cp310-cp310-linux_x86_64.whl
pytorch-triton-rocm @ https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/pytorch_triton_rocm-3.1.0%2Brocm6.4.1.gitb253a537-cp310-cp310-linux_x86_64.whl

# --- ML / Audio ---
numpy>=1.24.0,<1.26.0
soundfile
librosa
pydub
praat-parselmouth
audiotsm
safetensors
descript-audio-codec
huggingface_hub
hf-transfer

# --- Web / API ---
fastapi
uvicorn[standard]
python-multipart
requests

# --- Config / utilities ---
pydantic
python-dotenv
Jinja2
PyYAML
tqdm
aiofiles
watchdog

# --- Keep ONNX pinned to avoid source builds on some platforms ---
onnx==1.16.0

Notes:

  • AMD explicitly recommends using ROCm wheels from repo.radeon.com for these setups, which is what this does.[2]
  • This should remove the Torch 2.6.0 vs 2.5.1 conflict entirely.

2) Dockerfile.rocm (replace with this)

FROM rocm/dev-ubuntu-22.04:latest

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
ENV HF_HOME=/app/hf_cache

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    libsndfile1 \
    ffmpeg \
    python3 \
    python3-pip \
    python3-dev \
    python3-venv \
    git \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN ln -sf /usr/bin/python3 /usr/bin/python

WORKDIR /app

# Copy ROCm requirements
COPY requirements-rocm.txt ./requirements-rocm.txt

# Install deps
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
    python3 -m pip install --no-cache-dir -r requirements-rocm.txt

# Copy app
COPY . .

RUN mkdir -p model_cache reference_audio outputs voices logs hf_cache

EXPOSE 8004
CMD ["python3", "server.py"]

3) docker-compose-rocm.yml (no change required, reposted for clarity)

version: '3.8'

services:
  chatterbox-tts-server:
    build:
      context: .
      dockerfile: Dockerfile.rocm
    ports:
      - "${PORT:-8004}:8004"
    volumes:
      - ./config.yaml:/app/config.yaml
      - ./voices:/app/voices
      - ./reference_audio:/app/reference_audio
      - ./outputs:/app/outputs
      - ./logs:/app/logs
      - hf_cache:/app/hf_cache

    devices:
      - /dev/kfd
      - /dev/dri
    group_add:
      - video
      - render
    ipc: host
    shm_size: 8g
    security_opt:
      - seccomp=unconfined

    restart: unless-stopped
    environment:
      - HF_HUB_ENABLE_HF_TRANSFER=1
      - HF_TOKEN=YOUR_TOKEN_HERE

volumes:
  hf_cache:

How to try it (please run & report back)

  1. Update the three files above in your local checkout.
  2. Rebuild without cache:
    docker compose -f docker-compose-rocm.yml build --no-cache
    docker compose -f docker-compose-rocm.yml up
    

devnen avatar Dec 20 '25 07:12 devnen

Hey, thanks for the quick reply!

I applied your proposed changes to the latest HEAD at 86567eab1279fcb4549d87cc36cb9589241bb089. Unfortunately building still failed with the following error:

ERROR: Cannot install -r requirements-rocm.txt (line 7) and torchaudio 2.5.0+rocm6.4.1.git56bc006d (from https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torchaudio-2.5.0%2Brocm6.4.1.git56bc006d-cp310-cp310-linux_x86_64.whl) because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested torchaudio 2.5.0+rocm6.4.1.git56bc006d (from https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torchaudio-2.5.0%2Brocm6.4.1.git56bc006d-cp310-cp310-linux_x86_64.whl)
    chatterbox-tts 0.1.6 depends on torchaudio==2.5.1

It appears that even though rocm 6.4.1 provides torch==2.5.1, it does not provide any such version of torchaudio, which seems to be why you chose 2.5.0 for that. Unfortunately, it looks like chatterbox-tts requires torchaudio==2.5.1, so 2.5.0 is still not compatibible.

What actually does build for me however is your commit e77e11a5941c7ec1e5ab72c92b41501830124356, which was the last one before b5ce1b0997a1c3f921d304dfe30b4f036e20de26, which git blame shows as the origin of these lines in requirements.txt:

# Updated to use PyTorch 2.5.1 for compatibility with our Colab-compatible chatterbox fork
torch==2.5.1
torchvision==0.20.1
torchaudio==2.5.1

You asked that I "report back if it works (GPU detection + successful synthesis)". Well, since the time when I opened this issue, I tested upstream Chatterbox with my GPU, and unfortunately found that the latter is just not capable enough to run this model at all in the first place, so I will unfortunately not be able to report back about whether successful synthesis is possible. I can only test the build process, which is what this issue is about, and I think you guys should be able to test that yourselves too (and it would probably be ideal to set up a continuous integration pipeline for that). Since my AMD GPU can't run this anyway, I'll be using CUDA in any case, so this issue isn't really a priority for me any more, but I hope that this report can help your project and other users who might be able to use it with ROCm.

doctorcolossus avatar Dec 20 '25 10:12 doctorcolossus

I just came across this page, which suggests that you should be able to get those versions from pytorch.org rather than repo.radeon.com:

pip install torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/rocm6.1

doctorcolossus avatar Dec 20 '25 20:12 doctorcolossus

I just came across this page, which suggests that you should be able to get those versions from pytorch.org rather than repo.radeon.com:

pip install torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/rocm6.1

This doesn't quite work. I had to change Dockerfile.rocm so that for rocm it would first install a requirements-rocm-init.txt with the following content before installing requirements-rocm.txt:

-i https://download.pytorch.org/whl/rocm6.1
torch==2.5.1
torchaudio==2.5.1

In the original requirements-rocm.txt I removed those installs.

Then in Dockerfile.rocm I added this to do the installation separately:

COPY requirements-rocm-init.txt ./requirements-rocm-init.txt
COPY requirements-rocm.txt ./requirements-rocm.txt

# Install deps
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
    python3 -m pip install --no-cache-dir -r requirements-rocm-init.txt && \
    python3 -m pip install --no-cache-dir -r requirements-rocm.txt

This is because the -i parameter always works for the whole requirements file.

But even though it installs successfully I get this message when starting the container:

chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] __main__: Starting TTS Server directly on http://0.0.0.0:8004
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] __main__: API documentation will be available at http://0.0.0.0:8004/docs
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] __main__: Web UI will be available at http://0.0.0.0:8004/
chatterbox-tts-server-1  | INFO:     Started server process [1]
chatterbox-tts-server-1  | INFO:     Waiting for application startup.
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] server: TTS Server: Initializing application...
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] server: Configuration loaded. Log file at: /app/logs/tts_server.log
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [WARNING] engine: CUDA was requested in config but functionality test failed. PyTorch may not be compiled with CUDA support. Automatically falling back to CPU.
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] engine: Final device selection: cpu
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] engine: Model selector from config: 'chatterbox-turbo'
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] engine: Model selector 'chatterbox-turbo' resolved to Turbo model (ChatterboxTurboTTS)
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] engine: Initializing ChatterboxTurboTTS on device 'cpu'...
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] engine: Model type: turbo
chatterbox-tts-server-1  | 2025-12-21 12:00:15 [INFO] engine: Turbo model supports paralinguistic tags: ['laugh', 'chuckle', 'sigh', 'gasp', 'cough', 'clear throat', 'sniff', 'groan', 'shush']

Edit: Checking in the resulting docker container for GPU support results in the following:

root@9501ea16e68b:/app# python -c "import torch; print(f'PyTorch version: {torch.__version__}'); print(f'ROCm available: {torch.cuda.is_available()}'); print(f'Device name: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else None}')"
PyTorch version: 2.5.1+cu124
ROCm available: False
Device name: None

This is happening on a Strix Halo / AMD AI Max+ 395 with 8060S Graphics (Shared Memory / GTT mode with VRAM set to lowest possible value)

Edit2: I now see that this is happening because the subsequent installs remove the rocm torch versions and replace it with the CPU version..

normen avatar Dec 21 '25 12:12 normen

Finally got it to compile and run with the following requirements-rocm-init.txt, the original requirements-rocm.txt from github (not from this thread)

-i https://download.pytorch.org/whl/rocm6.1
torch==2.5.1
torchaudio==2.5.1
torchvision
pytorch_triton_rocm==3.1.0

However I get issues at runtime:

chatterbox-tts-server-1  | 2025-12-21 17:17:29 [INFO] server: Using reference audio for cloning: normen.wav
chatterbox-tts-server-1  | 2025-12-21 17:17:29 [INFO] server: Processing text as a single chunk (splitting not enabled or text too short).
chatterbox-tts-server-1  | 2025-12-21 17:17:29 [INFO] server: Synthesizing chunk 1/1...
chatterbox-tts-server-1  | 2025-12-21 17:17:29 [INFO] engine: Applying user-provided seed for generation: 3000
chatterbox-tts-server-1  | 2025-12-21 17:17:29 [INFO] engine: Global seed set to: 3000
chatterbox-tts-server-1  | 2025-12-21 17:17:29 [ERROR] engine: Error during TTS synthesis: HIP error: invalid device function
chatterbox-tts-server-1  | HIP kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
chatterbox-tts-server-1  | For debugging consider passing AMD_SERIALIZE_KERNEL=3
chatterbox-tts-server-1  | Compile with `TORCH_USE_HIP_DSA` to enable device-side assertions.
chatterbox-tts-server-1  | Traceback (most recent call last):
chatterbox-tts-server-1  |   File "/app/engine.py", line 386, in synthesize
chatterbox-tts-server-1  |     wav_tensor = chatterbox_model.generate(
chatterbox-tts-server-1  |   File "/usr/local/lib/python3.10/dist-packages/chatterbox/tts.py", line 220, in generate
chatterbox-tts-server-1  |     self.prepare_conditionals(audio_prompt_path, exaggeration=exaggeration)
chatterbox-tts-server-1  |   File "/usr/local/lib/python3.10/dist-packages/chatterbox/tts.py", line 189, in prepare_conditionals
chatterbox-tts-server-1  |     s3gen_ref_dict = self.s3gen.embed_ref(s3gen_ref_wav, S3GEN_SR, device=self.device)
chatterbox-tts-server-1  |   File "/usr/local/lib/python3.10/dist-packages/chatterbox/models/s3gen/s3gen.py", line 143, in embed_ref
chatterbox-tts-server-1  |     ref_mels_24 = self.mel_extractor(ref_wav_24).transpose(1, 2).to(dtype=self.dtype)
chatterbox-tts-server-1  |   File "/usr/local/lib/python3.10/dist-packages/chatterbox/models/s3gen/utils/mel.py", line 49, in mel_spectrogram
chatterbox-tts-server-1  |     min_val = torch.min(y)
chatterbox-tts-server-1  | RuntimeError: HIP error: invalid device function
chatterbox-tts-server-1  | HIP kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
chatterbox-tts-server-1  | For debugging consider passing AMD_SERIALIZE_KERNEL=3
chatterbox-tts-server-1  | Compile with `TORCH_USE_HIP_DSA` to enable device-side assertions.
chatterbox-tts-server-1  |
chatterbox-tts-server-1  | 2025-12-21 17:17:29 [ERROR] server: TTS engine failed to synthesize audio for chunk 1.

normen avatar Dec 21 '25 17:12 normen

Nice!

I am not sure what to advise about the HIP error. But it seems more likely that it's a ROCm or PyTorch issue than something to do with Chatterbox-TTS-Server. This looks related, but seems to regard torch 2.6.0. Did you try passing AMD_SERIALIZE_KERNEL=3 as the error suggests to get more debugging info? Did you have Chatterbox working previously? Have you tried running upstream Chatterbox with ROCm on your host machine? You could also try building torch from source with and without TORCH_USE_HIP_DSA to see if that solves it.

It looks like you did resolve the build problem though, so at least this issue is resolved if & when a patch gets merged.

doctorcolossus avatar Dec 21 '25 18:12 doctorcolossus

Yeah, ont sure what the issue is. CUDA works with AMD support. Maybe its because of the GTT memory (VRAM is only 1GB in BIOS) - although it does load the model to GTT memory so that probably works too.

This is what I get in the container with CUDA enabled when checking GPU support:

root@49e596ef6293:/app# python -c "import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA: {torch.cuda.is_available()}'); print(f'GPU: {torch.cuda.get_device_name(0)}'); print(f'Architectures: {torch.cuda.get_arch_list()}')"
PyTorch: 2.5.1+rocm6.1
CUDA: True
GPU: AMD Radeon Graphics
Architectures: ['gfx900', 'gfx906', 'gfx908', 'gfx90a', 'gfx1030', 'gfx1100', 'gfx942']

Edit: Ah and enabling AMD_SERIALIZE_KERNEL doesn't give any more useful output, the stack is in the same place.

normen avatar Dec 21 '25 20:12 normen

I finally got it to work by adding this ENV variable - this is probably due to my graphics card being an APU / mobile GPU:

      - HSA_OVERRIDE_GFX_VERSION=11.0.0

This is with the separate requirements.txt for ROCM, everything else as it is in github.

-i https://download.pytorch.org/whl/rocm6.1
torch==2.5.1
torchaudio==2.5.1
torchvision
pytorch_triton_rocm==3.1.0

normen avatar Dec 21 '25 20:12 normen

@normen, crazy, I actually also had to set that environment variable to get anything at all running on ROCm, but in my case the reason for trying it had been due to segfaults, whereas your error looked totally different and unfamiliar to me, which is why I didn't think of suggesting it. Awesome that you finally got it working, congrats!

doctorcolossus avatar Dec 21 '25 21:12 doctorcolossus

@normen, interesting that you were able to get it working with only 1 GB VRAM. My AMD iGPU only has 512 MB VRAM, which is why I gave this up when I realized, but I hadn't known of any such thing as GTT memory-mapping till you mentioned it... Not sure how to set that in my BIOS, but if you were able to get it working with only 1 GB VRAM, maybe it's worth my trying to figure out. How is Chatterbox's performance for you with this setup on ROCm? Do you have an NVIDIA card to compare against?

doctorcolossus avatar Dec 21 '25 21:12 doctorcolossus

@normen, interesting that you were able to get it working with only 1 GB VRAM. My AMD iGPU only has 512 MB VRAM, which is why I gave this up when I realized, but I hadn't known of any such thing as GTT memory-mapping till you mentioned it... Not sure how to set that in my BIOS, but if you were able to get it working with only 1 GB VRAM, maybe it's worth my trying to figure out. How is Chatterbox's performance for you with this setup on ROCm? Do you have an NVIDIA card to compare against?

The Ryzen AI Max+ 395 is a system with shared memory, I have 128GB of shared memory for GPU and CPU. Theres basically three kinds of ways the memory can be used: as RAM, as VRAM or as GTT RAM - VRAM has to be set in BIOS and is basically fixed afterwards. When using the GTT RAM type you can dynamically decide at runtime if the memory is used for the GPU or CPU but you still have to assign a minimum amount to VRAM for a normal boot

Computation is actually quite a bit faster than CPU but the system has 16 CPUs as well (32 virtual ones), so its only about 4x(?) faster.

normen avatar Dec 21 '25 21:12 normen

Hi @normen , got the same hardware but don't get it running. - HSA_OVERRIDE_GFX_VERSION=11.0.0 is causing instant crashes, without I see some HIP error.

Maybe you can sum your changes up in one post - maybe I missed something while tracking all your changes in this thread. Thanks!

bluemoehre avatar Jan 04 '26 19:01 bluemoehre

For the Ryzen AI Max+ 395 (Strix Halo) you need:

  • Kernel 6.18+
  • HSA_OVERRIDE_GFX_VERSION=11.0.0 env variable
  • separate requirements.txt for the core torch libraries (remove them from the main requirements-rocm.txt)
-i https://download.pytorch.org/whl/rocm6.1
torch==2.5.1
torchaudio==2.5.1
torchvision
pytorch_triton_rocm==3.1.0

Otherwise I kept everything as it is in git, I did NOT use the changes posted by devnen here.

normen avatar Jan 05 '26 08:01 normen

I ran into the same issue and followed some of the steps that @normen had. I managed to get the service up and running, and I generated some samples! Thanks all!

Hardware:

  • 4 x AMD Radeon RX 7900 XTX

What worked for me was this:

  • Create a file called requirements-rocm-init.txt:
-i https://download.pytorch.org/whl/rocm6.1
torch==2.5.1
torchaudio==2.5.1
torchvision
pytorch_triton_rocm==3.1.0
  • Modify requirements-rocm.txt to look like this
# requirements.txt

# Chatterbox TTS engine - Install from chatterbox-v2 fork
chatterbox-tts @ git+https://github.com/devnen/chatterbox-v2.git@master

# Core Web Framework
fastapi
uvicorn[standard]

# Machine Learning & Audio
numpy>=1.24.0,<1.26.0  # Match chatterbox-v2 requirements
soundfile # Requires libsndfile system library (e.g., sudo apt-get install libsndfile1 on Debian/Ubuntu)
huggingface_hub
descript-audio-codec
safetensors

# Configuration & Utilities
pydantic
python-dotenv # Used ONLY for initial config seeding if config.yaml missing
Jinja2
python-multipart # For file uploads
requests # For health checks or other potential uses
PyYAML # For parsing presets.yaml AND primary config.yaml
tqdm

# Audio Post-processing
pydub
praat-parselmouth # For unvoiced segment removal
librosa # for changes to sampling
hf-transfer
  • Modify Dockerfile.rocm to look like this:
FROM rocm/dev-ubuntu-22.04:latest

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
# Set the Hugging Face home directory for better model caching
ENV HF_HOME=/app/hf_cache

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    libsndfile1 \
    ffmpeg \
    python3 \
    python3-pip \
    python3-dev \
    python3-venv \
    git \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Create a symlink for python3 to be python for convenience
RUN ln -s /usr/bin/python3 /usr/bin/python

# Set up working directory
WORKDIR /app

# Copy requirements first to leverage Docker cache
COPY requirements-rocm-init.txt ./requirements-rocm-init.txt
COPY requirements-rocm.txt ./requirements-rocm.txt

# Upgrade pip and install Python dependencies
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
    python3 -m pip install --no-cache-dir -r requirements-rocm-init.txt && \
    pip3 install --no-cache-dir -r requirements-rocm.txt

# Copy the rest of the application code
COPY . .

# Create required directories for the application (fixed syntax error)
RUN mkdir -p model_cache reference_audio outputs voices logs hf_cache

# Expose the port the application will run on
EXPOSE 8004

# Command to run the application
CMD ["python3", "server.py"]
  • Run docker compose -f docker-compose-rocm.yml up -d
  • Run docker exec chatterbox-tts-server-chatterbox-tts-server-1 chmod +x start.sh
  • Run docker exec chatterbox-tts-server-chatterbox-tts-server-1 ./start.sh and follow instructions in terminal.

EDIT - I did have to change HSA_OVERRIDE_GFX_VERSION in the Dockerfile. But even when I did this, it seems to default to CPU usage.

puddotv avatar Jan 05 '26 09:01 puddotv

For the Ryzen AI Max+ 395 (Strix Halo) you need: Kernel 6.18+

Uh, Ubuntu is still at Kernel 6.17 - look like no updates are available yet.

Gonna check if I can use another Docker base from another project, where ROCm 7.1 is already running.

bluemoehre avatar Jan 05 '26 15:01 bluemoehre

For the Ryzen AI Max+ 395 (Strix Halo) you need: Kernel 6.18+

Uh, Ubuntu is still at Kernel 6.17 - look like no updates are available yet.

Gonna check if I can use another Docker base from another project, where ROCm 7.1 is already running.

The latest kernel fixes are crucial, theres some way to install experimental kernels on ubuntu, too.

normen avatar Jan 05 '26 16:01 normen

The latest kernel fixes are crucial, theres some way to install experimental kernels on ubuntu, too.

Well, my others Dockers are working fine with llama.cpp and Ollama. It's just a nightmare setting everything up and getting ROCm to run.

bluemoehre avatar Jan 05 '26 17:01 bluemoehre

The latest kernel fixes are crucial, theres some way to install experimental kernels on ubuntu, too.

Well, my others Dockers are working fine with llama.cpp and Ollama. It's just a nightmare setting everything up and getting ROCm to run.

Yeah well, the kernel is about the only thing that docker doesn't replace.

normen avatar Jan 06 '26 07:01 normen

Had the same issue. I solved it like this:

FROM rocm/dev-ubuntu-22.04:latest

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
# Set the Hugging Face home directory for better model caching
ENV HF_HOME=/app/hf_cache

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    libsndfile1 \
    ffmpeg \
    python3 \
    python3-pip \
    python3-dev \
    python3-venv \
    git \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Create a symlink for python3 to be python for convenience
RUN ln -s /usr/bin/python3 /usr/bin/python

# Set up working directory
WORKDIR /app

# Copy requirements first to leverage Docker cache
COPY requirements-rocm.txt ./requirements.txt

# Upgrade pip and install Python dependencies
# Install torch and other dependencies first, then chatterbox-tts with --no-deps
# to bypass its torch==2.5.1 requirement (PyTorch 2.5.1 not available for ROCm 6.4.1)
RUN pip3 install --no-cache-dir --upgrade pip && \
    pip3 install --no-cache-dir -r requirements.txt && \
    pip3 install --no-cache-dir --no-deps git+https://github.com/devnen/chatterbox-v2.git@master

# Copy the rest of the application code
COPY . .

# Create required directories for the application (fixed syntax error)
RUN mkdir -p model_cache reference_audio outputs voices logs hf_cache

# Expose the port the application will run on
EXPOSE 8004

# Command to run the application
CMD ["python3", "server.py"]
# requirements.txt
# NOTE: chatterbox-tts is installed separately with --no-deps to avoid torch version conflicts
# See Dockerfile.rocm for installation order

# Core Web Framework
fastapi
uvicorn[standard]

# Machine Learning & Audio
torch @ https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torch-2.6.0%2Brocm6.4.1.git1ded221d-cp310-cp310-linux_x86_64.whl
torchaudio @ https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/torchaudio-2.6.0%2Brocm6.4.1.gitd8831425-cp310-cp310-linux_x86_64.whl
pytorch-triton-rocm @ https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4.1/pytorch_triton_rocm-3.2.0%2Brocm6.4.1.git6da9e660-cp310-cp310-linux_x86_64.whl
numpy>=1.24.0,<1.26.0  # Match chatterbox-v2 requirements
soundfile # Requires libsndfile system library (e.g., sudo apt-get install libsndfile1 on Debian/Ubuntu)
huggingface_hub
descript-audio-codec
safetensors

# Configuration & Utilities
pydantic
python-dotenv # Used ONLY for initial config seeding if config.yaml missing
Jinja2
python-multipart # For file uploads
requests # For health checks or other potential uses
PyYAML # For parsing presets.yaml AND primary config.yaml
tqdm

# Audio Post-processing
pydub
praat-parselmouth # For unvoiced segment removal
librosa # for changes to sampling
hf-transfer

# ============================================================================
# Chatterbox-tts dependencies (required when installing with --no-deps)
# ============================================================================
# NOTE: chatterbox-tts requires torch==2.5.1, but PyTorch 2.5.1 is not available
# for ROCm 6.4.1 (only 2.6.0 is available). We install chatterbox-tts with
# --no-deps to bypass the torch version constraint, then manually install
# all its dependencies here.
#
# To update: Check chatterbox-tts's pyproject.toml or setup.py for the full
# dependency list, then add any missing ones here (excluding torch/torchvision/torchaudio).
# ============================================================================
conformer==0.3.2
diffusers==0.29.0
resemble-perth==1.0.1  # Audio watermarking (imported as 'perth')
transformers==4.46.3
s3tokenizer
omegaconf==2.3.0  # Configuration management
resampy==0.4.3  # Audio resampling
silero-vad==5.1.2  # Voice activity detection

marcushoff avatar Jan 10 '26 19:01 marcushoff

Fixed in commit b181edb. The conflict was that requirements-rocm.txt pinned torch 2.6.0 from repo.radeon.com, but chatterbox-tts required torch 2.5.1 and the radeon repo didn't have a matching torchaudio 2.5.1.

The fix switches to PyTorch's official ROCm 6.1 wheel index which has torch 2.5.1, torchaudio 2.5.1, and torchvision 0.20.1 all available. These are installed via a separate requirements-rocm-init.txt before the main dependencies, and chatterbox is installed with --no-deps to prevent pip from overwriting the ROCm builds.

See the updated ROCm installation instructions in the README.

devnen avatar Mar 26 '26 21:03 devnen