opencl

загальна інформація

Обробка зображень із високою роздільною здатністю – це складне завдання, яке вимагає сучасного комп’ютера. Що стосується як пам’яті, так і потужності центрального процесора, отримання найкращих результатів із типового 15, 20 або 25-мегапіксельного зображення може швидко довести ваш комп’ютер до межі можливостей.

Ansel’s requirements are no exception. All calculations are performed on 4 x 32bit floating point numbers. This is slower than “ordinary” 8 or 16 bit integer algebra, but eliminates all problems of tonal breaks or loss of information.

як працює opencl

Як ви можете собі уявити, апаратна архітектура графічних процесорів може суттєво відрізнятися. Існують різні виробники, і навіть різні покоління графічних процесорів від одного виробника можуть бути не порівнянними. У той же час виробники графічних процесорів зазвичай не розголошують всіх подробиць про апаратну частину своєї продукції для громадськості. Одним із наслідків цього є необхідність використовувати пропрієтарні драйвери під Linux, якщо ви хочете повною мірою скористатися своєю графічною картою.

Fortunately an industry consortium lead by The Khronos Group has developed an open, standardized interface called OpenCL, which allows your GPU to be used as a numerical processing device. OpenCL offers a C99-like programming language with a strong focus on parallel computing. An application that wants to use OpenCL will need OpenCL source code that it hands over to a hardware-specific compiler at run-time. This way applications can use OpenCL on different GPU architectures (even at the same time). All of the hardware “secrets” are hidden in this compiler and are normally not visible to the user (or the application). The compiled OpenCL code is loaded onto your GPU and – with certain API calls – it is ready to perform calculations for you.

activating opencl in Ansel

Using OpenCL in Ansel requires that your PC is equipped with a suitable graphics card and that it has the required libraries in place. Most modern graphics cards from NVIDIA and AMD come with full OpenCL support. The OpenCL compiler is normally shipped as part of the proprietary graphics driver and is used as a dynamic library called libOpenCL.so. This library must be in a folder where it can be found by your system’s dynamic linker.

налаштування opencl

Величезна різноманітність систем та помітні відмінності між постачальниками OpenCL та версіями драйверів унеможливлює повний огляд того, як налаштувати OpenCL. Ми можемо навести лише приклад, у цьому випадку для драйвера NVIDIA версії 331.89 на Ubuntu 14.04. Ми сподіваємось, що це послужить базовим введенням і допоможе вам вирішити будь-які проблеми, що стосуються вашого налаштування.

Принцип потоку функцій OpenCL такий:

Ansel > libOpenCL.so > libnvidia-opencl.so.1 > kernel driver module(s) > GPU

  • Ansel dynamically loads libOpenCL.so – a system library that must be accessible to the system’s dynamic loader (ld.so).

можливі проблеми та рішення

Ansel will detect OpenCL run-time errors automatically. On detecting an error, it will then reprocess everything on the CPU. While this will slow down processing it should not affect the end result.

Можуть бути різні причини того, чому OpenCL може зазнати невдачі на етапі ініціалізації. OpenCL залежить від вимог до обладнання та від наявності певних драйверів та бібліотек. На додаток, все це повинно відповідати виробнику, моделі та номеру редакції. Якщо щось не підходить (наприклад, ваш графічний драйвер – завантажений як модуль ядра – не відповідає версії вашого libOpenCL.so), підтримка OpenCL, швидше за все, буде недоступна.

профіль планування

Ansel can use the CPU and one or several OpenCL capable GPUs. Depending on the relative performance of these devices, users can choose among certain scheduling profiles to optimize performance. This is achieved by setting the configuration parameter Preferences > Processing > CPU, GPU, Memory > OpenCL scheduling profile, which offers the following choices:

default
If an OpenCL-capable GPU is found Ansel uses it for processing the center image view while the navigation preview window is processed on the CPU in parallel. This is the preferred setting for systems with a reasonably fast CPU and a moderately fast GPU. The exact allocation of devices to the various pixelpipe types can be finetuned with the “opencl_device_priority” configuration parameter (see multiple devices).
very fast GPU
With this scheduling profile Ansel processes the center image view and the preview window on the GPU sequentially. This is the preferred setting for systems with a GPU that strongly outperforms the CPU.
multiple GPUs
This setting addresses systems with multiple GPUs whose relative performance does not differ significantly. Whenever a processing job is started Ansel uses any currently idle GPU but not the CPU. Users of systems with a variety of GPUs will need better control on their relative priority. They would be better off selecting the “default” profile and fine-tuning their system with the “opencl_device_priority” configuration parameter (see multiple devices).

On first start-up or after any detected change in the GPU configuration of your system Ansel tries to identify the best suited profile for you. You can change it at any time in Preferences > Processing > CPU, GPU, Memory.

кілька пристроїв

Планування роботи пристроїв OpenCL можна оптимізувати в більшості систем, використовуючи налаштування “профіль планування OpenCL”. Однак, якщо ваша система оснащена декількома графічними процесорами, можливо, ви захочете встановити відносний пріоритет пристроїв вручну. Для цього вам потрібно вибрати профіль планування “за замовчуванням” та змінити вподобання в параметрі конфігурації “opencl_device_priority”.

It is important to understand how Ansel uses OpenCL devices. Each processing sequence of an image – to convert an input to the final output using a history stack – is run in a pixelpipe. There are four different types of pixelpipe in Ansel. One type is responsible for processing the center image view (or full view) in darkroom mode, another pixelpipe processes the preview image (navigation window). There can be one of each of these two pixelpipes running at any time, with the full and preview pixelpipes running in parallel. In addition there can be multiple parallel pixelpipes performing file exports as well as multiple parallel pixelpipes generating thumbnails. If an OpenCL device is available, Ansel dynamically allocates it to one specific pixelpipe for one run and releases it afterwards.

opencl все ще не працює в мене

As has been mentioned, OpenCL systems come with a huge variety of setups: different GPU manufacturers and models, varying amounts of GPU memory, different drivers, different distributions etc..

Many of the potential problems will only appear with very specific combinations of these factors. As the Ansel developers only have access to a small fraction of these variations, please understand that we might not be able to fix your specific problem. There is not much we can do if we are unable to reproduce your issue.

Search

You can also ask Chantal, the AI search engine.