24. Cytoscape and OpenCL (Computing on the GPU)¶
24.1. What it is for?¶
Cytoscape has basic support for offloading computationally intesive tasks for parallel processing on a GPU, multicore CPU or a multiprocessor card using OpenCL. The OpenCL support in Cytoscape is mostly intended to provide a unifying OpenCL access for third-party Cytoscape Apps, but some core functionality (Prefuse layout) also has OpenCL implementation for increased performance.
As OpenCL can run on almost any device, including desktop computers without dedicated GPUs, you should be able to use OpenCL functionality on any platform where you can run Cytoscape, although you may need to install additional drivers for your device.
24.2. Setup & Configuration¶
The CyCL core app (should be already part of your Cytoscape distribution) lets you see the available OpenCL devices and configure your preferred device for OpenCL computation. You can see available OpenCL devices and configure your preferred device for OpenCL, select Edit → Preferences → OpenCL Settings…:
In most cases, you want your preferred device to be your GPU (if you have one). If you do not see the device you intend to use (or any device at all) in the configuration window, you may need to install OpenCL drivers. For GPUs from major manufacturers, OpenCL drivers are usually installed with the graphics driver. If you have installed the latest graphics drivers and still do not see your device in the list, check the website of your GPU manfucturer. To use OpenCL on a CPU (i.e., on any desktop computer) or a Xeon Phi, you need to install the drivers separately from the web page of the manufacturer of your CPU.
Drivers for Intel CPUs can be downloaded at https://software.intel.com/en-us/articles/opencl-drivers#latest_CPU_runtime - look for runtime-only. AMD requires you to find drivers per device for older hardware or use ROCm: https://github.com/RadeonOpenCompute/ROCm/wiki#What-Is-ROCm. .
Warning: After you have just installed drivers for your OpenCL device, Cytoscape may require restarting to be able to see the device.
24.3. OpenCL/GPU Troubleshooting¶
If any OpenCL app is not working, here are some of the common causes:
No OpenCL devices are available¶
Diagnosis and treament: See Setup and configuration above.
The Cytoscape console says “Could not find OpenCL.dll”¶
Treatment: Make sure your Windows OS directory containing OpenCL.dll is listed in the
value of the Java system property java.library.path
(OpenCL.dll can usually be found in %windir\SysWOW64%
or %windir%\system32
).
You can modify java.library.path
by adding a line of the form
-Djava.library.path=path1;path2
to the Cytoscape.vmoptions
file.
Cytoscape.vmoptions
can be found in the Cytoscape installation directory.
The computer is unresponsive for a while and then resets the screen while running OpenCL on the GPU.¶
Treatment: This problem arises if you run computations on the GPU that also handles your main display and the computation occupies the GPU for too long, preventing the operating system (e.g., Windows) from updating the display. If the operating system detects this, it terminates the GPU computation. You can either try to run smaller chunks of the computation or configure the Timeout Detection and Recovery (TDR) to let the computation complete even if the system becomes unresponsive. Further info can be found at this NVidia thread or Microsoft webpage. Microsoft also has documentation for the registry keys that need to be changed.
My problem is not listed here¶
Try to install drivers for your CPU and run on the CPU platform (see links above). CPU platforms offer lower performance, but are generally more reliable. If this does not help you, ask for help in a Cytoscape-tagged StackOverflow post.