[go: nahoru, domu]

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

Docker image #95

Open
johnnynunez opened this issue Dec 23, 2023 · 3 comments
Open

Docker image #95

johnnynunez opened this issue Dec 23, 2023 · 3 comments

Comments

@johnnynunez
Copy link

Is it possible to use asahi linux as docker image for ML/DL?
I mean, apple not distribute macos images in docker,(only linux images are distributed) so it's not possible to use MPS or MLX.
Is it possible to use this asahi linux and run with gpu support?

@angelbirth
Copy link

AFAIK asahi linux only runs on bare metal, so either you install it on your mac, or use generic arm64 linux image for docker

@johnnynunez
Copy link
Author
johnnynunez commented Dec 23, 2023

AFAIK asahi linux only runs on bare metal, so either you install it on your mac, or use generic arm64 linux image for docker

thanks! for example I would like to run this type of algorithms:

ARG PYTORCH="1.9.1"
ARG CUDA="11.1"
ARG CUDNN="8"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

RUN export TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 8.0+PTX" \
	&& export TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \
	&& export CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" 

# INIT OF FIX FOR GPG KEY -- Hopefully they will fix this soon
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
# END OF FIX FOR GPG KEY

# apt and apt-get update
RUN apt-get update && apt update && apt upgrade -y && apt-get clean
# apt and apt-get installations
RUN apt install -y vim git unzip \
	&& apt-get install -y libosmesa6-dev build-essential libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev

RUN mkdir /software
ENV SW_PATH=/software
WORKDIR $SW_PATH

ENV CONDA_DIR /opt/conda
ENV PATH $CONDA_DIR/bin:$PATH

RUN echo "Installing basic conda environment..." \
	&& conda create --name main python=3.9.5 \
	&& . /opt/conda/etc/profile.d/conda.sh \
	&& conda activate main \
	&& conda install numpy \
	&& pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html \
	&& pip install tensorflow==2.8.0 \
	&& pip install opencv-contrib-python pyyaml yacs tqdm colorama matplotlib cython tensorboardX imageio imageio-ffmpeg munkres pandas seaborn h5py sklearn 

but using asahi as base, because use ubuntu vainilla doesn’t have mps acceleration

@ziw-liu
Copy link
ziw-liu commented Mar 20, 2024

MPS is Apple's proprietary API and is not available on Linux unless someone writes a translation layer (like dxvk).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants