Skip to content
Advertisement

What is the minimal nesesary file subset, required to AMD OpenCL work on Linux?

I’ve built Linux Kernel, with means of the buildroot. I’ve incorporated opensource amdgpu driver and required firmwares into it. Driver is fine, detecting GPUs, mode setting acts good, adjusting resolution for “small text”, and command line shows up after boot.

Now I require to run OpenCL program. I manually unpacked files from amdgpu-pro driver(rhel7 variant) and assembled skeleton fs then copied what I thought was required.

OpenCL does not recognise any devices and clinfo utility throws cl::error from cl::getPlatformIDs() call.

What are exactly files required for OpenCL to fully work on linux?

PS: Related unaswerred question, so the topic was considered actual.

Advertisement

Answer

It took me several steps further, to get all up and running:

  • There are several important symbolic links for libraries, like *.1, *.1.0.0, so on. They must be copied as well. That got opencl working, but miner still wrongs on the number of availble memory and compute units was displayed incorrectly and i had segfaults.

  • /opt/amdgpu/share/libdrm/amdgpu.ids is required for gpu models’ names and their video memory sizes being detected and displayed correctly.

  • /etc/amd/amdapfxx.blb is important file, serving for some top secret, unknown reasons.

  • As I was upgrading amdgpu-pro driver it was important not to mess library files from different versions. It was easy to do such mistake, as buildroot caches overlay to output/target structure, if you delete something from overlay you have to delete it from target as well. And such a library mess could lead to segfaults

  • To further minify subset, libEGL and libGLESv2, libgbm can be deleted. They are not nesesary for OpenCL operation and this saves 1-1.5 megs extra space.

  • LLVM seems to be unrelated to OpenCL totally, saving huge amount of space. I am not sure, maybe it is required by GL or Vulkan.

And here is complete list of nesesary files and symlinks, with exact locations, in order to get OpenCL properly working:

/usr/lib/libamdocl64.so
/usr/lib/libamdocl12cl64.so
/usr/lib/libdrm.so -> libdrm.so.2.4.0
/usr/lib/libdrm.so.2 -> libdrm.so.2.4.0
/usr/lib/libdrm.so.2.4.0
/usr/lib/libdrm_amdgpu.so -> libdrm_amdgpu.so.1.0.0
/usr/lib/libdrm_amdgpu.so.1 -> libdrm_amdgpu.so.1.0.0
/usr/lib/libdrm_amdgpu.so.1.0.0
/usr/lib/libdrm_radeon.so -> libdrm_radeon.so.1.0.1
/usr/lib/libdrm_radeon.so.1 -> libdrm_radeon.so.1.0.1
/usr/lib/libdrm_radeon.so.1.0.1
/usr/lib/libkms.so -> libkms.so.1.0.0
/usr/lib/libkms.so.1 -> libkms.so.1.0.0
/usr/lib/libkms.so.1.0.0
/usr/lib/libOpenCL.so -> libOpenCL.so.1
/usr/lib/libOpenCL.so.1
/usr/bin/clinfo
/etc/amd/amdapfxx.blb
/etc/OpenCL/vendors/amdocl64.icd
/opt/amdgpu/share/libdrm/amdgpu.ids
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement