Forked from kadrim/install_amdgpu__vce_mesa_opencl.sh
Last active
May 28, 2022 17:52
-
-
Save SeaMonkey82/0b76fad1065eb78306b7aabb6d68f2d9 to your computer and use it in GitHub Desktop.
Install amdgpu-pro packages on Debian (openCL, mesa, VCE) only.
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 | |
# --------------------------------------------------------------------------------------------------------------------------# | |
# !!! WARNING! THIS MAY MAKE YOUR DESKTOP ENVIRONMENT FAIL TO LOAD! USE TIMESHIFT TO CREATE A BACKUP FIRST! !!! # | |
# # | |
# 1st: Download the amdgpu-drivers from here: https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-40 # | |
# 2nd: Run this script with elevated privileges (sudo su) # | |
# --------------------------------------------------------------------------------------------------------------------------# | |
#=============================# | |
### CONFIG ### | |
# ADJUST VERSIONS ACCORDINGLY! | |
PACKAGE="amdgpu-pro" | |
VERSION="20.40-1147286" | |
OS="ubuntu-20.04" | |
### CONFIG ### | |
#=============================# | |
if [ ! -f ${PACKAGE}-${VERSION}-${OS}.tar.xz ] | |
then | |
echo "Download the amdgpu-pro drivers first and adjust config for this script!" | |
exit | |
fi | |
# prepare packages | |
tar -xvf ${PACKAGE}-${VERSION}-${OS}.tar.xz | |
cd ${PACKAGE}-${VERSION}-${OS} | |
mkdir unpack | |
dpkg-deb -R opencl-${PACKAGE}_${VERSION}_amd64.deb unpack/ | |
cd unpack/ | |
cd DEBIAN | |
mv control control.orig | |
grep -v "Depends: " control.orig > control | |
cd .. | |
cd .. | |
dpkg-deb -b unpack/ opencl-${PACKAGE}_${VERSION}_amd64_nodeps.deb | |
rm -r unpack/ | |
# install needed deps | |
apt-get update | |
apt-get -y install vainfo clinfo libvdpau1 | |
dpkg -i amdgpu-core_*_all.deb | |
dpkg -i amdgpu-pro-core_*_all.deb | |
# install openCL | |
dpkg -i opencl-amdgpu-pro-comgr_*_amd64.deb | |
dpkg -i opencl-amdgpu-pro-icd_*_amd64.deb | |
dpkg -i libdrm2-amdgpu_*_amd64.deb | |
dpkg -i libdrm-amdgpu-common_*_all.deb | |
dpkg -i libdrm-amdgpu-amdgpu1_*_amd64.deb | |
dpkg -i opencl-orca-amdgpu-pro-icd_*_amd64.deb | |
dpkg -i libdrm-amdgpu-radeon1_*_amd64.deb | |
# install mesa | |
dpkg -i libllvm10.0-amdgpu_*_amd64.deb | |
dpkg -i libglapi-amdgpu-mesa_*_amd64.deb | |
dpkg -i libgles2-amdgpu-mesa_*_amd64.deb | |
dpkg -i libgles1-amdgpu-mesa_*_amd64.deb | |
dpkg -i libgl1-amdgpu-mesa-glx_*_amd64.deb | |
dpkg -i mesa-amdgpu-va-drivers_*_amd64.deb | |
dpkg -i mesa-amdgpu-vdpau-drivers_*_amd64.deb | |
# install Vulkan | |
dpkg -i vulkan-amdgpu-pro_*_amd64.deb | |
# install VCE | |
dpkg -i opencl-amdgpu-pro_*_amd64_nodeps.deb | |
dpkg -i amf-amdgpu-pro_*_amd64.deb | |
cd .. | |
rm -r ${PACKAGE}-${VERSION}-${OS}/ | |
# Cleanup and put the open source driver back. | |
rm -rf /opt/amdgpu/lib/x86_64-linux-gnu/dri.orig # backup dir for amdgpu-pro driver | |
mv /opt/amdgpu/lib/x86_64-linux-gnu/dri /opt/amdgpu/lib/x86_64-linux-gnu/dri.orig | |
ln -s /usr/lib/x86_64-linux-gnu/dri /opt/amdgpu/lib/x86_64-linux-gnu/dri # put the O/S amdgpu driver back | |
apt remove mesa-opencl-icd # mesa opencl implementation, causes clashes with LLVM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment