Ansel detecteert automatisch OpenCL-runtime-fouten. Bij het detecteren van een fout, zal het vervolgens alles op de CPU opnieuw verwerken. Hoewel dit de verwerking vertraagt, mag dit het eindresultaat niet beïnvloeden.
Er kunnen verschillende redenen zijn waarom OpenCL tijdens de initialisatiefase zou kunnen mislukken. OpenCL is afhankelijk van hardwarevereisten en van de aanwezigheid van bepaalde stuurprogramma’s en bibliotheken. Bovendien moeten deze allemaal passen qua maker, model en revisienummer. Als iets niet past (bijv. jouw grafisch stuurprogramma (driver) – geladen als een kernelmodule – komt niet overeen met de versie van jouw libOpenCL.so
), is OpenCL-ondersteuning waarschijnlijk niet beschikbaar.
In dit geval kan je Ansel het beste starten vanaf een console met Ansel -d opencl
.
Dit geeft extra foutopsporingsoutput over de initialisatie en het gebruik van OpenCL. Ten eerste, als je een regel vindt die begint met [opencl_init] FINALLY ...
, zou dat je moeten vertellen of OpenCL-ondersteuning voor jou beschikbaar is of niet. Als de initialisatie is mislukt, kijk dan in de bovenstaande berichten voor iets dat leest als ‘kon niet worden gedetecteerd’ of ‘kon niet worden gemaakt’. Controleer of er een hint is over waar het is mislukt.
Hier zijn een paar gevallen die in het verleden zijn waargenomen:
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 becauselibOpenCL.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 thatlibOpenCL.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.
Er bestaan ook enkele on-CPU-implementaties van OpenCL, die worden geleverd als stuurprogramma’s die worden geleverd door INTEL of AMD. We hebben vastgesteld dat ze geen snelheidswinst opleveren in vergelijking met onze met de hand geoptimaliseerde CPU-code. Daarom negeert Ansel deze apparaten gewoon standaard. Dit gedrag kan worden gewijzigd door de configuratievariabele opencl_use_cpu_devices
(in $HOME/.config/Anselrc
) in te stellen op TRUE
.