Skip to content

Instantly share code, notes, and snippets.

@yani-
Created October 9, 2021 03:24
Show Gist options
  • Save yani-/a1bae16f93c8d7b067c93eb5482a7608 to your computer and use it in GitHub Desktop.
Save yani-/a1bae16f93c8d7b067c93eb5482a7608 to your computer and use it in GitHub Desktop.
vast.ai
#!/bin/bash
apt-get install -y vim netcat curl libglu1-mesa-dev libxi6 libxrender1 libfontconfig1 libxxf86vm-dev libxfixes-dev libgl1-mesa-glx
curl -OL https://ftp.halifax.rwth-aachen.de/blender/release/Blender2.93/blender-2.93.4-linux-x64.tar.xz && unxz blender-2.93.4-linux-x64.tar.xz && tar -xvf blender-2.93.4-linux-x64.tar
cd blender-2.93.4-linux-x64 && mkdir media output
cat << EOF > gpu.py
import bpy
scene = bpy.context.scene
scene.cycles.device = 'GPU'
prefs = bpy.context.preferences
prefs.addons['cycles'].preferences.get_devices()
cprefs = prefs.addons['cycles'].preferences
cprefs.compute_device_type = 'CUDA'
for device in cprefs.devices:
if device.type == 'CUDA':
device.use = True
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment