-
Notifications
You must be signed in to change notification settings - Fork 246
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
Building on ARM64 #37
Comments
You can build without GPU/CUDA support. We have not attempted to compile on Mac OS, regardless of hardware. I imagine, being Unix-based, it may be easier to get it to work than under Windows. I have not looked into the M1 specifications and worry about the memory model. We run on x86-64, which has a strong memory model; there may be cases in our code where we use the wrong memory fence, but it has never been caught. That said, that will be a runtime bug and should not be a barrier (Ha! Thread barrier. Get it?) to the first step of compilation. Compiling on Mac OS will simply be a matter of someone attempting it and working through the issues. I imagine that a Raspberry Pi is more difficult. |
So, I gave this a try. because I'm both a macOS and Raspberry Pi user. I wanted to first compile it on docker on my M1 machine, since that felt like the the safest/easiest route before embarking in a architecture change challenge. My current diff is pretty small, basically: -FROM nvidia/cuda:11.4.0-base-centos7
+FROM centos:7 and
I can export a git patch but there's nothing fancy going on. From there, I basically followed what the docs suggest, with the other relevant contribution being the These were my steps: $ cd ./building
$ docker build --platform linux/amd64 -t openmoonray_base . --file Dockerfile
$ docker run --platform linux/amd64 -v ~/dev/personal/moonray/openmoonray/building:/building --network=host --rm -it openmoonray_base
$ cd /build
$ cmake ../building
$ cmake --build . -- -j $(nproc) These^ steps went all fine, and the 3rd party dependencies were built correctly. NOTE: I removed the Error: is mounted on /host_mnt but it is not a shared mount macOS Some relevant posts:
I made sure that the path where I had moonray was added in the Resources / File sharing preferences of the Docker Desktop App so that it could be bind mounted into docker containers. After that, I saved the new image as specified in the docs: $ docker commit 77791acddb26 openmoonray_build Finally, I tried to compile the actual moonray binaries: $ docker run --platform linux/amd64 -v ~/dev/personal/moonray/openmoonray:/openmoonray -v /tmp:/tmp --network=host --rm -it openmoonray_build
$ cd /openmoonray
$ cmake --preset container-release -DMOONRAY_USE_CUDA=NO
$ cmake --build --preset container-release -- -j $(nproc) But sadly, this last step keeps failing with this funny qemu memory crash: [ 90%] Generating GeometrySet.json, Joint.json, TraceSet.json, Layer.json, LightFilterSet.json, LightSet.json, RenderOutput.json, SceneVariables.json, ShadowSet.json, ShadowReceiverSet.json, UserData.json, Metadata.json
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
qemu: uncaught target signal 6 (Aborted) - core dumped
/bin/sh: line 1: 58827 Aborted ../../../cmd/rdl2_cmd/rdl2_json_exporter/rdl2_json_exporter --dso_path /openmoonray/moonray/scene_rdl2/lib/scene/rdl2 --builtin --in GeometrySet --out /build/moonray/scene_rdl2/lib/scene/rdl2/GeometrySet.json --in Joint --out /build/moonray/scene_rdl2/lib/scene/rdl2/Joint.json --in TraceSet --out /build/moonray/scene_rdl2/lib/scene/rdl2/TraceSet.json --in Layer --out /build/moonray/scene_rdl2/lib/scene/rdl2/Layer.json --in LightFilterSet --out /build/moonray/scene_rdl2/lib/scene/rdl2/LightFilterSet.json --in LightSet --out /build/moonray/scene_rdl2/lib/scene/rdl2/LightSet.json --in RenderOutput --out /build/moonray/scene_rdl2/lib/scene/rdl2/RenderOutput.json --in SceneVariables --out /build/moonray/scene_rdl2/lib/scene/rdl2/SceneVariables.json --in ShadowSet --out /build/moonray/scene_rdl2/lib/scene/rdl2/ShadowSet.json --in ShadowReceiverSet --out /build/moonray/scene_rdl2/lib/scene/rdl2/ShadowReceiverSet.json --in UserData --out /build/moonray/scene_rdl2/lib/scene/rdl2/UserData.json --in Metadata --out /build/moonray/scene_rdl2/lib/scene/rdl2/Metadata.json
gmake[2]: *** [moonray/scene_rdl2/lib/scene/rdl2/CMakeFiles/coredata_files.dir/build.make:84: moonray/scene_rdl2/lib/scene/rdl2/GeometrySet.json] Error 134
gmake[1]: *** [CMakeFiles/Makefile2:38668: moonray/scene_rdl2/lib/scene/rdl2/CMakeFiles/coredata_files.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2 Some related issues:
I'll have another look at this and see if compiling Moonray natively on Arm leads to better results. |
Upon running "cmake --preset" I get the following: CMake Error at arras/arras4_core/CMakeLists.txt:6 (include):
CMake Warning at arras/arras4_core/CMakeLists.txt:8 (project): CMake Error at arras/arras4_core/CMakeLists.txt:34 (find_package): Could not find a package configuration file provided by "Libuuid" with any
Add the installation prefix of "Libuuid" to CMAKE_PREFIX_PATH or set How should I go about fixing this? |
The packageVersion.cmake module is found in the cmake_modules repository. Is it possible you didn't include --recurse-submodules when you did your clone? Also, which build instructions are you following ? https://docs.openmoonray.org/getting-started/installation/building-moonray/ |
I'm following the instructions posted on this thread. |
I solved the other issues by recloning the repo, but now have a new error: ld: unknown option: --enable-new-dtags |
How could I build this on Mac M1 or Raspberry Pi 4? AFAIK it relies on CUDA and x86.
The text was updated successfully, but these errors were encountered: