Install your OpenCL GPU drivers if you have a GPU.
On Windows 11, it seems that the system OpenCL drivers for Intel embedded GPU cause issues (black images), especially with newer generation CPU. You may want to remove Windows drivers and install Intel ones .
The Ansel project provides an official .exe package, built for the stable, pre-release and experimental channels. This is the recommended way of installing Ansel, since it is fresh from the repository, always up-to-date and ships updated lens databases for Lensfun.
MSYS will initialize a personal Unix-like /home folder, by default located in C:\\msys64\home\USERNAME where USERNAME is your current Windows username. If your username contains non-latin characters, like accentuated letters, the clashes between Windows encoding and Linux encoding will make the compilation fail on directory pathes issues. In that case, create a new directory in C:\\msys64\home\USERNAME_WITHOUT_ACCENTS, and in the MSYS terminal, do cd /home/USERNAME_WITHOUT_ACCENT.
Step 6: Using a text editor, eg. MS Notepad - Modify the .bash_profile file in your $HOME directory and add the following lines:
1# Added as per http://wiki.gimp.org/wiki/Hacking:Building/Windows2export PREFIX="/ucrt64"3export LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"4export PATH="$PREFIX/bin:$PATH"
Step 7: By default CMake will only use one core during the build process. To speed things up, using a text editor, eg. MS Notepad, you might wish to add a line like:
After this, you will need to double-click and install the ansel.exe found in the build/bin folder. This package will be portable and be installable on other platforms.
VS Code setup
To make debugging easier with VS Code, you can use the UCRT64 terminal within the program, which is better suited than the standard Windows terminal. For example, you can use GDB and simply Ctrl + click on relevant lines in the debugger output to jump directly to the corresponding line in the code editor.
In some situations, you will need to start Ansel in command line, with arguments modifying its default behaviour, to test or debug issues:
If you built yourself, start the MSYS2 MINGW64 terminal (from the applications menu), and execute /opt/ansel/bin/ansel.exe,
If you installed from the EXE package, open the Windows terminal (cmd.exe) and execute "C:\Programs Files\ansel\bin\ansel" (assuming you installed Ansel in the default directory, suggested by the installer).
For example, if you note issues with OpenCL, you could start Ansel with OpenCL entirely disabled using "C:\Programs Files\ansel\bin\ansel" --disable-opencl.
The caveat though is the debugging commands (-d OPTION) don’t output messages to the terminal, as they do on Unix, because of issues with Windows. Instead, the output will be written in an ansel-log.txt text file, in your cache directory. Start the help of the software ( runing "C:\Programs Files\ansel\bin\ansel" -h), and the last line should tell you where the file will be located after the line note: debug log and output will be written to this file: PATH. Typically, it should be C:\Users\USERNAME\AppData\Local\Microsoft\Windows\INetCache\ansel on Windows 10.
OpenCL
Darktable blacklists all Intel OpenCL drivers to prevent issues, because of an history of bad drivers. In practice, since Intel Neo, things are better and reasonably-old Intel platforms are well supported, so the blacklist is removed on Ansel. OpenCL issues (typically: black images) are still regularly reported with brand-new hardware.
If you find yourself in this situation, you have several mitigation options:
Try to install a newer or an older version of your GPU driver.
If you have a discrete GPU (Nvidia or AMD), you can disable the Intel embedded GPU:
By entirely removing the Intel OpenCL driver (use your software manager to locate it), so Ansel uses only your discrete driver,
By entirely disabling the Intel GPU in Ansel config:
Locate the anselrc text file on your system (typically in C:\Users\USERNAME\AppData\Local\ansel),
Open it and locate the line cldevice_v4_YOUR_DEVICE=0 250 0 16 16 128 0 0 0.053989 where YOUR_DEVICE is the name of your GPU (possibly associated with a driver version),
On that line, change the 8th (penultimate) digit from 0 to 1, so you get cldevice_v4_YOUR_DEVICE=0 250 0 16 16 128 0 1 0.053989,
Try to change the build options for OpenCL kernels:
Locate the anselrc text file on your system (typically in C:\Users\USERNAME\AppData\Local\ansel),
Open it and locate the line cldevice_v4_YOUR_DEVICE_building=-cl-fast-relaxed-math where YOUR_DEVICE is the name of your GPU (possibly associated with a driver version), and the options after = may be different from this example,
Clear the building options, so you get cldevice_v4_YOUR_DEVICE_building= (nothing after =)
If you don’t have a discrete GPU and the Intel one is your only one:
Start the application with OpenCL disabled at all with COMMAND --disable-opencl (see the previous section for the actual system command to run, depending on your installation)
Disable the Intel GPU in Ansel config (see point 1.2. above)
Memory allocation
Ansel uses virtual memory pre-allocation for fast memory access. Virtual memory needs to be enabled on your system and the pagefile size required by Ansel should be available on your system. If, at startup, you see errors like :
it means the system refused to allocate the requested memory. This can happen on gamers PC where performance optimizations have been made.
Diagnose
Open Task Manager → Performance → Memory and check Committed: X / Limit. X is the currently-used virtual memory. If it is close to Limit you will have to close applications using it.
Fix
The first approach is to enable or increase the virtual memory on your system. Go to System Properties → Advanced → Performance → Virtual Memory and set pagefile to system managed or several GB.
If this is not enough, the second approach is to reduce Ansel memory consumption. Open C:\%LOCALAPPDATA%\ansel\anselrc with a text editor and locate the lines :
When set to -1, host_memory_limit detects all the RAM available on your system and will allocate to Ansel host_memory_limit - memory_os_headroom. Values are in MiB. To manually control this, you can set host_memory_limit=4000 (4 GiB) and memory_os_headroom=0 as a starting point. If that works, you can try allocating more.