I created a Python script that I execute on an Ubuntu server. The script loads a big PLY file (around 100MB), decimates it and smooths it.
Currently, the script is quite slow (around 10 minutes to finish). As my server has 2 great GPUs (Tesla P100), I'm wondering if it's possible to use GPU instead of CPU for this script. If yes, how?
Here is the executed script:
import bpy as bpy
print("Importing PLY")
bpy.ops.import_mesh.ply(filepath="input.ply")
print("PLY imported")
print("Add decimate modifier 0.03")
bpy.ops.object.modifier_add(type='DECIMATE')
bpy.context.object.modifiers[-1].ratio = 0.03
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Decimate")
print("Decimate modifier applied")
print("Add Laplacial smooth modifier 10 1.0 0")
bpy.context.object.modifiers["Laplacian Smooth"].use_y = False
bpy.context.object.modifiers["Laplacian Smooth"].use_x = False
bpy.context.object.modifiers["Laplacian Smooth"].lambda_border = 0
bpy.context.object.modifiers["Laplacian Smooth"].iterations = 10
bpy.context.object.modifiers["Laplacian Smooth"].lambda_factor = 1.0
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Laplacian Smooth")
print("Laplacial modifier applied")
print("Exporting STL")
bpy.ops.export_mesh.stl(filepath="output.stl", use_selection=True)
print("STL exported")