Page MenuHome

Add support for building on Linux aarch64
ClosedPublic

Authored by Patrick Mours (pmoursnv) on Apr 12 2021, 5:00 PM.

Details

Summary

This adds support for building both dependencies and Blender on Linux with an ARM CPU (aarch64). With the exception of OIDN, everything builds. So apart from CPU denoising, the resulting Blender build is feature complete (including Cycles rendering on both CPU and GPU).
I focused on the "make deps" workflow, since with the resulting precompiled libraries one can build Blender on Linux systems that have older packages than the ones Blender requires (e.g. Ubuntu 18.04). So the "install_deps.sh" workflow may not fully work on aarch64 still.

Prominent changes:

  • Updated OpenSSL version to 1.1.1i, since that is the first one to include aarch64 support from https://github.com/openssl/openssl/pull/13218
  • Updated the TBB CMake script from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt, since the previous one always set the "-mrtm" compiler flag, which does not exist on aarch64
  • Updated TBB patch to fix building on aarch64
  • Added USD patch for aarch64 support from https://github.com/PixarAnimationStudios/USD/pull/1453
  • Enabled SSE2Neon and ARM Embree on non-Apple platforms when building for aarch64
  • Fixed several build errors in Cycles when building with Neon instructions enabled
  • Fixed a "-Werror=sign-conversion" error that occured in blenkernel/intern/object_dupli.cc due to casting from int->unsigned long long (size_t)
  • Fixed empty CPU name displayed in the Cycles render device option (there is no CPUID on ARM, so have resolved to using "/proc/cpuinfo" on Linux, which is not a perfect solution, but simple)

All except for the following tests complete successfully (and these are already covered in https://developer.blender.org/T78710, the node_denoise one I assume is related to missing OIDN):

  • ffmpeg
  • compositor_matte_test (node_cryptomatte)
  • compositor_filter_test (node_denoise)
  • physics_ocean

Diff Detail

Repository
rB Blender
Branch
linux_aarch64_build (branched from master)
Build Status
Buildable 14033
Build 14033: arc lint + arc unit

Event Timeline

Patrick Mours (pmoursnv) requested review of this revision.Apr 12 2021, 5:00 PM
Patrick Mours (pmoursnv) created this revision.

I just committed a cleanup that will make the changes in object_dupli.cc unecessary. Those were probably my fault as I moved the file to C++ recently.

Brecht Van Lommel (brecht) requested changes to this revision.Apr 19 2021, 9:17 PM

This seems generally fine and not very invasive, just minor comments about simplifying the checks.

build_files/build_environment/CMakeLists.txt
116

I'd prefer a variable options.cmake rather than repeating this kind of regular expressions in various places.

build_files/build_environment/cmake/boost.cmake
46

I guess this should match the if(${BLENDER_CMAKE_SYSTEM_PROCESSOR} MATCHES "^(aarch64|arm64)$") test?

Not sure why you'd use both CMAKE_SYSTEM_PROCESSOR and BLENDER_CMAKE_SYSTEM_PROCESSOR, or what that means exactly.

build_files/build_environment/cmake/gmp.cmake
41

In this case I'd prefer to see an explicit APPLE check rather than going by the arm64 / aarch64 distinction.

This revision now requires changes to proceed.Apr 19 2021, 9:17 PM

Replaced "BLENDER_CMAKE_SYSTEM_PROCESSOR" with a "BLENDER_PLATFORM_ARM" CMake variable and simplified some checks

Patrick Mours (pmoursnv) marked 3 inline comments as done.Apr 20 2021, 3:05 PM
This revision is now accepted and ready to land.Apr 20 2021, 6:13 PM