vkdt guide on apple silicon/intel

Would anyone be kind enough to share a walkthrough on setting up vkdt on a mac system, if at all possible? I understand that there is a hiccup in regards to Vulkan and Metal API and the programing-esque nature of all this is, as I’m finding out through research and failures, not my strong suit.

I’m running M1 or Intel, if either makes the approach more feasible.

My use case is to run Agx-Emulsion inside. I currently have Agx setup as the python launched Napari as well as in ART but I’m trying to figure out a system that nails best practices/best quality. The Darktable-Napari route certainly chews up a lot of disk space as well as time. ART is easier to manage file wise but the quality doesn’t quite land in the same place.

Any help is appreciated!

oh, somehow i missed this post completely. must have been a busy week or something.

anyways, the best guide i have is the nightly build instructions for the ci on github. it boils down to:

brew install make glfw3 vulkan-validationlayers vulkan-headers rust

clone the vkdt repository (no --recursive or anything required, just clone)

make sure gnu make is used during the build:

export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"

then build:

make

to run, you need to install the official vulkan sdk from the lunarg website, maybe like so: LunarXchange

i didn’t understand their install python thing so i had to set all the paths manually, like in the 90s for java :slight_smile:

then it worked without any obvious issues on an M1 (no moltenvk manual install or additional env var setting required).

2 Likes

Hi @hanatos,

macOS Tahoe, M4 Pro.

I followed the above instructions, make succeeds but then when I run vkdt I get:

[gui] vkdt 0.9.99-958-ge3be83ad (c) 2020--2025 johannes hanika
[gui] glfwGetVersionString() : 3.4.0 Cocoa NSGL Null EGL OSMesa monotonic dynamic
[ERR] glfwVulkanSupported(): no vulkan support found: (null)
[ERR] failed to init gui/swapchain

Do I need to set some environment variable to point VKDT to the installation path of the Vulkan sdk?

Thanks for your help!

iirc, that’s what i did (don’t have access to macintosh computers right now):

export VULKAN_SDK=/wherever/i/installed/it/i/forgot
export PATH=$VULKAN_SDK/bin:$PATH
export DYLD_LIBRARY_PATH=$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH
export VK_ICD_FILENAMES=$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json
export VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d
1 Like

Thanks a lot, that did it! :slight_smile:

1 Like

I’ve tried installing VKDT, but I’m not tech-savvy at all, especially not in macos environment. Can anyone give me a sort of explain-it-like-I’m-5 here?

Nevermind, got it working through a long conversation with chatgpt!

I’ve noticed there’s a MAC OS dmg in the nightly builds. Are there future plans for this to work out of the box? :slight_smile:

yes. but the dmg still has some dso dependency problems. and setting this up requires some time investment ideally by someone who knows macintosh computers or at least has access to one.

i think that intel and arm macintoshs require different treatment too.

1 Like

Unsure if this is helpful, but I was able to get the macOS nightly DMG launching on Apple Silicon after fixing dylib aliases (libvulkan.1.dylib and libglfw.3.dylib). But the GUI shows no thumbnails for any photos.

Terminal is saying:

[ERR] module thumb main connector input has uninited size!
[ERR] [thm] failed to run first half of graph!
[ERR] could not load required thumbnail symbols!

do you have rustc/cargo installed?

Hey Hanatos, I do not! I assumed I would only need those if I was building from source?

I’d love to help get this working on Mac OS as a self contained .APP :smiling_face:

1 Like

that would be really very cool. i don’t own a macintosh and only sporadically have access to an old intel-based one.

here is the loooong github pr discussion (scroll all the way down for latest issues)

and this is where the the CI recipe for the dmg package can be found.

the nightly builds include the dmg, but there’s something incomplete about tracing recursive dependencies (see pr discussion). i suppose i can bash together the recursive loop as discussed, but i will likely not be able to test/iterate on it.

I managed to put together a script these days, that creates an app bundle for my Intel-based iMac 2020 from my local build of vkdt. The script essentially replicates the app layout that nightly.yml creates, and I also took some support from ChatGPT I must admit :wink:

However, I think it is not fully self-contained but still relies on homebrew libraries outside the bundle, as I just copied the first level dependencies like libjpeg and libavformat, but did not bother to recursively search through the dependency tree. So it is probably just for my local use - anyway, for me it works.

I would be glad to support if it is of any help.

Alright I think I’ve fixed the issue on my end!

Step 1:

vkdt failed to launch due to missing dylib filenames. Fixed by adding aliases/duplicates with the right file names.

“libvulkan.1.dylib” alias for the bundled version “libvulkan.1.4.y341.dylib”
“libglfw.3.dylib” alias for “libglfw.3.4.dylib”

Step 2

The APP had module folders like “…/modules/i-raw/” containing connectors, but the matching “libi-raw.so” had been moved into Contents/Frameworks. Putting each “lib.so” back into /modules// fixed module loading and brought thumbnails back but they were empty.

Step 3
Missing dylib: “libjpeg.8.dylib” from /Frameworks
Source/library: JPEG (jpeg-turbo / libjpeg)

Step 4
Missing dylib: “libavformat.62.dylib” from /Frameworks
Source/library: FFmpeg (libavformat, plus its usual FFmpeg deps like libavcodec/libavutil/etc.)

I then re-signed the app and am getting no errors/everything appears to be working!

yay nice glad to hear. some of that might be fixed by the recursive dylib search. i’ll push that to the CI when i get a minute.

1 Like

i pushed some new recursive dylib detection shell script from the pr on github into the .github/workflows/nightly.yml. unfortunately it doesn’t work and pushing until failure takes 10min turnaround. then the error message is “1” :smiley:

this is one of the more informative runs:

so if anyone with access to a macintosh shell had the time and skills to fix this particular loop that would be a good step towards a nightly mac dmg.

the dylib copy loop breaks because ditto resolves symlinks, renaming e.g.
libglfw.3.dylib to libglfw.3.4.dylib. the binary still expects libglfw.3.dylib
so it fails to load. cut -w can also be flaky depending on the runner.

fix: use cp -L (dereference but keep the filename) with basename, and awk
instead of cut -w. this also makes the “something more on libs” symlink step
unnecessary.

      - name: copy library dependencies
        run: |
          BREW_PREFIX=$(brew --prefix)
          for i in $(seq 1 20); do
            found=0
            for lib in $(find ${APPDIR} -type f \( -name "*.dylib" -o -name "*.so" -o -perm +111 \) -print0 \
              | xargs -0 otool -L 2>/dev/null \
              | awk "/${BREW_PREFIX//\//\\/}/{ gsub(/[[:space:]].*/, \"\", \$1); print \$1 }" \
              | sort -u); do
              name=$(basename "$lib")
              if [ ! -f "${APPDIR}/Contents/Frameworks/${name}" ]; then
                cp -L "$lib" "${APPDIR}/Contents/Frameworks/${name}"
                found=1
              fi
            done
            [ "$found" = "0" ] && break
          done

tested locally on m1 arm64, picks up transitive deps (e.g. ffmpeg pulling in
dav1d, x264, x265, openssl) and stabilises after 2-3 iterations.

1 Like

thanks much! and it works… the nightly dmg is built. we will see if it works :slight_smile:

1 Like

That new macOS build does load on my computer! Though not on a fresh VM, crashing saying it failed to load libvulkan.1.dylib from /opt/homebrew (which is not installed on this fresh VM). I’ll try to look into it tomorrow.

1 Like