Ubuntu 安装 blender
1 - 用 snap 安装
sudo snap install blender --channel=2.83lts/stable --classic
2 - 添加 apt 源安装
# 添加源
sudo add-apt-repository ppa:thomas-schiex/blender
# 安装
sudo apt-get update
sudo apt-get install blender
# 卸载
sudo apt install ppa-purge
sudo ppa-purge ppa:thomas-schiex/blender
3 - 编译安装
3.1 Install Packages
sudo apt-get update
sudo apt-get install build-essential git subversion cmake libx11-dev libxxf86vm-dev libxcursor-dev libxi-dev libxrandr-dev libxinerama-dev libglew-dev
3.2 Download Sources
mkdir ~/blender-git
cd ~/blender-git
git clone https://git.blender.org/blender.git
# 选择一个版本
# cd blender
# git checkout blender-v2.83-release
3.3 Download Libraries
下载预编译的依赖库:
These libraries are built on CentOS 7 for VFX reference platform compatibility, but they work fine on other Linux distributions.
mkdir ~/blender-git/lib
cd ~/blender-git/lib
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64
(Advanced Setup)自行编译依赖:
适用于 Debian (and derivatives), Ubuntu, Fedora, Suse and Arch distributions:
cd ~/blender-git
./blender/build_files/build_environment/install_deps.sh
Important It might be required to re-run install-depsh.sh once in a while, as Blender updates its dependencies.
3.4 Update and Build
Get latest source code and add-ons, and build. These commands can be used for the first build, and repeated whenever you want to update to the latest version.
cd ~/blender-git/blender
make update
make
After the build finished, you will find blender ready to run in ~/blender-git/build_linux/bin
.
If building fails after an update, it sometimes helps to remove the ~/blender-git/build_linux
folder to get a completely clean build.
启用 CUDA
需要安装 nvidia-cuda-dev
sudo apt install nvidia-cuda-dev
修改 CMakeLists.txt
,设置 WITH_CYCLES_CUDA_BINARIES=ON
指定编译过程中的 gcc
CC=gcc-9 CPP=g++-9 CXX=g++-9 LD=g++-9