You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently no public way to tell MLX where to find mlx.metallib at runtime. When MLX is embedded inside a plugin bundle (e.g. an Audio Unit or VST3), the host application owns the main bundle, so MLX's default metallib search paths (colocated / SwiftPM resource bundle / main bundle) don't resolve and Metal initialization fails.
Proposal
Add an API to set an explicit mlx.metallib path before the Metal device initializes. If set, it is tried first and falls back to the existing search logic if loading fails — so default behavior is unchanged when unset.
Running MLX-Swift inside AU/VST3 audio plugins, where the standard bundle-relative search paths point at the host app rather than the plugin.
PRs
Implemented as a dependency chain (C++ → C → Swift). The submodule bumps in the mlx-swift PR should be re-pointed to the merged upstream commits once the lower PRs land.
Summary
There is currently no public way to tell MLX where to find
mlx.metallibat runtime. When MLX is embedded inside a plugin bundle (e.g. an Audio Unit or VST3), the host application owns the main bundle, so MLX's default metallib search paths (colocated / SwiftPM resource bundle / main bundle) don't resolve and Metal initialization fails.Proposal
Add an API to set an explicit
mlx.metallibpath before the Metal device initializes. If set, it is tried first and falls back to the existing search logic if loading fails — so default behavior is unchanged when unset.This spans three layers:
mlx::core::metal::set_metallib_path(const std::string&)mlx_metal_set_metallib_path(const char*)GPU.setMetallibPath(_ path: String)Use case
Running MLX-Swift inside AU/VST3 audio plugins, where the standard bundle-relative search paths point at the host app rather than the plugin.
PRs
Implemented as a dependency chain (C++ → C → Swift). The submodule bumps in the mlx-swift PR should be re-pointed to the merged upstream commits once the lower PRs land.
set_metallib_pathGPU.setMetallibPath()