Docker Error Message - Error response from daemon: CDI device injection failed: unresolvable CDI devices
+] Running 1/2 ✔ chatterbox-tts-server Built 0.0s ⠋ Container chatterbox-tts-server-chatterbox-tts-server-1 Starting 0.0s Error response from daemon: CDI device injection failed: unresolvable CDI devices nvidia.com/gpu=all
I receive this error when trying to run the docker immage using ocker compose up -d --build to run the docker container I only have a mobile RTX 4060 with 8GB. I don't know if that might be the problem.
[+] Running 1/2 ✔ chatterbox-tts-server Built 0.0s
- Container chatterbox-tts-server-chatterbox-tts-server-1 Starting 0.4s Error response from daemon: CDI device injection failed: unresolvable CDI devices nvidia.com/gpu=all
I receive this error when trying to run the docker immage using ocker compose up -d --build to run the docker container I only have a mobile RTX 3060 with 6GB. I don't know if that might be the problem on my laptop
Thank you for reporting this. The deploy syntax is the modern way to request GPUs, but it isn't supported on all Docker setups. The runtime: nvidia key is the older, more compatible method.
I've updated the docker-compose.yml file to include both methods, with comments explaining how to switch between them. I've also added a note to the README.md to guide users who might encounter this issue. This should make the Docker setup more robust for everyone.
Thanks for fixing the Docker container. I have managed to get the program running using conda in the meantime and have noticed that when using the Docker version, the program runs abysmally slow compared to the conda version, to the point where I'm wondering if it is using cuda at all. It also throws up several errors. Furthermore, I can not seem to access the webui when I use the -d flag. Here is the log.
+] Running 1/1
✔ Container chatterbox-tts-server-chatterbox-tts-server-1 Recreated 0.1s
Attaching to chatterbox-tts-server-1
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | ==========
chatterbox-tts-server-1 | == CUDA ==
chatterbox-tts-server-1 | ==========
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | CUDA Version 12.8.1
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | This container image and its contents are governed by the NVIDIA Deep Learning Container License.
chatterbox-tts-server-1 | By pulling and using the container, you accept the terms and conditions of this license:
chatterbox-tts-server-1 | https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.
chatterbox-tts-server-1 | Use the NVIDIA Container Toolkit to start this container with GPU support; see
chatterbox-tts-server-1 | https://docs.nvidia.com/datacenter/cloud-native/ .
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | 2025-06-07 10:17:42 [INFO] main: Starting TTS Server directly on http://0.0.0.0:8004
chatterbox-tts-server-1 | 2025-06-07 10:17:42 [INFO] main: API documentation will be available at http://0.0.0.0:8004/docs
chatterbox-tts-server-1 | 2025-06-07 10:17:42 [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-06-07 10:17:42 [INFO] server: TTS Server: Initializing application...
chatterbox-tts-server-1 | 2025-06-07 10:17:42 [INFO] server: Configuration loaded. Log file at: /app/logs/tts_server.log
chatterbox-tts-server-1 | 2025-06-07 10:17:42 [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-06-07 10:17:42 [INFO] engine: Final device selection: cpu
chatterbox-tts-server-1 | 2025-06-07 10:17:42 [INFO] engine: Attempting to load model directly using from_pretrained (expected from Hugging Face repository: ResembleAI/chatterbox or library default).
chatterbox-tts-server-1 | /usr/local/lib/python3.10/dist-packages/diffusers/models/lora.py:393: FutureWarning: LoRACompatibleLinear is deprecated and will be removed in version 1.0.0. Use of LoRACompatibleLinear is deprecated. Please switch to PEFT backend by installing PEFT: pip install peft.
chatterbox-tts-server-1 | deprecate("LoRACompatibleLinear", "1.0.0", deprecation_message)
chatterbox-tts-server-1 | 2025-06-07 10:17:49 [INFO] root: input frame rate=25
chatterbox-tts-server-1 | /usr/local/lib/python3.10/dist-packages/perth/perth_net/perth_net_implicit/checkpoint_manager.py:36: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
chatterbox-tts-server-1 | return torch.load(ckpts[-1], map_location="cpu")
chatterbox-tts-server-1 | loaded PerthNet (Implicit) at step 250,000
chatterbox-tts-server-1 | 2025-06-07 10:17:50 [INFO] engine: Successfully loaded TTS model using from_pretrained on cpu (expected from 'ResembleAI/chatterbox' or library default).
chatterbox-tts-server-1 | 2025-06-07 10:17:50 [INFO] engine: TTS Model loaded successfully on cpu. Engine sample rate: 24000 Hz.
chatterbox-tts-server-1 | 2025-06-07 10:17:50 [INFO] server: TTS Model loaded successfully via engine.
chatterbox-tts-server-1 | 2025-06-07 10:17:50 [INFO] server: Application startup sequence complete.
chatterbox-tts-server-1 | INFO: Application startup complete.
chatterbox-tts-server-1 | INFO: Uvicorn running on http://0.0.0.0:8004 (Press CTRL+C to quit)
chatterbox-tts-server-1 | 2025-06-07 10:17:51 [INFO] server: Attempting to open web browser to: http://localhost:8004/
chatterbox-tts-server-1 | 2025-06-07 10:21:12 [INFO] server: Request received for main UI page ('/').
chatterbox-tts-server-1 | 2025-06-07 10:21:13 [INFO] server: Request received for /api/ui/initial-data.
chatterbox-tts-server-1 | 2025-06-07 10:21:13 [INFO] utils: Found 28 predefined voices in /app/voices
chatterbox-tts-server-1 | 2025-06-07 10:21:13 [INFO] server: Request received for /save_settings.
chatterbox-tts-server-1 | 2025-06-07 10:21:13 [INFO] config: TTS processing device resolved to: cuda
chatterbox-tts-server-1 | 2025-06-07 10:21:13 [WARNING] config: Could not create backup of config.yaml: [Errno 16] Device or resource busy: 'config.yaml'
chatterbox-tts-server-1 | 2025-06-07 10:21:13 [INFO] config: Configuration successfully saved to config.yaml
chatterbox-tts-server-1 | 2025-06-07 10:21:13 [INFO] config: Configuration updated, saved, and re-resolved successfully.
chatterbox-tts-server-1 | 2025-06-07 10:21:15 [INFO] server: Received /tts request: mode='predefined', format='wav'
chatterbox-tts-server-1 | 2025-06-07 10:21:15 [INFO] server: Using predefined voice: Emily.wav
chatterbox-tts-server-1 | 2025-06-07 10:21:15 [INFO] server: Processing text as a single chunk (splitting not enabled or text too short).
chatterbox-tts-server-1 | 2025-06-07 10:21:15 [INFO] server: Synthesizing chunk 1/1...
chatterbox-tts-server-1 | 2025-06-07 10:21:15 [INFO] engine: Applying user-provided seed for generation: 3000
chatterbox-tts-server-1 | 2025-06-07 10:21:15 [INFO] engine: Global seed set to: 3000
chatterbox-tts-server-1 | 2025-06-07 10:21:22 [WARNING] root: Reference mel length is not equal to 2 * reference token length.
chatterbox-tts-server-1 |
chatterbox-tts-server-1 | /usr/lib/python3.10/contextlib.py:103: FutureWarning: torch.backends.cuda.sdp_kernel() is deprecated. In the future, this context manager will be removed. Please see torch.nn.attention.sdpa_kernel() for the new context manager, with updated signature.
chatterbox-tts-server-1 | self.gen = func(*args, **kwds)
chatterbox-tts-server-1 | LlamaModel is using LlamaSdpaAttention, but torch.nn.functional.scaled_dot_product_attention does not support output_attentions=True. Falling back to the manual attention implementation, but specifying the manual implementation will be required from Transformers version v5.0.0 onwards. This warning can be removed using the argument attn_implementation="eager" when loading the model.
Sampling: 0%| | 0/1000 [00:00<?, ?it/s]We detected that you are passing past_key_values as a tuple of tuples. This is deprecated and will be removed in v4.47. Please convert your cache or use an appropriate Cache class (https://huggingface.co/docs/transformers/kv_cache#legacy-cache-format)
Sampling: 40%|████ | 401/1000 [00:50<01:15, 7.98it/s]
chatterbox-tts-server-1 | 2025-06-07 10:22:38 [INFO] utils: Encoded 769964 bytes to 'wav' at 24000Hz in 0.001 seconds.
chatterbox-tts-server-1 | 2025-06-07 10:22:38 [INFO] server: Successfully generated audio: tts_output_20250607_102238.wav, 769964 bytes, type audio/wav.
w Enable Watch
It is using CPU according to the server log. Dockerfile was using the CPU version of CUDA. Try to recreate Docker container using the files that I have updated today: https://github.com/devnen/Chatterbox-TTS-Server#-docker-installation
Thanks, that completely resolved the issue. It now even builds without me having to comment out anything. Is there any chance you could raise the limit of the text the web interface can work with? I'd prefer it if there were no limit at all. Otherwise, creating audiobooks with this software will be difficult.
I am glad it is working now. What text limit are you hitting? Let me know the details so I can look into it.
You can see it right in the Webui You can only paste 8192 characters. Also, I just noticed that the WebUI does require an internet connection at startup to load properly. It would be really cool if that wasn't a requirement. For longer texts, the ability to save to MP3 instead of WAV would be crucial, I think. Unless there is a way to tell the program where to save the files to. Can you take the folder, place it on an external hard drive and start the program from there somehow, so storage space isn't a problem? Thanks for all your hard work!
I have fixed the problem but still need to test before updating the project. The problem is with UI, the server and the API already support mp3 and unlimited text input. There are no output files unless instructed in the config.yaml. All audio processing is performed in RAM by default.
I'm sure I'm misunderstanding something here because when I use the Web UI, I do get an output file. I wanted to try and use the API, but when I tried to open the /docs page for instructions, I only got an empty web page. Moreover, I'm not sure I'd want to use a third party interface because that doesn't offer me your preconfigured profiles. I don't know what you did exactly, but just manually changing the values you changed in the UI in an other similar project did not lead to the same output your web interface provided.
I have been working on an UI update and have some good news. You will now be able to paste much longer texts into the UI as the previous limit has been removed. The UI also now supports MP3 and Opus output. Plus, you can run the Web UI directly from the index.html file offline, and it will connect to your local server. Regarding file saving, audio is processed in RAM by default, and files are only saved if you set an output path in config.yaml. You can always click the Download button in the UI to download the generated audio.
Thanks for the adjustments. The Docker image now works as expected. Although I'm still getting an error when launching the Docker file.
2025-06-13 18:44:42 [INFO] root: input frame rate=25
chatterbox-tts-server-1 | /usr/local/lib/python3.10/dist-packages/perth/perth_net/perth_net_implicit/checkpoint_manager.py:36: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
chatterbox-tts-server-1 | return torch.load(ckpts[-1], map_location="cpu")
chatterbox-tts-server-1 | loaded PerthNet (Implicit) at step 250,000
chatterbox-tts-server-1 | 2025-06-13 18:44:43 [INFO] engine: Successfully loaded TTS model using from_pretrained on cuda (expected from 'ResembleAI/chatterbox
The non-Docker version is now no longer using the GPU. Since I'm using the Docker version anyway, I don't really care. I just thought you should know. Here's the log.
Miniforge3/envs/chatterbox2/lib/python3.10/contextlib.py:103: FutureWarning: torch.backends.cuda.sdp_kernel() is deprecated. In the future, this context manager will be removed. Please see torch.nn.attention.sdpa_kernel() for the new context manager, with updated signature.
self.gen = func(*args, **kwds)
LlamaModel is using LlamaSdpaAttention, but torch.nn.functional.scaled_dot_product_attention does not support output_attentions=True. Falling back to the manual attention implementation, but specifying the manual implementation will be required from Transformers version v5.0.0 onwards. This warning can be removed using the argument attn_implementation="eager" when loading the model.
Sampling: 0%| | 0/1000 [00:00<?, ?it/s]We detected that you are passing past_key_values as a tuple of tuples. This is deprecated and will be removed in v4.47. Please convert your cache or use an appropriate Cache class (https://huggingface.co/docs/transformers/kv_cache#legacy-cache-format)
Sampling: 26%|███████▉ | 263/1000 [00:30<01:26, 8.55it/s]
2025-06-13 21:19:37 [INFO] server: Synthesizing chunk 2/2...
2025-06-13 21:19:37 [INFO] engine: Applying user-provided seed for generation: 42
2025-06-13 21:19:37 [INFO] engine: Global seed set to: 42
2025-06-13 21:19:38 [WARNING] root: Reference mel length is not equal to 2 * reference token length.
Sampling: 28%|████████▎ | 279/1000 [00:32<01:23, 8.66it/s] 2025-06-13 21:20:26 [INFO] utils: Encoded 87213 bytes to 'mp3' at 24000Hz in 0.147 seconds. 2025-06-13 21:20:26 [INFO] server: Successfully generated audio: tts_output_20250613_212026.mp3, 87213 bytes, type audio/mp3.