Ray for Rapberry Pi, is possible?

This is how our CI builds wheels. ray/.travis.yml at master · ray-project/ray · GitHub Eventually this goes down all the paths you mentioned, but you eventually want to be calling option 1.

That warning/error you’re coming across is another example of us assuming an x86 instruction set (64 bit longs). Can you change the 2L to 2ULL and try again?

1 Like

@Alex Thank You for the answer. I have changed 2L to 2ULL in https://github.com/ray-project/ray/blob/ray-1.2.0/src/ray/common/ray_config_def.h, I will inform about results.

@Alex After changing 2L to 2ULL the errors are:

error: undefined reference to ‘__atomic_load_8’

Hmm it seems like we’re going in circles. How did you solve this problem? Ray for Rapberry Pi, is possible? - #18 by Peter_Pirog

@Alex when I built opencv_python_headles file I installed:

sudo apt-get install -y libatomic-ops-dev

and set flags:

export CMAKE_ARGS=“-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=~/libraries/opencv -DOPENCV_EXTRA_MODULES_PATH=~/builds/opencv_contrib/modules -DENABLE_NEON=ON -DENABLE_VFPV3=ON -DINSTALL_PYTHON_EXAMPLES=OFF -DCMAKE_CXX_FLAGS=-latomic -DOPENCV_EXTRA_EXE_LINKER_FLAGS=-latomic -DBUILD_NEW_PYTHON_SUPPORT=ON -DBUILD_opencv_python3=ON -DHAVE_opencv_python3=ON -DBUILD_opencv_python2=OFF -DPYTHON_DEFAULT_EXECUTABLE=/home/pi/src/Python-3.8.5/bin/python3.8 -DBUILD_EXAMPLES=OFF -DOPENCV_ENABLE_NONFREE=ON -DWITH_CUDA=OFF”

and it worked for opencv but now I don’t know how to set during compilation path to

/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0

I added command below but it still doesn’t work:

export LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0

1 Like

@Alex I have achieved next phase in raspberry pi ray building. The building process is successful:

Steps:

git clone --recursive --branch ray-1.2.0 GitHub - ray-project/ray: Ray is a unified framework for scaling AI and Python applications. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
sudo chmod -R 777 ./ray

!!! I have changed 2L to 2ULL in /src/ray/common/ray_config_def.h in line 200 !!!

sudo apt-get install -y libatomic-ops-dev
cd ./ray
export LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf:$LD_LIBRARY_PATH
sudo bazel build --action_env=LD_LIBRARY_PATH --linkopt=-latomic -c opt //:ray_pkg

Now the question is: “How to generate whl file ??” The result is:

Nice! You can check out how the CI builds wheels here: ray/.travis.yml at master · ray-project/ray · GitHub

you can probably just run python python/setup.py bdist_wheel if everything is set up properly, but in general, the recommendation is to just do as the ci does.

@Alex , Thank you for the suggestions. I tested python setup.py bdist_wheel but the result is my favourite error :wink:
error: undefined reference to ‘__atomic_load_8’

maybe in some way I have to set linker variables for it -I’m not sure. Tthe steps to the success are very small but there is still some progress. I will analyze https://github.com/ray-project/ray/blob/master/.travis.yml#L208 and maybe I will find some solution.
Thank You again.

@Alex I next step I have corrected:

!!! CHANGE LINE 296 in /src/ray/common/ray_config_def.hray/python/setup.py to
[“build”, “–linkopt=-latomic”, “–”] + bazel_targets, setup.py line 296

and

cd /ray/python
sudo python3 setup.py bdist_wheel
cd /ray/python/dist
python3 -m pip install ray-1.2.0-cp38-cp38-linux_armv7l.whl

whl instalation is correct :grinning:, next problem to solve is building whl tensorflow==2.4.1 for python 3.8 armv7 (now I have only for 3.7)
Link to WHL file: https://github.com/PeterPirog/Raspberry_armv7_builds/tree/main/ray

Looks great! Hopefully others who come across this can use this too.

Good luck getting tensorflow built, I doubt we’ll be much help with that though :stuck_out_tongue:

@Alex Tensorflo build is complete :smiley:
Here is link for my armv7 tensorflow 2 builds:
https://github.com/PeterPirog/Raspberry_armv7_builds/blob/main/tensorflow/Tensorflow_links.md
Its over 100 MB so I use google drive not github.

and armv7 pytorch builds:
https://github.com/PeterPirog/Raspberry_armv7_builds/tree/main/pytorch

Now I Have to solve next problem why the rllib train is abborted with no errors: