Skip to content

Instantly share code, notes, and snippets.

# Mark all scene devices as GPU for cycles
bpy.context.scene.cycles.device = 'GPU'
for scene in bpy.data.scenes:
scene.cycles.device = 'GPU'
# Enable CUDA
bpy.context.user_preferences.addons['cycles'].preferences.compute_device_type = 'CUDA'
import bpy
# Mark Active Layers
actives = ["buildings", "floor"]
for l in bpy.data.scenes["Scene"].render.layers:
# Disable all Layers
l.use = False
# Denoising Options
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA and try to install.
if ! dpkg-query -W cuda-9-0; then
# The 16.04 installer works with 16.10.
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
apt-get update
apt-get install cuda-9-0 -y