Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +18 -15
Dockerfile
CHANGED
@@ -34,33 +34,34 @@ RUN python -m venv /home/user/venv
|
|
34 |
ENV VIRTUAL_ENV=/home/user/venv
|
35 |
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
36 |
|
|
|
37 |
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6"
|
38 |
-
ENV TCNN_CUDA_ARCHITECTURES=86;80;75;70;61;60
|
39 |
ENV FORCE_CUDA=1
|
40 |
|
|
|
41 |
ENV CUDA_HOME=/usr/local/cuda
|
42 |
-
ENV PATH=${CUDA_HOME}/bin
|
43 |
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
|
44 |
-
ENV LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH}
|
45 |
|
46 |
# Set home to the user's home directory
|
47 |
ENV HOME=/home/user \
|
48 |
-
PATH=/home/user/.local/bin:$PATH \
|
49 |
PYTHONPATH=$HOME/app \
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
|
57 |
# Set working directory
|
58 |
WORKDIR $HOME/app
|
59 |
|
60 |
-
# Upgrade pip and install numpy<2 first
|
61 |
RUN pip install --no-cache-dir --upgrade pip && \
|
62 |
-
pip install --no-cache-dir "numpy<2"
|
63 |
-
|
|
|
|
|
64 |
python -c "import torch; print('PyTorch version:', torch.__version__); print('CUDA Available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0))"
|
65 |
|
66 |
# Clone the repository
|
@@ -72,12 +73,14 @@ COPY requirements_HF.txt .
|
|
72 |
|
73 |
# Install Python dependencies
|
74 |
RUN pip install --no-cache-dir -r requirements_HF.txt
|
75 |
-
RUN pip install --no-cache-dir gradio ffmpeg-python dlib-bin
|
76 |
-
RUN pip install basicsr
|
77 |
|
78 |
# Set CUDA device settings
|
79 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
80 |
ENV CUDA_VISIBLE_DEVICES=0
|
81 |
|
|
|
|
|
|
|
82 |
# Command to run the application
|
83 |
CMD ["python", "app.py"]
|
|
|
34 |
ENV VIRTUAL_ENV=/home/user/venv
|
35 |
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
36 |
|
37 |
+
# Explicitly set CUDA and PyTorch environment variables
|
38 |
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6"
|
|
|
39 |
ENV FORCE_CUDA=1
|
40 |
|
41 |
+
# Correct CUDA paths to ensure visibility
|
42 |
ENV CUDA_HOME=/usr/local/cuda
|
43 |
+
ENV PATH=${CUDA_HOME}/bin:${PATH}
|
44 |
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
|
|
|
45 |
|
46 |
# Set home to the user's home directory
|
47 |
ENV HOME=/home/user \
|
|
|
48 |
PYTHONPATH=$HOME/app \
|
49 |
+
PYTHONUNBUFFERED=1 \
|
50 |
+
GRADIO_ALLOW_FLAGGING=never \
|
51 |
+
GRADIO_NUM_PORTS=1 \
|
52 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
53 |
+
GRADIO_THEME=huggingface \
|
54 |
+
SYSTEM=spaces
|
55 |
|
56 |
# Set working directory
|
57 |
WORKDIR $HOME/app
|
58 |
|
59 |
+
# Upgrade pip and install numpy<2 first
|
60 |
RUN pip install --no-cache-dir --upgrade pip && \
|
61 |
+
pip install --no-cache-dir "numpy<2"
|
62 |
+
|
63 |
+
# 🔥 Install PyTorch inside and outside virtualenv to prevent CUDA issues
|
64 |
+
RUN pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 && \
|
65 |
python -c "import torch; print('PyTorch version:', torch.__version__); print('CUDA Available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0))"
|
66 |
|
67 |
# Clone the repository
|
|
|
73 |
|
74 |
# Install Python dependencies
|
75 |
RUN pip install --no-cache-dir -r requirements_HF.txt
|
76 |
+
RUN pip install --no-cache-dir gradio ffmpeg-python dlib-bin basicsr
|
|
|
77 |
|
78 |
# Set CUDA device settings
|
79 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
80 |
ENV CUDA_VISIBLE_DEVICES=0
|
81 |
|
82 |
+
# Verify CUDA after all installs (Debugging Step)
|
83 |
+
RUN python -c "import torch; print('Final Check - CUDA Available:', torch.cuda.is_available())"
|
84 |
+
|
85 |
# Command to run the application
|
86 |
CMD ["python", "app.py"]
|