Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump up Dockerfile and compose to newer syntax format, bump to Torch 2.4.0+CUDA 12.4, updated other deps and more #307

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
ENV HOST 0.0.0.0
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y git build-essential portaudio19-dev \
python3 python3-pip gcc wget \
ocl-icd-opencl-dev opencl-headers clinfo \
libclblast-dev libopenblas-dev libaio-dev \
&& mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd \
&& ln -s /usr/bin/python3 /usr/bin/python
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
ENV HOST=0.0.0.0

RUN <<EOR
apt-get update
apt-get upgrade -y
apt-get install -y git build-essential portaudio19-dev \
python3 python3-pip python-is-python3 gcc wget \
ocl-icd-opencl-dev opencl-headers clinfo \
libclblast-dev libopenblas-dev libaio-dev

# Need this 440MB dep on 22.04 otherwise TTS Analyze is very sad if we don't have 11.8 CUDA and lack the dep:
# Could not load library libcudnn_ops_infer.so.8. Error: libcudnn_ops_infer.so.8: cannot open shared object file: No such file or directory
# https://github.com/SYSTRAN/faster-whisper/issues/516#issuecomment-2201088567
apt-get install -y libcudnn8

mkdir -p /etc/OpenCL/vendors
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
apt-get clean && rm -rf /var/lib/apt/lists/*
EOR

WORKDIR /app
ENV CUDA_DOCKER_ARCH=all
COPY system/requirements/requirements_docker.txt system/requirements/requirements_docker.txt
RUN pip install --no-cache-dir --no-deps -r system/requirements/requirements_docker.txt && \
pip install --no-cache-dir deepspeed

COPY . .
RUN <<EOR
pip install --no-cache-dir --no-deps -r system/requirements/requirements_docker.txt
pip install --no-cache-dir deepspeed
EOR

EXPOSE 7851 7852
RUN chmod +x launch.sh
ENTRYPOINT ["sh", "-c", "./launch.sh"]
ENTRYPOINT ["sh", "-c", "./launch.sh"]
30 changes: 30 additions & 0 deletions Dockerfile.nvidia
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
ENV HOST=0.0.0.0

RUN <<EOR
apt-get update
apt-get upgrade -y
apt-get install -y git build-essential portaudio19-dev \
python3 python3-pip python-is-python3 gcc wget \
ocl-icd-opencl-dev opencl-headers clinfo \
libclblast-dev libopenblas-dev

mkdir -p /etc/OpenCL/vendors
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
apt-get clean && rm -rf /var/lib/apt/lists/*
EOR

WORKDIR /app
ENV CUDA_DOCKER_ARCH=all
ENV PIP_CACHE_DIR=/app/pip_cache
RUN mkdir /app/pip_cache

COPY . .
RUN <<EOR
pip install --no-cache-dir --no-deps -r system/requirements/requirements_standalone.txt --cache-dir=/app/pip_cache
pip install --no-cache-dir deepspeed --cache-dir=/app/pip_cache
EOR

EXPOSE 7851
RUN chmod +x launch.sh
ENTRYPOINT ["sh", "-c", "./launch.sh"]
170 changes: 85 additions & 85 deletions README.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_requirements_file():
this_dir = Path(__file__).parent # Assuming 'this_dir' is defined as the script's directory
requirements_dir = this_dir / 'system' / 'requirements'
requirements_files = list(requirements_dir.glob('requirements*.txt')) # Using pathlib for globbing

if not requirements_files:
print("\033[91mNo requirements files found.\033[0m")
return None
Expand Down Expand Up @@ -66,7 +66,7 @@ def get_gpu_info():
return result.stdout
except FileNotFoundError:
return "NVIDIA GPU information not available"

def get_cpu_info():
cpu_info = {
'physical_cores': psutil.cpu_count(logical=False),
Expand Down Expand Up @@ -136,7 +136,7 @@ def find_files_in_path_with_wildcard(pattern):
def log_system_info():
# System information
os_version = platform.system() + " " + platform.version()

# Get CUDA_HOME environment variable
cuda_home = os.environ.get('CUDA_HOME', 'N/A')

Expand Down Expand Up @@ -186,7 +186,7 @@ def log_system_info():
path_env = os.environ.get('PATH', 'N/A')

# Check for cublas
file_name = 'cublas64_11.*' if platform.system() == "Windows" else 'libcublas.so.11*'
file_name = 'cublas64_12.*' if platform.system() == "Windows" else 'libcublas.so.12*'
found_paths = find_files_in_path_with_wildcard(file_name)

# Compare with requirements file
Expand Down Expand Up @@ -228,9 +228,9 @@ def log_system_info():
logging.info(f" CUDA Working: {cuda_test_result}")
logging.info(f" CUDA_HOME: {cuda_home}")
if found_paths:
logging.info(f" Cublas64_11 Path: {', '.join(found_paths)}")
logging.info(f" Cublas64_12 Path: {', '.join(found_paths)}")
else:
logging.info(f" Cublas64_11 Path: Not found in any search path directories.")
logging.info(f" Cublas64_12 Path: Not found in any search path directories.")
logging.info("\nPYTHON & PYTORCH:")
logging.info(f" Torch Version: {torch_version}")
logging.info(f" Python Version: {platform.python_version()}")
Expand Down Expand Up @@ -268,9 +268,9 @@ def log_system_info():
print(f"\033[94mCUDA Working:\033[0m \033[92m{cuda_test_result}\033[0m")
print(f"\033[94mCUDA_HOME:\033[0m \033[92m{cuda_home}\033[0m")
if found_paths:
print(f"\033[94mCublas64_11 Path:\033[0m \033[92m{', '.join(found_paths)}\033[0m")
print(f"\033[94mCublas64_12 Path:\033[0m \033[92m{', '.join(found_paths)}\033[0m")
else:
print(f"\033[94mCublas64_11 Path:\033[0m \033[91mNot found in any search path directories.\033[0m")
print(f"\033[94mCublas64_12 Path:\033[0m \033[91mNot found in any search path directories.\033[0m")
print(f"\033[94m\nTorch Version:\033[0m \033[92m{torch_version}\033[0m")
print(f"\033[94mPython Version:\033[0m \033[92m{platform.python_version()}\033[0m")
print(f"\033[94mPython Executable:\033[0m \033[92m{python_executable}\033[0m")
Expand Down Expand Up @@ -302,17 +302,17 @@ def log_system_info():
# Print colored output
print(f" {package_name.ljust(max_package_length)} Required: {color_required}{operator} {required_version.ljust(12)}\033[0m Installed: {color_installed}{installed_version}\033[0m")

print("\nOn Nvidia Graphics cards machines, if your \033[92mInstalled\033[0m version of \033[92mTorch\033[0m and \033[92mTorchaudio\033[0m does")
print("not have \033[92m+cu118\033[0m (Cuda 11.8) or \033[92m+cu121\033[0m (Cuda 12.1) listed after them, you do not have CUDA")
print("\nOn Nvidia Graphics cards machines, if your \033[92mInstalled\033[0m version of \033[92mTorch\033[0m and \033[92mTorchaudio\033[0m does")
print("not have \033[92m+cu124\033[0m (Cuda 12.4) listed after them, you do not have CUDA")
print("installed for Torch or Torchaudio in this Python environment. This will cause you problems")
print("with \033[94mAllTalk\033[0m and \033[94mFinetuning.\033[0m You may have to 'pip install' a new version of torch and")
print("torchaudio, using '\033[94m--upgrade --force-reinstall\033[0m' with the correct version of PyTorch for\033[0m")
print("your Python environment.\033[0m")
print("\033[94m\nRequirements file specifier meanings:\033[0m")
explanation = textwrap.dedent("""
== Exact version != Any version except < Less than
== Exact version != Any version except < Less than
<= Less than or equal to > Greater than >= Greater than or equal to
~ Compatible release ; Environment marker AND Logical AND
~ Compatible release ; Environment marker AND Logical AND
OR Logical OR
""")
print(explanation.strip())
Expand Down
3 changes: 1 addition & 2 deletions docker-compose-cuda.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
alltalk-tts:
image: erew123/alltalk_tts:cuda
Expand All @@ -17,4 +16,4 @@ services:
devices:
- driver: nvidia
count: all
capabilities: [ gpu ]
capabilities: [gpu]
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
alltalk-tts:
image: ${IMAGE:-alltalk:v1-9c}
Expand All @@ -24,4 +23,4 @@ services:
devices:
- driver: nvidia
count: all
capabilities: [ gpu ]
capabilities: [gpu]
Loading