Skip to content

onnx runtime causes mutex lock error on MacOS builds #616

@kallebysantos

Description

@kallebysantos

Note

Priority VERY LOW: Issue report for future documentation, its doesn't affect docker build.

Expected behaviour

Neither run nor build should result in errors.

To Reproduce

ORT_DYLIB_PATH="..." ./scripts/run.sh

Error

libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

Reason

This issue only affects MacOS builds while using ORT_DYLIB_PATH targeting onnx v1.21+

The error occours during onnx runtime ctor and is explained on this thread at this comment.

On most platforms(except the ones that use libc++), std::mutex's default constructor and destructor are no-op. A mutex can be initialized at compile time, and it does not need to be destroyed. However, all Apple systems are not the case. Original comment

Workarround

In order to run onnx on macOS, a possible workarround is to firstcargo build without supply ORT_DYLIB_PATH and thencargo run with the dylib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions