mikazlopes / training-farm

Initiate multiple trainer scripts allowing to train agents based on the FINRL library
4 stars 3 forks source link

FinRL on Ubuntu (running on Mac M2) #6

Closed FabioMD1972 closed 7 months ago

FabioMD1972 commented 8 months ago

Hi, I look at you repository an looks very interesting. I'm trying to build a dev environment on a docker running on Ubuntu virtual machine on Mac M2 but I got a lot of problems. Here you can find the Docker file:


FROM ubuntu:20.04

RUN apt update
RUN apt install -y zip htop screen wget vim git

#install python
WORKDIR /root/
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh
RUN chmod +x Miniconda3-latest-Linux-aarch64.sh
RUN /root/Miniconda3-latest-Linux-aarch64.sh -b && eval "$(/root/miniconda3/bin/conda shell.bash hook)" && /root/miniconda3/bin/conda clean -afy
RUN /root/miniconda3/bin/conda init
RUN echo 'conda activate rlenv' >> ~/.bashrc
RUN /root/miniconda3/bin/conda create --name rlenv python==3.10
RUN /root/miniconda3/bin/conda run -n rlenv pip install seaborn thop flask

RUN apt install -y build-essential
RUN apt update
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get install -y libglib2.0-0 libsm6 libxrender1 libxext6

#COPY requirements.txt /root/requirements.txt
#RUN /root/miniconda3/bin/conda run -n rlenv pip install -r /root/requirements.txt

RUN git config --global --add safe.directory /workfolder

# go to code folder
WORKDIR /workfolder

#Install FinRL
RUN apt update 
RUN apt install -y cmake libopenmpi-dev python3-dev zlib1g-dev libgl1-mesa-glx swig libopenblas-dev
#RUN /root/miniconda3/bin/conda run -n rlenv pip install git+https://github.com/AI4Finance-Foundation/FinRL.git

and here the error:

_INFO: pip is still looking at multiple versions of shimmy[atari] to determine which version is compatible with other requirements. This could take a while. Using cached stable_baselines3-2.0.0a9-py3-none-any.whl.metadata (5.3 kB) Using cached stablebaselines3-2.0.0a5-py3-none-any.whl (177 kB) ERROR: Could not find a version that satisfies the requirement ale-py~=0.8.1; extra == "atari" (from shimmy[atari]) (from versions: none) ERROR: No matching distribution found for ale-py~=0.8.1; extra == "atari" (rlenv) root@ubuntuonmac:/workfolder# python -V Python 3.10.13 (rlenv) root@ubuntuonmac:/workfolder# uname -a Linux ubuntuonmac 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:29:11 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux (rlenv) root@ubuntuonmac:/workfolder#

Have you any suggestion to help me? (I know M2 is not the best HW to dev. ;-)) )

bye, F.

mikazlopes commented 8 months ago

Hi Fabio,

Unfortunately, to build the docker image on an Apple Silicone, you need to build with the --platform Linux/amd64; several SB3 or other library packages have some dependencies that do not have an ARM64 version and cause the FINRL to fail. I use a Mac M1 and run the code directly; the docker image is when I use cloud services such as vast.ai or podrun.io to run the training. BTW, the Apple Silicone for this particular model (FINRL) is twice as fast as any CUDA-enabled device because there are no images, and the state and action spaces are small.

I hope it helped.

FabioMD1972 commented 8 months ago

Hi Miguel,

Than you for your reply. I'm not so smart to solve this problem, but still looking for a solution.

Ciao, F.

On Fri, Dec 22, 2023, 17:52 Miguel Lopes @.***> wrote:

Hi Fabio,

Unfortunately, to build the docker image on an Apple Silicone, you need to build with the --platform Linux/amd64; several SB3 or other library packages have some dependencies that do not have an ARM64 version and cause the FINRL to fail. I use a Mac M1 and run the code directly; the docker image is when I use cloud services such as vast.ai or podrun.io to run the training. BTW, the Apple Silicone for this particular model (FINRL) is twice as fast as any CUDA-enabled device because there are no images, and the state and action spaces are small.

I hope it helped.

— Reply to this email directly, view it on GitHub https://github.com/mikazlopes/training-farm/issues/6#issuecomment-1867892060, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGNU53S3Z2RMOEQCNE3GO73YKW3GXAVCNFSM6AAAAABA75UZYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXHA4TEMBWGA . You are receiving this because you authored the thread.Message ID: @.***>

mikazlopes commented 7 months ago

Issue closed