Skip to content

oidnNewDevice(OIDN_DEVICE_TYPE_METAL) returns NULL on an iPad #266

Open

Description

@iPerKard

Hi,

I was able to generate oidn dylibs (..., ..._core and ..._device_metal) for the iOS/Metal profile (disabling the iOS/CPU one, as I don't understand how to set dependencies to TBB for iOS).

I then packaged the dylibs into frameworks (after setting their paths with install_name_tool) and included them in my iOS project.

Compilation (Xcode) and execution (on an iPad device) were successful, except that oidnNewDevice returns NULL (both with OIDN_DEVICE_TYPE_DEFAULT and OIDN_DEVICE_TYPE_METAL).

Is this kind of configuration allowed?
Thanks.

Activity

  1. changed the title [-]oidnNewDevice(OIDN_DEVICE_TYPE_METAL) return NULL on an iPad[/-] [+]oidnNewDevice(OIDN_DEVICE_TYPE_METAL) returns NULL on an iPad[/+] on Jun 3, 2025
  2. gracien-app commented on Jun 13, 2025

    @gracien-app

    Considering you have disabled the CPU backend and the only applicable GPU backend is not available as well, the device is null. I think i might have an idea why your Metal backend doesn't work, as I have fixed the issue locally.

    OIDN's CMake doesn't define a dependency of the core library, on the plugins (Metal, CUDA, etc.), so you can probably notice that your framework doesn't have the necessary libOpenImageDenoise_device_metal.dylib.

    You could try copying that manually and see if it works, then make your project account for that during install.

  3. iPerKard commented on Jun 14, 2025

    @iPerKard
    Author

    OIDN's CMake doesn't define a dependency of the core library, on the plugins (Metal, CUDA, etc.), so you can probably notice that your framework doesn't have the necessary libOpenImageDenoise_device_metal.dylib.

    Do you mean inside the main framework ?

    In my specific case, I generated 3 frameworks : one for each dylib (one for libOpenImageDenoise.dylib, one for libOpenImageDenoise_core.dylib and one for libOpenImageDenoise_device_metal.dylib). Indeed, each one only encapsulates its own dylib, without any of the other 2.

    You could try copying that manually and see if it works, then make your project account for that during install.

    Thanks Gracien, I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions