-
-
Save apalazzi/0932dd1dbc35f4af3672316eb410c027 to your computer and use it in GitHub Desktop.
Ubuntu implementation of opencl-amd AUR package, Install opencl amdgpu amdgpu-pro opencl only ubuntu 18.04 18.10 19.04 19.10 proprietary drivers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash | |
| prefix='amdgpu-pro-' | |
| postfix='-ubuntu-18.04' | |
| major='19.50' | |
| minor='967956' | |
| shared="opt/amdgpu-pro/lib/x86_64-linux-gnu" | |
| srcdir="$(pwd)/opencl-amd_aur_ubuntu" | |
| pkgdir="${srcdir}/pkgdir" | |
| mkdir -p "${pkgdir}" | |
| cd "${srcdir}" | |
| echo "Downloading archive and extracting" | |
| wget --referer "https://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Driver-for-Linux-Release-Notes.aspx" -N -O - "https://drivers.amd.com/drivers/linux/${prefix}${major}-${minor}${postfix}.tar.xz"|tar -xJ | |
| echo "Extraction complete, creating the files" | |
| mkdir -p "${srcdir}/opencl" | |
| cd "${srcdir}/opencl" | |
| ar x "${srcdir}/${prefix}${major}-${minor}${postfix}/opencl-amdgpu-pro-icd_${major}-${minor}_amd64.deb" | |
| tar xJf data.tar.xz | |
| ar x "${srcdir}/${prefix}${major}-${minor}${postfix}/opencl-orca-amdgpu-pro-icd_${major}-${minor}_amd64.deb" | |
| tar xJf data.tar.xz | |
| cd ${shared} | |
| sed -i "s|libdrm_amdgpu|libdrm_amdgpo|g" libamdocl-orca64.so | |
| mkdir -p "${srcdir}/libdrm" | |
| cd "${srcdir}/libdrm" | |
| ar x "${srcdir}/${prefix}${major}-${minor}${postfix}/libdrm-amdgpu-amdgpu1_2.4.98-${minor}_amd64.deb" | |
| tar xJf data.tar.xz | |
| cd ${shared/amdgpu-pro/amdgpu} | |
| rm "libdrm_amdgpu.so.1" | |
| mv "libdrm_amdgpu.so.1.0.0" "libdrm_amdgpo.so.1.0.0" | |
| ln -s "libdrm_amdgpo.so.1.0.0" "libdrm_amdgpo.so.1" | |
| mv "${srcdir}/opencl/etc" "${pkgdir}/" | |
| mkdir -p ${pkgdir}/usr/lib | |
| mv "${srcdir}/opencl/${shared}/libamdocl64.so" "${pkgdir}/usr/lib/" | |
| mv "${srcdir}/opencl/${shared}/libamdocl-orca64.so" "${pkgdir}/usr/lib/" | |
| mv "${srcdir}/opencl/${shared}/libamdocl12cl64.so" "${pkgdir}/usr/lib/" | |
| mv "${srcdir}/libdrm/${shared/amdgpu-pro/amdgpu}/libdrm_amdgpo.so.1.0.0" "${pkgdir}/usr/lib/" | |
| mv "${srcdir}/libdrm/${shared/amdgpu-pro/amdgpu}/libdrm_amdgpo.so.1" "${pkgdir}/usr/lib/" | |
| mkdir -p "${pkgdir}/opt/amdgpu/share/libdrm" | |
| cd "${pkgdir}/opt/amdgpu/share/libdrm" | |
| ln -s /usr/share/libdrm/amdgpu.ids amdgpu.ids | |
| rm -r "${srcdir}/opencl" | |
| rm -r "${srcdir}/libdrm" | |
| cd "${pkgdir}" | |
| echo "Creating files complete, copying files to root. Enter sudo password when asked" | |
| sudo cp -rv * / | |
| echo Warning: remeber to remove \'mesa-opencl-icd\' \!, otherwise you will have each device in both opencl 1.1 and 1.2 modes as seperate devices . clpeak for example will report each gpu twice \! This is problematic for BOINC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment