cube2sphere icon indicating copy to clipboard operation
cube2sphere copied to clipboard

It doesnt utilize my GPU

Open YuenSzeHong opened this issue 10 months ago • 1 comments

add this code to blender_init.py seem to solve the issue

def enable_gpus(device_type, use_cpus=False):
    preferences = bpy.context.preferences
    cycles_preferences = preferences.addons["cycles"].preferences
    cycles_preferences.refresh_devices()
    devices = cycles_preferences.devices

    if not devices:
        raise RuntimeError("Unsupported device type")

    activated_gpus = []
    for device in devices:
        if device.type == "CPU":
            device.use = use_cpus
        else:
            device.use = True
            activated_gpus.append(device.name)
            print('activated gpu', device.name)

    cycles_preferences.compute_device_type = device_type
    bpy.context.scene.cycles.device = "GPU"

    return activated_gpus


enable_gpus("CUDA")

YuenSzeHong avatar Apr 11 '24 02:04 YuenSzeHong

it definitely make it utilise the gpu, but it only make a difference on batch processes, which i am also looking for as a feature

Umar Khalid @.***> 于 2024年4月13日周六 00:08写道:

It doesn't work.

— Reply to this email directly, view it on GitHub https://github.com/Xyene/cube2sphere/issues/11#issuecomment-2052053625, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJU2HQRW7XTED53FKQABCDTY5ABI7AVCNFSM6AAAAABGBPYCRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJSGA2TGNRSGU . You are receiving this because you authored the thread.Message ID: @.***>

YuenSzeHong avatar Apr 12 '24 17:04 YuenSzeHong