O Ansel detectará erros de tempo de execução OpenCL automaticamente. Ao detectar um erro, ele irá reprocessar tudo na CPU. Embora isso retarde o processamento, não deve afetar o resultado final.
Podem haver vários motivos para o OpenCL falhar durante a fase de inicialização. O OpenCL depende dos requisitos de hardware e da presença de certos controladores e bibliotecas. Além disso, todos eles devem se ajustar em termos de fabricante, modelo e número de revisão. Se algo não estiver correto (por exemplo, seu controlador gráfico – carregado como um módulo do kernel – não corresponde à versão de seu libOpenCL.so
), o suporte a OpenCL provavelmente não estará disponível.
Neste caso, a melhor coisa a fazer é iniciar o Ansel de um console com Ansel -d opencl
.
Isso fornecerá saída de depuração adicional sobre a inicialização e o uso do OpenCL. Inicialmente, se você encontrar uma linha que começa com [opencl_init] FINALLY ...
, esta linha deve dizer se o suporte OpenCL está disponível para você ou não. Se a inicialização falhou, procure nas mensagens acima algo como could not be detected
ou could not be created
. Verifique se há uma dica sobre onde ele falhou.
Aqui estão alguns casos que foram observados no passado:
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.
Algumas implementações do OpenCL na CPU também existem, vindo como controladores fornecidos pela INTEL ou AMD. Observamos que eles não fornecem nenhum ganho de velocidade em comparação com nosso código de CPU otimizado manualmente. Portanto, o Ansel simplesmente descarta esses dispositivos por padrão. Este comportamento pode ser alterado definindo a variável de configuração opencl_use_cpu_devices
(em $HOME/.config/Anselrc
) para TRUE
.