Skip to content

GPU ISSUES

Drew Thomasson edited this page Jun 4, 2025 · 16 revisions

Help! I'm running ebook2audiobook but my NVIDIA GPU is never detected only CPU works!

First check what CUDA version You have installed

# You can check with either of these commands

nvidia-smi # Using NVIDIA System Management Interface

nvcc --version # Using the CUDA Toolkit Version (Compiler Version)

nvcc -V # Using the CUDA Toolkit Version (Compiler Version)
Example nvidia-smi Output Click to expand
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.05   Driver Version: 535.104.05   CUDA Version: 12.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce RTX 4090    Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   34C    P8    23W / 450W |     22MiB / 24564MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
...
Example nvcc Output Click to expand
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.32793473_0

⚠️ Make sure that Ebook2Audiobook is NOT running before you run these next commands ⬇️

Local installation

Install the correct CUDA version of pytorch into the .\python_env\ located in the ebook2audiobook

  • The .\python_env\ is created when you first run ebook2audiobook.cmd or ebook2audiobook.sh
cd ebook2audiobook # Go into the ebook2audiobook folder

conda activate .\python_env\ # Activate the Python env

# For CUDA 12.8 
pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128

# For CUDA 11.8
pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# For CUDA 12.1
pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

# etc...

# Run ebook2audiobook again to see if it worked

./ebook2audiobook.cmd # Windows

./ebook2audiobook.sh # Mac/Linux

Docker

  1. First build the image with the correct CUDA version
# For CUDA 12.8
docker build -t athomasson2/ebook2audiobook . --build-arg TORCH_VERSION=cuda128

# For CUDA 12.1
docker build -t athomasson2/ebook2audiobook . --build-arg TORCH_VERSION=cuda121

# For CUDA 11.8
docker build -t athomasson2/ebook2audiobook . --build-arg TORCH_VERSION=cuda118
  1. Try running the build ebook2audiobook image
docker run --rm -p 7860:7860 athomasson2/ebook2audiobook

Docker compose

  1. Modify the docker-compose.yml or podman-compose.yml
Change *gpu-disabled -> *gpu-enabled
# Specify the correct Torch CUDA VERSION at 
TORCH_VERSION= [cuda121, cuda118, cuda128, rocm, xpu, cpu]  # All CUDA version numbers should work, Ex: CUDA 11.6-> cuda116
  1. Start the Service again
# Docker
docker-compose up -d # To update add --build

# Podman
podman compose -f podman-compose.yml up -d # To update add --build
Clone this wiki locally