From Gentoo Wiki
Jump to: navigation, search
The information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.

Blender is a professional free and open-source 3D computer graphics software.


Installation of recent releases of Blender on Gentoo is rather complicated.

This page explains how to solve the most common issues for installation of version 2.78. Blender quickly changes, so these steps may soon become obsolete. Wiki editors will attempt to stay current on build instructions.

If something is broken do not hesitate to make changes to the article.

USE flags

USE flags for media-gfx/blender 3D Creation/Animation/Publishing System

bullet Enable Bullet (Physics Engine).
collada Add support for Collada interchange format through media-libs/opencollada.
color-management Enable color management via media-libs/opencolorio.
cuda Build cycles renderer with nVidia CUDA support.
cycles Build cycles renderer (requires media-libs/openimageio and dev-libs/boost).
dds Adds DDS textures support to Blender.
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
doc Build C and Python API documentation directly from the source code.
elbeem Adds surface fluid simulation to Blender using El'Beem library.
ffmpeg Enable ffmpeg/libav-based audio/video codec support
fftw Use FFTW library for computing Fourier transforms
game-engine Adds Game Engine support to Blender.
headless Build without graphical support (renderfarm, server mode only).
jack Add support for the JACK Audio Connection Kit
jemalloc Use dev-libs/jemalloc for memory management
jpeg2k Support for JPEG 2000, a wavelet-based image compression format
llvm Enable features depending on llvm.
man Build and install man pages.
ndof Enable NDOF input devices (SpaceNavigator and friends).
nls Add Native Language Support (using gettextGNU locale utilities)
openal Add support for the Open Audio Library
opencl Allow OpenCL Graphics Acceleration. This may require extra graphics card drivers.
openexr Support for the OpenEXR graphics file format
openimageio Enable OpenImageIO Support
openmp Build support for the OpenMP (support parallel computing), requires >=sys-devel/gcc-4.2 built with USE="openmp"
opensubdiv Add rendering support form OpenSubdiv from Dreamworks Animation through media-libs/opensubdiv.
openvdb Add GPU preview rendering. Only works with nVidia cards.
osl Add support for OpenShadingLanguage scripting.
player Build the Blender Player. THis requires the Game engine.
sdl Add support for Simple Direct Layer (media library)
sndfile Add support for libsndfile
test Build the provided unit tests.
tiff Add support for the TIFF image format
valgrind Add support for memory debugging using dev-util/valgrind

There are many additional features that can be enabled via USE flags. See the list above or the Additional Features section below for further details.

FILE /etc/portage/make.confAppropriate Global USE flags for Blender
# All these global USE flags could be specified locally if desired.
# While both ffmpeg and libav currently work, only ffmpeg is officially recommended.
# Cycles requires tiff. Add any additional formats required eg. jpeg png...
# If audio is required, choose from openal, jack or sdl.
USE="ffmpeg X opengl threads tiff openal jack sdl fftw openexr expat"
FILE /etc/portage/package.useAppropriate Local USE flags for Blender
# blender
media-gfx/blender python_single_target_python3_5 cycles boost openexr tiff openimageio player game-engine bullet fftw openal jemalloc opensubdiv openvdb openvdb-compression
# Enable cuda or opencl if possible
media-libs/opencv cuda opencl
media-libs/openimageio opencv
media-libs/opensubdiv cuda opencl ptex tbb

Unmask related packages by adding to /etc/portage/package.accept_keywords:

FILE /etc/portage/package.accept_keywordsAccept unstable Blender related packages
media-gfx/blender ~amd64
sci-libs/ldl ~amd64
# Blender 2.78 requires python 3.5.2 (2.72b runs on the stable python 3.4)
# For cuda support in 2.78 (See below for 2.72b patch)
dev-util/nvidia-cuda-toolkit ~amd64
# For openvdb and openvdb-compression support
dev-libs/c-blosc ~amd64
# Cycles and Open Shader Language require Boost
dev-libs/boost ~amd64
dev-util/boost-build ~amd64


Currently, Gentoo package tree provides two versions of Blender:

  • Blender 2.72, requiring Python 3.4, which is no longer enabled by default. Please refer to PYTHON_TARGETS and enabled python 3.4 if you want to install Blender 2.72. Then proceed installing blender:
root #emerge --ask media-gfx/blender
  • Blender 2.79+, requiring Python 3.5+, which is enabled by default. However this version of blender is not marked as stable. Easiest way to unmask it and all required dependencies would be using autounmask write:
root #emerge --ask --autounmask-write --ask ~media-gfx/blender-2.79

Additional Features

This section lists many of the optional features available in blender and gives a brief overview of their use for beginning users.

Audio Device Support

Support for Jack, OpenAL or SDL audio can optionally be enabled through USE flags.

Inside blender, go to the File->User Preferences->System tab and set the Audio Dev to the desired setting.

Cuda Support

Cycles renderer can work on GPUs, for example Nvidia GTX 970 is about twice as fast as an i5 4690k on traditional BMW benchmark. Support for AMD GPUs and opencl is improving.

To enable graphics card rendering, install Cuda:

root #emerge --ask --verbose dev-util/nvidia-cuda-toolkit

With gcc 4.9, Cuda may not work, complaining that it does not support gcc-4.9 and higher. However, gcc 4.9 happily works after a simple dirty hack: in a file /opt/cuda/include/host_config.h

#if defined(__GNUC__)

#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)

#error -- unsupported GNU version! gcc 4.9 and up are not supported!

#endif /* __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8) */

replace "8" with "9" twice.

Inside blender, go to the File->User Preferences->System tab and set Compute Device to CUDA and select the graphics card in the box below. If the graphics card is not supported these options will not be visible.

Now set the renderer to Cycles Renderer and in the renderer panel under the Render options set the Device to GPU Compute.

The first time a render is created with a new version of blender, the CUDA kernels will need to be compiled. This may take over 15 minutes.

File Format Support

Support OpenCOLLADA (.dae), jpeg2k, sndfile and tiff image file formats can optionally be enabled through USE flags.

The collada USE flag adds entries to File->Import/Export for Collada (Default) (.dae) files. The others can be used with background images in the properties panel of the 3D View or as output formats in the render panel.

Blender should work with either ffmpeg or libav libraries, although only ffmpeg is officially recommended by the blender developers.

Headless (Server Only)

For render farms it is possible to compile blender with the headless USE flag. This is not recommended for most users.

This feature reduces the blender file size by around 5 MB, but it will not be possible to run blender normally as the GUI is not available.

In headless mode, blender can still be used to run python scripts from the commmand line

user $user $ blender -b -P [-- [--optionsforscript .. ] ]
This functionality is also available with regular versions of blender, it is not necessary to enable the headless use flag to run scripts from the command line.

Memory Allocator

It is recommended to enable jemalloc to use a more efficient memory allocator. This reduces wasted memory during rendering and allows for larger scenes to be rendered.

Memory Profiling

Support for memory profiling can be enabled using the valgrind USE flag. See Debugging for instructions on setting up Valgrind.


Open Colorio provides additional options under the Color Management section of the Scene panel.

Inside blender, select the Render View and Look options, and adjust the exposure, gamma and curves to obtain the desired look.


Opensubdiv is a set of libraries that improve subdivision surface modifier evaluation. This can dramatically improve the frame rate of viewing animations in the viewport when using high levels of subdivision.

Not all cards are suitable. The current code checks for geometry shader, GL_ARB_gpu_shader5, glProgramParameteri, glProgramParameteriEXT and glProgramParameteriARB. These are available as part of OpenGL 3.2, 4.0 and 4.1, or as extensions.

Support is enabled via the opensubdiv USE flag.

Inside blender, go to the File->User Preferences->System tab and set OpenSubdiv compute to the desired option. It may be possible to choose the CPU, but cards which support GLSL Compute will give better performance. This box will not appear if the card does not meet the requirements.

Finally check the Use Opensubdiv box in the subdivision surface modifier


OpenVDB provides a data structure for storing and manipulating volumetric information efficiently. It can be compiled into blender using the openvdb USE flag, and openvdb-compression is also recommended as the data can require upwards of 20MB.

In blender, set the renderer to Cycles Renderer. Go to the physics panel and enable physics for Smoke. In the smoke section select Domain. Save the file to enable editing of the smoke cache. Change File Format to Openvdb and select Blosc compression if desired. Now create and bake the simulation.

Blender 2.72b Specific

Blender 2.72b is quite old and upgrading to 2.78 is strongly recommended.

x86 Intrinsics Compilation

Due to bug #523928 cycles may fail to compile. To work around it, create /etc/portage/patches/media-gfx/blender/blender.redefinition.patch patch file:

diff -Nur old/intern/cycles/util/util_simd.h new/intern/cycles/util/util_simd.h 
--- old/intern/cycles/util/util_simd.h  2014-10-20 03:58:22.000000000 -0400 
+++ new/intern/cycles/util/util_simd.h  2015-02-03 13:29:26.156893414 -0500 
@@ -19,6 +19,7 @@ 
 #define __UTIL_SIMD_TYPES_H__
 #include <limits>
+#include <x86intrin.h> 
 #include "util_debug.h"
 #include "util_types.h"

(This patch can also be obtained from pastebin if copying and pasting from formatting adds extra spaces that break the patch.)

Nvidia GTX 900 series in Blender 2.72b

Newer Nvidia cards are not supported in Blender 2.72 and upgrading to 2.78 is recommended. However it is possible to patch 2.72b:

  • Unmask and emerge dev-util/nvidia-cuda-toolkit of version 6.5.19 or higher
  • Create a file /etc/portage/patches/media-gfx/blender/blender.sm_52.patch with contents
diff --git a/intern/cycles/kernel/ b/intern/cycles/kernel/
index d5b5293..9ed4592 100644
--- a/intern/cycles/kernel/
+++ b/intern/cycles/kernel/
@@ -52,8 +52,8 @@
-/* 5.0 */
-#elif __CUDA_ARCH__ == 500
+/* 5.0 and 5.2 */
+#elif __CUDA_ARCH__ == 500 || __CUDA_ARCH__ == 520

Re-emerge Blender:

root #emerge --ask --one-shot media-gfx/blender

See also

External resources