Skip to content

Instantly share code, notes, and snippets.

@davidonet
Last active August 7, 2020 16:50
Show Gist options
  • Save davidonet/837c94faa6edf97a9bb800487e13d623 to your computer and use it in GitHub Desktop.
Save davidonet/837c94faa6edf97a9bb800487e13d623 to your computer and use it in GitHub Desktop.
Scaleway archlinux blender 2.82
import bpy
def enable_gpus(device_type, use_cpus=False):
preferences = bpy.context.preferences
cycles_preferences = preferences.addons["cycles"].preferences
cuda_devices, opencl_devices = cycles_preferences.get_devices()
if device_type == "CUDA":
devices = cuda_devices
elif device_type == "OPENCL":
devices = opencl_devices
else:
raise RuntimeError("Unsupported device type")
activated_gpus = []
for device in devices:
if device.type == "CPU":
if use_cpus:
device.use = True
else:
device.use = False
else:
device.use = True
activated_gpus.append(device.name)
cycles_preferences.compute_device_type = device_type
bpy.context.scene.cycles.device = "GPU"
return activated_gpus
enable_gpus("CUDA")
bpy.ops.fluid.bake_all()
import bpy
def enable_gpus(device_type, use_cpus=False):
preferences = bpy.context.preferences
cycles_preferences = preferences.addons["cycles"].preferences
cuda_devices, opencl_devices = cycles_preferences.get_devices()
if device_type == "CUDA":
devices = cuda_devices
elif device_type == "OPENCL":
devices = opencl_devices
else:
raise RuntimeError("Unsupported device type")
activated_gpus = []
for device in devices:
if device.type == "CPU":
if use_cpus:
device.use = True
else:
device.use = False
else:
device.use = True
activated_gpus.append(device.name)
cycles_preferences.compute_device_type = device_type
bpy.context.scene.cycles.device = "GPU"
return activated_gpus
enable_gpus("CUDA")
curl --output ./pacman-static https://pkgbuild.com/~eschwartz/repo/x86_64-extracted/pacman-static
chmod a+x pacman-static
./pacman-static -Suyy
pacman -S haveged
systemctl start haveged
systemctl enable haveged
rm -fr /etc/pacman.d/gnupg
pacman-key --init
pacman-key --populate archlinux
pacman -Syy archlinux-keyring
pacman -S nvidia
pacman -S cuda
pacman -Syu blender
blender -t 0 -P render.py -b test.blend -o ./test.png -F PNG -f 1
ffmpeg -threads 8 -i test%04d.png -movflags +faststart -profile:v high -bf 2 -g 30 -coder 1 -crf 18 -pix_fmt yuv420p test.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment