Skip to content

CUDA support #8

@kadir014

Description

@kadir014

Thank you for the nice wrapper. I managed to use the CUDA support with these steps if anyone else wants to do it as well:

  1. The latest version on PyPI (0.2) doesn't support the new Pythonic API, clone the repo and install an editable build. (pip install -e .)
  2. Download the latest OIDN binaries from here: https://github.com/RenderKit/oidn/releases
  3. Replace all the dll files and copy OpenImageDenoise_device_cuda.dll as well.
  4. In __init__.py, add CUDA dll as well
    ctypes.CDLL(os.path.join(cur_path, f"lib.win.x64/OpenImageDenoise_device_cuda.dll"))
  5. Disable the GetDeviceError function (it was raising a struct related error on my end.)
  6. In Buffer.create function, change the tensor creation function to the current arguments:
    bf.buffer_delegate = torch.zeros(*storage_shape, dtype=torch.float32)
  7. And done! Thanks to this I'm using denoising close to realtime in my toy pathtracer project.

If I can find time I can just open a PR as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions