Building darktable with AI

Hi,
For the last two or three months I have been building darktable master myself on Linux Mint using

sudo rm -rf /opt/darktable
cd ~/Dokumenter/GitHub/darktable
rm -rf ./build
./build.sh --prefix /opt/darktable --build-type Release --install --sudo

I also at one point successfully built with AI masking and denoising, using

./build.sh --prefix /opt/darktable --enable-ai --build-type Release --install --sudo

but when I try that now, the build process stops with this:

-- Fetching ONNX Runtime v1.24.4 release metadata from GitHub API...
CMake Warning at cmake/modules/FindONNXRuntime.cmake:240 (message):
  Failed to fetch release metadata from GitHub: "HTTP response code said
  error"
Call Stack (most recent call first):
  src/CMakeLists.txt:3 (find_package)


CMake Warning at cmake/modules/FindONNXRuntime.cmake:266 (message):
  Could not obtain integrity hash for onnxruntime-linux-x64-1.24.4.tgz from
  package repository.  Refusing to download without verification.  Install
  ONNX Runtime manually or set ONNXRUNTIME_OFFLINE=ON.
Call Stack (most recent call first):
  src/CMakeLists.txt:3 (find_package)


CMake Error at src/CMakeLists.txt:5 (message):
  ONNX Runtime not found


-- Configuring incomplete, errors occurred!
hpb@hplaptop-asus:~$ 

Can anyone shed some light on what’s going on, please? Has something changed, so I have to do it differently? I have been away for a couple of weeks, and there is so much new activity in the AI threads that I can’t digest it all. There also seems to be nothing new in the build instructions on GitHub.

Do you empty your build directory?? Try deleting everything and see if your build works…

You need onnxruntime-dev package installed on the system. Otherwise you will be relying on auto-download from GitHub, which may not work just like in you case now. Typically, this caused by reaching GitHub limits.

You can try to download and install ONNX Runtime manually.

Yes, I do:

rm -rf ./build
1 Like

Thank you for the link, but I’m a bit lost. I can’t find any mention of onnxruntime-dev on that page. There is onnxruntime-linux-x64-1.26.0.tgz and one for gpu, but no -dev. And I don’t find anything useful on http://onnxruntime.ai either.

I’m sorry to bother you about this, but it all went very smooth a month or two ago, and I can’t remember everything I did. And the onnxruntime and cuda stuff I had back then has disappeared on the way. Maybe during upgrading Mint from 22.0 to 22.3.

So I tried to build darktable again, with AI enabled. Ant this time the onnxruntime thing apparently worked! But… then the process ended with

-- Could NOT find LibArchive (missing: LibArchive_LIBRARY LibArchive_INCLUDE_DIR) 
CMake Error at src/CMakeLists.txt:510 (message):
  libarchive not found


-- Configuring incomplete, errors occurred!

So, lost again :frowning:

You need to install livarchive packages with your package manager in Mint. On Fedora it is: dnf install libarchive\*

I got some help from Gemini, and darktable is building now. Thanks so far, I got there in the end :slight_smile:

1 Like