This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sample_pts(x, delta): | |
""" Given points X sample points that are shifted by delta in axis aligned directions """ | |
points = torch.stack( | |
[ | |
x + torch.as_tensor([delta, 0.0, 0.0]).to(x), | |
x + torch.as_tensor([-delta, 0.0, 0.0]).to(x), | |
x + torch.as_tensor([0.0, delta, 0.0]).to(x), | |
x + torch.as_tensor([0.0, -delta, 0.0]).to(x), | |
x + torch.as_tensor([0.0, 0.0, delta]).to(x), | |
x + torch.as_tensor([0.0, 0.0, -delta]).to(x), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## find right version on https://download.blender.org/release/ and copy the link | |
wget https://download.blender.org/release/Blender4.0/blender-4.0.2-linux-x64.tar.xz | |
# unpack | |
tar xf blender-4.0.2-linux-x64.tar.xz | |
# move it and link so can be used via terminal | |
sudo mv blender-4.0.2-linux-x64/ /opt/blender | |
sudo ln -s /opt/blender/blender /usr/bin/blender |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
bpy.data.scenes[0].render.engine = "CYCLES" | |
# Set the device_type | |
bpy.context.preferences.addons[ | |
"cycles" | |
].preferences.compute_device_type = "CUDA" # or "OPENCL" | |
# Set the device and feature set | |
bpy.context.scene.cycles.device = "GPU" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |