Skip to content

Instantly share code, notes, and snippets.

@thaddeusc1
Last active January 18, 2022 02:19
Show Gist options
  • Select an option

  • Save thaddeusc1/fc9ada4e7f9ff2b24078c5976a201c4e to your computer and use it in GitHub Desktop.

Select an option

Save thaddeusc1/fc9ada4e7f9ff2b24078c5976a201c4e to your computer and use it in GitHub Desktop.
Missing libopencl and ICD data workaround for AMD's legacy OpenCL ICD in Radeon Software for Linux 21.40.1
#!/usr/bin/env bash
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# Radeon Software for Linux 21.40.1 configuration:
# ------------------------------------------------
# `amdgpu-install --accept-eula --usecase=opencl --opencl=legacy`
#
# See also: [Radeon Software for Linux Driver installation instructions](https://amdgpu-install.readthedocs.io/en/21.40/index.html)
cd /opt/amdgpu-pro/lib/x86_64-linux-gnu/
# Link to AMD's `libopencl1` using the library name OpenCL programs will search for.
# See also: Ubuntu manpage for [libopencl](http://manpages.ubuntu.com/manpages/focal/man7/libOpenCL.so.7.html)
sudo ln -s libOpenCL.so.1.2 libOpenCL.so
sudo ldconfig
# See also: Section "ICD Data" in [cl_khr_icd(3)](https://www.khronos.org/registry/OpenCL/sdk/2.2/docs/man/html/cl_khr_icd.html) manpage.
echo 'libamdocl-orca64.so' | sudo tee /etc/OpenCL/vendors/amdocl-orca64.icd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment