Analysis of Blender

Blender is a very powerful, open source, 3D animation suite. It allows for modeling, rigging, animating, game development, and many more amazing features. Blender is cross platform, it runs on windows, mac, and linux. This is a attempt to analyze the blender package to see how much work is required to port it to aarch64, arm64bit

Unfortunately a lot of this analysis is somewhat inaccurate. This is due to the amount of SIMD vector programming that is within a lot of these files. Also the search was not tuned to find SSE, NEON, or any vector programming, though it probably should have been considering the program.

Get Package:

fedpkg clone -a blender
cd blender
fedpkg prep
cd blender-version

Create a list of files to search:

find ./ | egrep -i "\.s$|\.asm$|\.c$|\.cpp$|\.h$|\.cc$" >> ~/spo600-package1/files.txt

Search for source assembly:

egrep -i "\.s$|\.asm$" ~/spo600-package1/files.txt
(no source assembly files found)

Search for in-line assembly:

egrep -i "asm\(|__asm" $(cat ~/spo600-package1/files.txt) | awk 'BEGIN{FS=":"}{print $1}' | sort -u

Raw Notes on Files
-Option to use intrinsics instead of assembly

// Use only intrinsics instead of inline asm

-Intrinsics may be “11% slower”
-Intrinsics vs assembly for this file can be found here.
This file has an option to use SSE intrinsics or assembly. However both of these are platform specific to x86_64 architecture.

-Asm is disabled in this file, shown here
-All assembly is within many ifdefs

#ifdef USE_X86_64_ASM

-Because of the commented out line none of these should run
Does not need to be modified, all assembly #ifdef have been disabled due to a bug.

-Assembly was being used for time
-All assembly has been commented out in file
Does not need to be modified, all assembly is commented out.

-File is full of intrinsics
-Lots of vector stuff
-Assembly is used for Apple here
-Assembly used for vector(SIMD) not quite sure what is going on here(closer look shows this is under arm NEON intrinsics)
-Some conditional use of SSE(Streaming SIMD Extensions)
Some conditional use of arm specific intrinsics
Some optional assembly inside. There is a lot of platform specific intrinsics in this file. The fact that Arm NEON intrinsics are in there though, is good, since it may help in the porting to aarch64, since they may use something similar to NEON.

-All assembly is commented out
-“_mm” intrinsics are used everywhere, intel intrinsics?
More platform specific intrinsics for the intel platform.

-EIGEN libraries for C/C++
-Linear algebra, matrix, and vector operations
-I think this is portable
More intrinsics. Might be an issue.



New Issue: Arch Specific Intrinsics
After finding so many file containing intrinsics that are platform specific I decided to stop and do another search. There are a lot of files found that may contain x86 intrinsics. I have not yet found out if all of these files are required, or if they are optionally called. However, considering that some package dependencies try to install only if the platform is x86, I am thinking that this program was made only for x86, however the fact that arm NEON intrinsics are found, make it that much more confusing.

Search for some intrinsics:

grep "_mm" $(cat ~/spo600-package1/files.txt ) | awk 'BEGIN{FS=":"}{print $1}' | sort -u

Installing Blender on aarch64 Failed
So I decided to try installing Blender on aarch64 to see what happens, however the first thing I notice is some of it’s build dependencies have not been built for aarch64. I looked on arm koji and could not find a built package.

yum-builddep blender.spec
Error: No Package found for OpenImageIO-devel

I decided I would try and build it(if it was easy), but it failed and seems to have a script inside it that tries to find out the architecture and fails with an error when it decides it is not x86.

# Start with unknown platform
     18 platform ?= unknown
     20 # Use 'uname -m' to determine the hardware architecture.  This should
     21 # return "x86" or "x86_64"
     22 hw := ${shell uname -m}
     23 #$(info hardware = ${hw})
     24 ifneq (${hw},x86)
     25   ifneq (${hw},x86_64)
     26     ifneq (${hw},i386)
     27       ifneq (${hw},i686)
     28         $(error "ERROR: Unknown hardware architecture")
     29       endif
     30     endif
     31   endif
     32 endif

Added a couple lines to skip this platform check:

ifneq (${hw},aarch64)

This allowed the package to start building, however it needed many build deps. Further investigation into this package shows that it has multiple build dependencies that are have also not been built for aarch64.

I will stop here with trying to get Blender installed on aarch64 as I am getting sidetracked and will move back to analyzing the actual assembly code in Blender.

yum-builddep OpenImageIO.spec
Error: No Package found for Field3D-devel
Error: No Package found for hdf5-devel

For now I have stopped working on blender, it may be too early in the development of aarch64 to port it. However if I were to continue I would look through options for compiling blender with many platform specific features turned off. This would be useful in determining which files must be ported to aarch64, and which are optional.


About oatleywillisa

Computer Networking Student
This entry was posted in SBR600 and tagged , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s