Farama-Foundation / Arcade-Learning-Environment

The Arcade Learning Environment (ALE) -- a platform for AI research.
https://ale.farama.org/
GNU General Public License v2.0
2.14k stars 420 forks source link

Support for Linux ARM64 #483

Open XavierGeerinck opened 1 year ago

XavierGeerinck commented 1 year ago

Hi All!

Thank you for this amazing project. I am just wondering, is Linux ARM64 supported? I am trying to compile and install it myself with the below, but it appears that the ROMs are not found then:

# Install dependencies for building ALE
RUN apt update && \
    apt install -y python3 python3-pip git cmake libsdl2-dev libboost-all-dev

# Clone the ale-py repository
RUN git clone https://github.com/mgbellemare/Arcade-Learning-Environment.git /ale

RUN cd ale \
    && pip install . \
    && python setup.py bdist_wheel

Which results in when starting a program

/usr/local/lib/python3.8/site-packages/gymnasium/envs/registration.py:604: UserWarning: WARN: plugin: shimmy.registration:register_gymnasium_envs raised Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/gymnasium/envs/registration.py", line 602, in load_plugin_envs
    fn()
  File "/usr/local/lib/python3.8/site-packages/shimmy/registration.py", line 263, in register_gymnasium_envs
    _register_atari_envs()
  File "/usr/local/lib/python3.8/site-packages/shimmy/registration.py", line 207, in _register_atari_envs
    _register_atari_configs(
  File "/usr/local/lib/python3.8/site-packages/shimmy/registration.py", line 131, in _register_atari_configs
    from ale_py.roms import utils as rom_utils
ModuleNotFoundError: No module named 'ale_py.roms'
JesseFarebro commented 1 year ago

Hi @XavierGeerinck,

There shouldn't be a problem with ARM64. We already publish ARM wheels for macOS.

Are you sure there's not a local directory named ale_py? Can you try to install via pip with verbose mode enabled, i.e., pip install . --verbose, and post the logs here?

Also, if you can post the exact Dockerfile that's able to reproduce the bug, I could also take a look at that.

XavierGeerinck commented 1 year ago

Hi! Thanks a lot for coming back so soon. I got it working eventually with the below

# Install dependencies for building ALE
RUN apt update && \
    apt install -y python3 python3-pip git cmake libsdl2-dev libboost-all-dev

# Clone the ale-py repository
RUN git clone https://github.com/mgbellemare/Arcade-Learning-Environment.git /ale

# Build ale-py and package it as wheel
RUN mkdir /tmp/ale-build \
    && cd /tmp/ale-build \
    && cmake -DUSE_SDL=OFF -DUSE_RLGLUE=OFF -DBUILD_EXAMPLES=OFF /ale \
    && make \
    && cd /ale \
    && pip install .
JesseFarebro commented 1 year ago

As ARM data center processors are becoming ever more popular I plan on releasing prebuilt wheels for manylinux_aarch64 next release.

andywatts commented 3 months ago

A manylinux_aarch64 release would help with linux containers on mac too...

pseudo-rnd-thoughts commented 3 months ago

@andywatts would you be able to make a PR for this? It should be necessary to just update the GitHub/actions/build script for generating wheels