You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the current Dockerfile.gpu with this Metal-compatible version:
# Use Python base image for ARM64
FROM --platform=linux/arm64 python:3.9-slim
# System dependencies
RUN apt-get update && apt-get install -y \
unzip \
graphviz \
curl \
musescore3 \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
WORKDIR /app
# Install TensorFlow for Mac (Metal GPU support)
RUN pip install tensorflow-macos tensorflow-metal
COPY ./requirements.txt /app
# Modify your requirements.txt installation
# Remove tensorflow if it's in requirements.txt since we installed tensorflow-macos
RUN grep -v "tensorflow" requirements.txt > requirements_filtered.txt && \
pip install -r requirements_filtered.txt
COPY /notebooks/. /app/notebooks
COPY /scripts/. /app/scripts
ENV PYTHONPATH="${PYTHONPATH}:/app"
Update the requirement.txt file to use macos tensorflow libraries:
# Core ML Libraries
tensorflow-macos>=2.10.0 # Apple Silicon specific TensorFlow
tensorflow-metal>=0.7.0 # Metal GPU acceleration support
tensorflow-probability==0.18.0 # Keep same version for compatibility
# Scientific Computing
matplotlib==3.6.3
scipy==1.10.0
scikit-learn==1.2.1
scikit-image==0.19.3
pandas==1.5.3
# Development Tools
jupyterlab==3.5.3
black[jupyter]==23.1.0
click==8.0.4
flake8==5.0.4
flake8-nb==0.5.2
ipywidgets==8.0.4
# Domain Specific
music21==8.1.0
kaggle==1.5.12
pydot==1.4.2
Important Notes:
This setup uses TensorFlow-Metal, which is specifically designed for Apple Silicon.
You might experience some compatibility issues with certain TensorFlow operations or models, as not all features are fully supported on Metal yet.
The performance characteristics might differ from NVIDIA GPU implementations.
Alternative Recommendation:
Given that you're running on Apple Silicon, you might want to consider running your ML workload directly on the host machine instead of using Docker. This would give you better performance and direct access to the Metal GPU. You could:
Use miniforge to create a conda environment
Install tensorflow-macos and tensorflow-metal directly
Run your notebooks locally
The text was updated successfully, but these errors were encountered:
I tried these steps above and got this error
regarding what it was saying I tried to fix but no luck
[app 6/8] RUN pip install -r /app/requirements.txt:
0.271 ERROR: Could not find a version that satisfies the requirement tensorflow-macos>=2.10.0 (from versions: none)
0.285 ERROR: No matching distribution found for tensorflow-macos>=2.10.0
failed to solve: process "/bin/sh -c pip install -r /app/requirements.txt" did not complete successfully: exit code: 1
Uh oh!
There was an error while loading. Please reload this page.
I thought I might try and get the Docker GPU image working on my M4 with GPU.
Changes are needed to switch from NVIDIA to Tensorflow.
Warp/Claude suggested changes are below, but before I embark on this mission, has anyone tried this and is it achievable or worth it?
Suggested changes:
After reviewing your docker-compose.gpu.yml file, there are several changes needed to make it work on your M4 MacBook Pro with Metal GPU support:
Important Notes:
Alternative Recommendation:
Given that you're running on Apple Silicon, you might want to consider running your ML workload directly on the host machine instead of using Docker. This would give you better performance and direct access to the Metal GPU. You could:
The text was updated successfully, but these errors were encountered: