Ansel automatycznie wykryje błędy uruchomieniowe OpenCL. Po wykryciu błędu ponownie przetworzy wszystko na procesorze. Chociaż spowolni to przetwarzanie, nie powinno to wpłynąć na wynik końcowy.

Może istnieć wiele przyczyn niepowodzenia OpenCL podczas fazy inicjalizacji. OpenCL zależy od wymagań sprzętowych oraz obecności określonych sterowników i bibliotek. Ponadto wszystkie muszą pasować pod względem producenta, modelu i numeru wersji. Jeśli coś nie pasuje (np. twój sterownik graficzny – załadowany jako moduł jądra – nie pasuje do wersji twojego libOpenCL.so), obsługa OpenCL prawdopodobnie nie będzie dostępna.

W takim przypadku najlepszą rzeczą, jaką można zrobić, jest uruchomienie Ansel z konsoli jako Ansel -d opencl'.

Da to dodatkowe wyniki debugowania, dotyczące inicjowania i używania OpenCL. Po pierwsze, jeśli znajdziesz wiersz zaczynający się od [opencl_init] FINALLY... (ang. wreszcie), który powinien powiedzieć ci, czy obsługa OpenCL jest dostępna, czy nie. Jeśli inicjalizacja nie powiodła się, spójrz na powyższe komunikaty pod kątem treści typu „nie można wykryć” lub „nie można utworzyć”. Sprawdź, czy jest wskazówka, gdzie się nie udało.

Poniżej kilka przypadków, zaobserwowanych w przeszłości:

  • Ansel states that no OpenCL aware graphics card is detected or that the available memory on your GPU is too low and the device is discarded. In that case you might need to buy a new card if you really want OpenCL support.

  • Ansel finds your libOpenCL.so but then tell you that it couldn’t get a platform. NVIDIA drivers will often give error code -1001 in this case. This happens because libOpenCL.so is only a wrapper library. For the real work further vendor-specific libraries need to be loaded. This has failed for some reason. There is a structure of files in /etc/OpenCL on your system that libOpenCL.so consults to find these libraries. See if you can find something fishy in there and try to fix it. Often the required libraries cannot be found by your system’s dynamic loader. Giving full path names might help.

  • Ansel states that a context could not be created. This often indicates a version mismatch between the loaded graphics driver and libOpenCL. Check if you have left-over kernel modules or graphics libraries from an older installation and take appropriate action. When in doubt, perform a clean reinstall of your graphics driver. Sometimes, immediately after a driver update, the loaded kernel driver does not match the newly installed libraries. In this case reboot your system before trying again.

  • Ansel crashes during startup. This can happen if your OpenCL setup is completely broken or if your driver/library contains a severe bug. If you can’t fix it, you can still use Ansel with option --disable-opencl, which will skip the entire OpenCL initialization step.

  • Ansel fails to compile its OpenCL source files at run-time. In this case you will see a number of error messages looking like typical compiler errors. This could indicate an incompatibility between your OpenCL implementation and Ansel’s interpretation of the standard. In that case please raise an issue on github  and we will try to assist. Please also report if you see significant differences between CPU and GPU processing of an image.

Istnieje również kilka implementacji OpenCL na procesor, dostarczanych jako sterowniki dostarczane przez INTEL lub AMD. Zaobserwowaliśmy, że nie zapewniają one żadnego przyrostu prędkości w porównaniu z naszym ręcznie zoptymalizowanym kodem procesora. Dlatego Ansel po prostu domyślnie odrzuca te urządzenia. To zachowanie można zmienić, ustawiając zmienną konfiguracyjną opencl_use_cpu_devices (w $HOME/.config/Anselrc) na TRUE.