AMD OpenCL-OpenGL interoperability on Ubuntu Linux
As far as I know, the OpenCL-OpenGL interopability on Linux only works with the amdgpu pro driver. In this post I explain how you can get the CL-GL interop to work on ubuntu.
Start by download the amd gpu pro driver for Linux: here is the version I used: https://www.amd.com/en/support/kb/release-notes/rn-rad-lin-19-10-unified)
Then unpack it:
tar -xzvf amdgpu-pro-19.10-785425-ubuntu-18.04.tar.xz
Install it with the pro option:
cd amdgpu-pro-19.10-785425-ubuntu-18.04 ./amdgpu-install --pro
Reboot, and make sure OpenGL is using the amdgpu pro version:
glxinfo | grep OpenGL
There should be a line stating: “OpenGL vendor string: Advanced Micro Devices, Inc.”. If it does not include “Advanced Micro Devices” in this line, you are not using AMD OpenGL and interoperability will not work.
Finally, when you are building your OpenCL application, make sure you link to the AMD OpenGL library, by default located at /opt/amdgpu-pro/lib/x86_64-linux-gnu/ligGL.so
Note that you can find OpenGL headers at /opt/amdgpu/include and OpenCL headers at /opt/amdgpu-pro/include/
Link for version 19.5: https://drivers.amd.com/drivers/linux//19.50/amdgpu-pro-19.50-967956-ubuntu-18.04.tar.xz