diff --git a/pika-amdgpu-core/debian/changelog b/pika-amdgpu-core/debian/changelog deleted file mode 100644 index 60e81fc..0000000 --- a/pika-amdgpu-core/debian/changelog +++ /dev/null @@ -1,29 +0,0 @@ -pika-amdgpu-core (100:22.40.50403-1538781~22.04-3) lunar; urgency=low - - * Update to 22.40.50403-1538781 - - -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200 - -pika-amdgpu-core (100:22.40.50401-1518373~22.04) kinetic; urgency=low - - * add a firmware apt hook - - -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200 - -pika-amdgpu-core (100:22.20.50205-1511376~22.04-14) kinetic; urgency=low - - * switch to systemd service - - -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200 - -pika-amdgpu-core (100:22.20.50205-1511376~22.04-13) kinetic; urgency=low - - * remove broken apt hook - - -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200 - -pika-amdgpu-core (100:22.40.50403-538781~22.04) lunar; urgency=low - - * Initial Creation - - -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200 diff --git a/pika-amdgpu-core/debian/control b/pika-amdgpu-core/debian/control deleted file mode 100644 index d107e4d..0000000 --- a/pika-amdgpu-core/debian/control +++ /dev/null @@ -1,17 +0,0 @@ -Source: pika-amdgpu-core -Section: metapackages -Priority: optional -Maintainer: Ward Nakchbandi -Build-Depends: debhelper-compat (= 13) -Standards-Version: 4.6.1 -Homepage: https://repo.radeon.com/ - -Package: pika-amdgpu-core -Section: metapackages -Architecture: all -Depends: ${misc:Depends}, libdrm-amdgpu-amdgpu1, libdrm-amdgpu-radeon1, libdrm2-amdgpu, libdrm-amdgpu-common, amdgpu-dkms-firmware -Suggests: amdgpu-vulkan-switcher, amdgpu-opengl-switcher, amdgpu-opencl-switcher, pika-amdgpu-config -Provides: amdgpu-core, amdgpu-pro-core, amdgpu-dkms, amdgpu-pro-lib32 -Multi-Arch: foreign -Description: Core meta package for Pro components of the unified amdgpu driver, with mesa priority. - diff --git a/pika-amdgpu-core/debian/copyright b/pika-amdgpu-core/debian/copyright deleted file mode 100644 index d30c7d5..0000000 --- a/pika-amdgpu-core/debian/copyright +++ /dev/null @@ -1,8 +0,0 @@ -Files: * -Copyright: 2022 Ward Nakchbandi -License: GPL-2 - -Files: debian/* -Copyright: 2022 Ward Nakchbandi -License: GPL-2 - diff --git a/pika-amdgpu-core/debian/pika-amdgpu-core.install b/pika-amdgpu-core/debian/pika-amdgpu-core.install deleted file mode 100644 index a75e237..0000000 --- a/pika-amdgpu-core/debian/pika-amdgpu-core.install +++ /dev/null @@ -1,2 +0,0 @@ -etc -usr diff --git a/pika-amdgpu-core/debian/postinst b/pika-amdgpu-core/debian/postinst deleted file mode 100755 index 1827149..0000000 --- a/pika-amdgpu-core/debian/postinst +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -set -e - -# Enable systemd service - -systemctl enable --now amdgpu-pro-lib.service || echo "amdgpu-pro-lib service could not be enabled" - -# Add firmware - -rm -r /usr/src/amdgpu-official || echo - -ln -s /usr/src/"$(ls /usr/src/ | grep amdgpu- | sort -nr | head -n1)" /usr/src/amdgpu-official - -rm -r /usr/lib/firmware/amdgpu || echo - -ln -s /usr/src/amdgpu-official/firmware/amdgpu /usr/lib/firmware/ - -update-initramfs -c -k all - -# diff --git a/pika-amdgpu-core/debian/prerm b/pika-amdgpu-core/debian/prerm deleted file mode 100644 index b44567f..0000000 --- a/pika-amdgpu-core/debian/prerm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -systemctl disable --now amdgpu-pro-lib.service || echo "amdgpu-pro-lib service could not be disabled" - -rm -r /usr/lib/firmware/amdgpu || echo - -update-initramfs -c -k all - -# Add firmware diff --git a/pika-amdgpu-core/etc/apt/apt.conf.d/99amdgpu-firmware b/pika-amdgpu-core/etc/apt/apt.conf.d/99amdgpu-firmware deleted file mode 100644 index d4d93c7..0000000 --- a/pika-amdgpu-core/etc/apt/apt.conf.d/99amdgpu-firmware +++ /dev/null @@ -1,2 +0,0 @@ -DPkg::Pre-Install-Pkgs {"/usr/share/dpkg/scripts/amdgpu-firmware-hook.sh pre";}; -DPkg::Post-Invoke {"/usr/share/dpkg/scripts/amdgpu-firmware-hook.sh post";}; diff --git a/pika-amdgpu-core/etc/environment.d/20-pika-amdgpu.conf b/pika-amdgpu-core/etc/environment.d/20-pika-amdgpu.conf deleted file mode 100644 index a5bee9c..0000000 --- a/pika-amdgpu-core/etc/environment.d/20-pika-amdgpu.conf +++ /dev/null @@ -1,2 +0,0 @@ -DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 -ROC_ENABLE_PRE_VEGA=1 diff --git a/pika-amdgpu-core/etc/systemd/system/amdgpu-pro-lib.service b/pika-amdgpu-core/etc/systemd/system/amdgpu-pro-lib.service deleted file mode 100644 index c1a8bf9..0000000 --- a/pika-amdgpu-core/etc/systemd/system/amdgpu-pro-lib.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Prevents AMDGPU-PRO dangerous behaviour and symlinks its firmware and libraries to sytem path. - -[Service] -ExecStart=/usr/bin/amdgpu-lib-refresh - -[Install] -WantedBy=multi-user.target diff --git a/pika-amdgpu-core/usr/bin/amdgpu-firmware-refresh b/pika-amdgpu-core/usr/bin/amdgpu-firmware-refresh deleted file mode 100755 index 57eb985..0000000 --- a/pika-amdgpu-core/usr/bin/amdgpu-firmware-refresh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/bash - - sudo /usr/bin/amdgpu-lib-refresh - sudo update-initramfs -c -k all - diff --git a/pika-amdgpu-core/usr/bin/amdgpu-lib-refresh b/pika-amdgpu-core/usr/bin/amdgpu-lib-refresh deleted file mode 100755 index 3435fcd..0000000 --- a/pika-amdgpu-core/usr/bin/amdgpu-lib-refresh +++ /dev/null @@ -1,289 +0,0 @@ -#! /bin/bash - -# Disables amdgpu-pro libraries to fallback to mesa -# USE wrappers instead - -export PRO_DISABLED=0 -export AMD_DISABLED=0 -export BIN_AMD_DISABLED=0 -export BIN_INTEL_DISABLED=0 -export ENC_EXISTS=0 -export AMF_EXISTS=0 -export AMD64_OPENCL_LEGACY_AMDGPU_PRO_ICD_EXISTS=0 -export AMD64_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_EXISTS=0 -export AMD64_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_DEV_EXISTS=0 -export I386_OPENCL_LEGACY_AMDGPU_PRO_ICD_EXISTS=0 -export I386_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_EXISTS=0 -export I386_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_DEV_EXISTS=0 -export AMD64_LIBGL1_AMDGPU_PRO_OGLP_EXT_EXISTS=0 -export AMD64_LIBGL1_AMDGPU_PRO_OGLP_GBM_EXISTS=0 -export AMD64_LIBEGL1_AMDGPU_PRO_OGLP_EXISTS=0 -export AMD64_LIBGL1_AMDGPU_PRO_OGLP_DRI_EXISTS=0 -export AMD64_LIBGL1_AMDGPU_PRO_OGLP_GLX_EXISTS=0 -export AMD64_LIBGLES1_AMDGPU_PRO_OGLP_EXISTS=0 -export AMD64_LIBGLES2_AMDGPU_PRO_OGLP_EXISTS=0 -export I386_LIBEGL1_AMDGPU_PRO_OGLP_EXISTS=0 -export I386_LIBGL1_AMDGPU_PRO_OGLP_DRI_EXISTS=0 -export I386_LIBGL1_AMDGPU_PRO_OGLP_GLX_EXISTS=0 -export I386_LIBGLES1_AMDGPU_PRO_OGLP_EXISTS=0 -export I386_LIBGLES2_AMDGPU_PRO_OGLP_EXISTS=0 -export AMD64_VULKAN_AMDGPU_PRO_EXISTS=0 -export I386_VULKAN_AMDGPU_PRO_EXISTS=0 -export AMD64_AMDVLK_EXISTS=0 -export I386_AMDVLK_EXISTS=0 - -# Add firmware - -rm -r /usr/src/amdgpu-official || echo - -ln -s /usr/src/"$(ls /usr/src/ | grep amdgpu- | sort -nr | head -n1)" /usr/src/amdgpu-official - -rm -r /usr/lib/firmware/amdgpu || echo - -ln -s /usr/src/amdgpu-official/firmware/amdgpu /usr/lib/firmware/ - -# Check files and packages - -### Check if library paths are disables - -cat /etc/ld.so.conf.d/10-amdgpu-pro.conf | grep "#" && export PRO_DISABLED=1 - -cat /etc/ld.so.conf.d/20-amdgpu.conf | grep "#" && export AMD_DISABLED=1 - -cat /etc/ld.so.conf.d/10-amdgpu-pro-x86_64.conf | grep "#" && export BIN_AMD_DISABLED=1 - -cat /etc/ld.so.conf.d/10-amdgpu-pro-i386.conf | grep "#" && export BIN_INTEL_DISABLED=1 - -### Check if amf libraries exist - -ls /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamdenc* && export ENC_EXISTS=1 - -ls /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamf* && export AMF_EXISTS=1 - -### Check if amd64 opencl packages exist - -dpkg -s opencl-legacy-amdgpu-pro-icd:amd64 && export AMD64_OPENCL_LEGACY_AMDGPU_PRO_ICD_EXISTS=1 - -dpkg -s ocl-icd-libopencl1-amdgpu-pro:amd64 && export AMD64_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_EXISTS=1 - -dpkg -s ocl-icd-libopencl1-amdgpu-pro-dev:amd64 && export AMD64_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_DEV_EXISTS=1 - -### Check if i386 opencl packages exist - -dpkg -s opencl-legacy-amdgpu-pro-icd:i386 && export I386_OPENCL_LEGACY_AMDGPU_PRO_ICD_EXISTS=1 - -dpkg -s ocl-icd-libopencl1-amdgpu-pro:i386 && export I386_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_EXISTS=1 - -dpkg -s ocl-icd-libopencl1-amdgpu-pro-dev:i386 && export I386_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_DEV_EXISTS=1 - - -### Check if amd64 opengl packages exist - -dpkg -s libgl1-amdgpu-pro-oglp-ext:amd64 && export AMD64_LIBGL1_AMDGPU_PRO_OGLP_EXT_EXISTS=1 - -dpkg -s libgl1-amdgpu-pro-oglp-gbm:amd64 && export AMD64_LIBGL1_AMDGPU_PRO_OGLP_GBM_EXISTS=1 - - -dpkg -s libegl1-amdgpu-pro-oglp:amd64 && export AMD64_LIBEGL1_AMDGPU_PRO_OGLP_EXISTS=1 - -dpkg -s libgl1-amdgpu-pro-oglp-dri:amd64 && export AMD64_LIBGL1_AMDGPU_PRO_OGLP_DRI_EXISTS=1 - -dpkg -s libgl1-amdgpu-pro-oglp-glx:amd64 && export AMD64_LIBGL1_AMDGPU_PRO_OGLP_GLX_EXISTS=1 - -dpkg -s libgles1-amdgpu-pro-oglp:amd64 && export AMD64_LIBGLES1_AMDGPU_PRO_OGLP_EXISTS=1 - -dpkg -s libgles2-amdgpu-pro-oglp:amd64 && export AMD64_LIBGLES2_AMDGPU_PRO_OGLP_EXISTS=1 - -### Check if i386 opengl packages exist - -dpkg -s libegl1-amdgpu-pro-oglp:i386 && export I386_LIBEGL1_AMDGPU_PRO_OGLP_EXISTS=1 - -dpkg -s libgl1-amdgpu-pro-oglp-dri:i386 && export I386_LIBGL1_AMDGPU_PRO_OGLP_DRI_EXISTS=1 - -dpkg -s libgl1-amdgpu-pro-oglp-glx:i386 && export I386_LIBGL1_AMDGPU_PRO_OGLP_GLX_EXISTS=1 - -dpkg -s libgles1-amdgpu-pro-oglp:i386 && export I386_LIBGLES1_AMDGPU_PRO_OGLP_EXISTS=1 - -dpkg -s libgles2-amdgpu-pro-oglp:i386 && export I386_LIBGLES2_AMDGPU_PRO_OGLP_EXISTS=1 - -### Check if amd64 vulkan packages exist - -dpkg -s vulkan-amdgpu-pro:amd64 && export AMD64_VULKAN_AMDGPU_PRO_EXISTS=1 - -### Check if i386 vulkan packages exist - -dpkg -s vulkan-amdgpu-pro:i386 && export I386_VULKAN_AMDGPU_PRO_EXISTS=1 - -### Check if amd64 free vulkan packages exist - -dpkg -s amdvlk:amd64 && export AMD64_AMDVLK_EXISTS=1 - -### Check if i386 free vulkan packages exist - -dpkg -s amdvlk:i386 && export I386_AMDVLK_EXISTS=1 - - -# Take Actions - -### Get rid of dangerous library paths - -if [[ "${PRODISABLED}" != 1 ]]; then - sed -i.old -e 's/^/#/' /etc/ld.so.conf.d/10-amdgpu-pro.conf -fi - -if [[ "${AMDDISABLED}" != 1 ]]; then - sed -i.old -e 's/^/#/' /etc/ld.so.conf.d/20-amdgpu.conf -fi - -if [[ "${BIN_AMD_DISABLED}" != 1 ]]; then - sed -i.old -e 's/^/#/' /etc/ld.so.conf.d/10-amdgpu-pro-x86_64.conf -fi - -if [[ "${BIN_INTEL_DISABLED}" != 1 ]]; then - sed -i.old -e 's/^/#/' /etc/ld.so.conf.d/10-amdgpu-pro-i386.conf -fi - -### Link AMF libraries to system lib path - -if [[ "${ENC_EXISTS}" != 0 ]]; then - ln -s /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamdenc* /usr/lib/x86_64-linux-gnu/ -fi - -if [[ "${AMF_EXISTS}" != 0 ]]; then - ln -s /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamf* /usr/lib/x86_64-linux-gnu/ -fi - - -### Link amd64 opencl packages -rm -rf /opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu || echo -if [[ "${AMD64_OPENCL_LEGACY_AMDGPU_PRO_ICD_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu - for i in $(dpkg-query -L opencl-legacy-amdgpu-pro-icd:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu/ ; done -fi - -if [[ "${AMD64_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu - for i in $(dpkg-query -L ocl-icd-libopencl1-amdgpu-pro:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu/ ; done -fi -if [[ "${AMD64_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_DEV_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu - for i in $(dpkg-query -L ocl-icd-libopencl1-amdgpu-pro-dev:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu/ ; done -fi - -### Link i386 opencl packages -rm -rf /opt/amdgpu-pro/pika/opencl/i386-linux-gnu || echo -if [[ "${I386_OPENCL_LEGACY_AMDGPU_PRO_ICD_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opencl/i386-linux-gnu - for i in $(dpkg-query -L opencl-legacy-amdgpu-pro-icd:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opencl/i386-linux-gnu/ ; done -fi - -if [[ "${I386_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opencl/i386-linux-gnu - for i in $(dpkg-query -L ocl-icd-libopencl1-amdgpu-pro:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opencl/i386-linux-gnu/ ; done -fi -if [[ "${I386_OCL_ICD_LIBOPENCL1_AMDGPU_PRO_DEV_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opencl/i386-linux-gnu - for i in $(dpkg-query -L ocl-icd-libopencl1-amdgpu-pro-dev:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opencl/i386-linux-gnu/ ; done -fi - -### Link amd64 opengl packages -rm -rf /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu || echo - -if [[ "${AMD64_LIBGL1_AMDGPU_PRO_OGLP_EXT_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu - for i in $(dpkg-query -L libgl1-amdgpu-pro-oglp-ext:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu/ ; done -fi - -if [[ "${AMD64_LIBGL1_AMDGPU_PRO_OGLP_GBM_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu - for i in $(dpkg-query -L libgl1-amdgpu-pro-oglp-gbm:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu/ ; done -fi - - -if [[ "${AMD64_LIBEGL1_AMDGPU_PRO_OGLP_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu - for i in $(dpkg-query -L libegl1-amdgpu-pro-oglp:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu/ ; done -fi - -if [[ "${AMD64_LIBGL1_AMDGPU_PRO_OGLP_DRI_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu - for i in $(dpkg-query -L libgl1-amdgpu-pro-oglp-dri:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu/ ; done -fi - -if [[ "${AMD64_LIBGL1_AMDGPU_PRO_OGLP_GLX_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu - for i in $(dpkg-query -L libgl1-amdgpu-pro-oglp-glx:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu/ ; done -fi - -if [[ "${AMD64_LIBGLES1_AMDGPU_PRO_OGLP_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu - for i in $(dpkg-query -L libgles1-amdgpu-pro-oglp:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu/ ; done -fi - -if [[ "${AMD64_LIBGLES2_AMDGPU_PRO_OGLP_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu - for i in $(dpkg-query -L libgles2-amdgpu-pro-oglp:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu/ ; done -fi - -### Link i386 opengl packages -rm -rf /opt/amdgpu-pro/pika/opengl/i386-linux-gnu || echo - -if [[ "${I386_LIBEGL1_AMDGPU_PRO_OGLP_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/i386-linux-gnu - for i in $(dpkg-query -L libegl1-amdgpu-pro-oglp:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/i386-linux-gnu/ ; done -fi - -if [[ "${I386_LIBGL1_AMDGPU_PRO_OGLP_DRI_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/i386-linux-gnu - for i in $(dpkg-query -L libgl1-amdgpu-pro-oglp-dri:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/i386-linux-gnu/ ; done -fi - -if [[ "${I386_LIBGL1_AMDGPU_PRO_OGLP_GLX_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/i386-linux-gnu - for i in $(dpkg-query -L libgl1-amdgpu-pro-oglp-glx:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/i386-linux-gnu/ ; done -fi - -if [[ "${I386_LIBGLES1_AMDGPU_PRO_OGLP_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/i386-linux-gnu - for i in $(dpkg-query -L libgles1-amdgpu-pro-oglp:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/i386-linux-gnu/ ; done -fi - -if [[ "${I386_LIBGLES2_AMDGPU_PRO_OGLP_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/opengl/i386-linux-gnu - for i in $(dpkg-query -L libgles2-amdgpu-pro-oglp:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu-pro/pika/opengl/i386-linux-gnu/ ; done -fi - -### Link amd64 vulkan packages -rm -rf /opt/amdgpu-pro/pika/vulkan/x86_64-linux-gnu || echo -if [[ "${AMD64_VULKAN_AMDGPU_PRO_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/vulkan/x86_64-linux-gnu - for i in $(dpkg-query -L vulkan-amdgpu-pro:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i //opt/amdgpu-pro/pika/vulkan/x86_64-linux-gnu/ ; done -fi - -### Link i386 vulkan packages -rm -rf /opt/amdgpu-pro/pika/vulkan/i386-linux-gnu || echo -if [[ "${I386_VULKAN_AMDGPU_PRO_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu-pro/pika/vulkan/i386-linux-gnu - for i in $(dpkg-query -L vulkan-amdgpu-pro:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i //opt/amdgpu-pro/pika/vulkan/i386-linux-gnu/ ; done -fi - -### Link amd64 free vulkan packages -rm -rf /opt/amdgpu/pika/vulkan/x86_64-linux-gnu || echo -if [[ "${AMD64_AMDVLK_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu/pika/vulkan/x86_64-linux-gnu - for i in $(dpkg-query -L amdvlk:amd64 | grep /x86_64-linux-gnu/ ); do ln -sfv $i /opt/amdgpu/pika/vulkan/x86_64-linux-gnu/ ; done - mkdir -p /opt/amdgpu/share/vulkan/icd.d/ - mv /etc/vulkan/icd.d/amd_icd*.json /opt/amdgpu/share/vulkan/icd.d/ || true -fi - -### Link i386 free vulkan packages -rm -rf /opt/amdgpu/pika/vulkan/i386-linux-gnu || echo -if [[ "${I386_AMDVLK_EXISTS}" != 0 ]]; then - mkdir -p /opt/amdgpu/pika/vulkan/i386-linux-gnu - for i in $(dpkg-query -L amdvlk:i386 | grep /i386-linux-gnu/ ); do ln -sfv $i /opt/amdgpu/pika/vulkan/i386-linux-gnu/ ; done - mkdir -p /opt/amdgpu/share/vulkan/icd.d/ - mv /etc/vulkan/icd.d/amd_icd*.json /opt/amdgpu/share/vulkan/icd.d/ || true - -fi - -ldconfig diff --git a/pika-amdgpu-core/usr/share/dpkg/scripts/amdgpu-firmware-hook.sh b/pika-amdgpu-core/usr/share/dpkg/scripts/amdgpu-firmware-hook.sh deleted file mode 100755 index 11c10a0..0000000 --- a/pika-amdgpu-core/usr/share/dpkg/scripts/amdgpu-firmware-hook.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash - -if [[ $1 == pre ]] -then - if grep -q amdgpu-dkms-firmware - then - mkdir -p /var/lib/apt/hooks - touch /var/lib/apt/hooks/amdgpu-dkms-firmware -else - exit 0 - fi -fi - -if [[ $1 == post ]] -then - if [[ -f /var/lib/apt/hooks/amdgpu-dkms-firmware ]] - then - amdgpu-firmware-refresh - rm -rf /var/lib/apt/hooks/amdgpu-dkms-firmware - else - exit 0 - fi -fi - diff --git a/pika-amdgpu-switcher/Makefile b/pika-amdgpu-switcher/Makefile new file mode 100644 index 0000000..1073242 --- /dev/null +++ b/pika-amdgpu-switcher/Makefile @@ -0,0 +1,6 @@ +all: + true + +install: + install -d $(DESTDIR)/ + cp -r usr $(DESTDIR)/ diff --git a/pika-amdgpu-switcher/debian/changelog b/pika-amdgpu-switcher/debian/changelog new file mode 100644 index 0000000..ca9200d --- /dev/null +++ b/pika-amdgpu-switcher/debian/changelog @@ -0,0 +1,5 @@ +pika-amdgpu-switcher (2.0-99pika2) lunar; urgency=low + + * Initial Creation + + -- Ward Nakchbandi Sun, 09 Oct 2022 18:34:00 +0300 diff --git a/pika-amdgpu-switcher/debian/control b/pika-amdgpu-switcher/debian/control new file mode 100644 index 0000000..1c2cd47 --- /dev/null +++ b/pika-amdgpu-switcher/debian/control @@ -0,0 +1,17 @@ +Source: pika-amdgpu-switcher +Section: misc +Priority: optional +Maintainer: Ward Nakchbandi +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.1 +Homepage: https://pikaproject.org/ + +Package: pika-amdgpu-switcher +Section: misc +Architecture: all +Provides: amdgpu-vulkan-switcher, amdgpu-opengl-switcher, amdgpu-opencl-switcher +Depends: ${misc:Depends} +Description: Prefix Scripts to choose the driver for OpenGL, OpenCL, and Vulkan on amdgpus. + + + diff --git a/pika-amdgpu-core/debian/rules b/pika-amdgpu-switcher/debian/rules similarity index 100% rename from pika-amdgpu-core/debian/rules rename to pika-amdgpu-switcher/debian/rules diff --git a/pika-amdgpu-core/debian/source/format b/pika-amdgpu-switcher/debian/source/format similarity index 100% rename from pika-amdgpu-core/debian/source/format rename to pika-amdgpu-switcher/debian/source/format diff --git a/pika-amdgpu-switcher/usr/bin/cl_pro b/pika-amdgpu-switcher/usr/bin/cl_pro new file mode 100755 index 0000000..27cf51b --- /dev/null +++ b/pika-amdgpu-switcher/usr/bin/cl_pro @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +# This script applies amdocl-pro OpenGL driver for specific application. +# You can test the difference with clinfo utility. + +export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/lib/i386-linux-gnu:/opt/amdgpu-pro/pika/opencl/x86_64-linux-gnu:/opt/amdgpu-pro/pika/opencl/i386-linux-gnu:${LD_LIBRARY_PATH}" + +# applied variables, now execute the rest of the command +"$@" diff --git a/pika-amdgpu-switcher/usr/bin/gl_mesa b/pika-amdgpu-switcher/usr/bin/gl_mesa new file mode 100755 index 0000000..1161981 --- /dev/null +++ b/pika-amdgpu-switcher/usr/bin/gl_mesa @@ -0,0 +1,15 @@ +#!/usr/bin/bash + +# This script applies amdogl-pro/zink/mesa OpenGL driver for specific application. +# You can test the difference (GL_VENDOR, GL_RENDERER, GL_VERSION) with glmark2 utility. +# +# Usage: +# +# For example: +# $ gl_pro davinci-resolve +# This will start davinci resolve with AMDGPU PRO OpenGL driver. + +export __GLX_VENDOR_LIBRARY_NAME=mesa + +# applied variables, now execute the rest of the command +"$@" diff --git a/pika-amdgpu-switcher/usr/bin/gl_pro b/pika-amdgpu-switcher/usr/bin/gl_pro new file mode 100755 index 0000000..d47f996 --- /dev/null +++ b/pika-amdgpu-switcher/usr/bin/gl_pro @@ -0,0 +1,15 @@ +#!/usr/bin/bash + +# This script applies amdogl-pro/zink/mesa OpenGL driver for specific application. +# You can test the difference (GL_VENDOR, GL_RENDERER, GL_VERSION) with glmark2 utility. +# +# Usage: +# +# For example: +# $ gl_pro davinci-resolve +# This will start davinci resolve with AMDGPU PRO OpenGL driver. + +export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/lib/i386-linux-gnu:/opt/amdgpu-pro/pika/opengl/x86_64-linux-gnu:/opt/amdgpu-pro/pika/opengl/i386-linux-gnu:${LD_LIBRARY_PATH}" + +# applied variables, now execute the rest of the command +"$@" diff --git a/pika-amdgpu-switcher/usr/bin/gl_zink b/pika-amdgpu-switcher/usr/bin/gl_zink new file mode 100755 index 0000000..58b56f7 --- /dev/null +++ b/pika-amdgpu-switcher/usr/bin/gl_zink @@ -0,0 +1,15 @@ +#!/usr/bin/bash + +# This script applies amdogl-pro/zink/mesa OpenGL driver for specific application. +# You can test the difference (GL_VENDOR, GL_RENDERER, GL_VERSION) with glmark2 utility. +# +# Usage: +# +# For example: +# $ gl_pro davinci-resolve +# This will start davinci resolve with AMDGPU PRO OpenGL driver. + +export __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink + +# applied variables, now execute the rest of the command +"$@" diff --git a/pika-amdgpu-switcher/usr/bin/vk_amdvlk b/pika-amdgpu-switcher/usr/bin/vk_amdvlk new file mode 100755 index 0000000..a9c421d --- /dev/null +++ b/pika-amdgpu-switcher/usr/bin/vk_amdvlk @@ -0,0 +1,20 @@ +#!/usr/bin/bash + +# This script applies amdvlk-pro/amdvlk/radv Vulkan driver for specific application. +# You can see the list of available drivers with vulkaninfo utility, see the driverName and driverID lines. +# +# Usage: +# +# For example: +# $ vk_pro vkmark +# This will start vkmark with AMDGPU PRO vulkan driver. + +# When amdvlk is installed, then VK_ICD_FILENAMES is ignored and AMD_VULKAN_ICD is read instead. However, AMD_VULKAN_ICD does not allow you (afaics) select pro driver. +# So we revert this behavior to standard one. + +export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 +export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/lib/i386-linux-gnu:${LD_LIBRARY_PATH}" +export VK_ICD_FILENAMES="/opt/amdgpu/share/vulkan/icd.d/amd_icd32.json:/opt/amdgpu/share/vulkan/icd.d/amd_icd64.json" + +# applied variables, now execute the rest of the command +"$@" diff --git a/pika-amdgpu-switcher/usr/bin/vk_pro b/pika-amdgpu-switcher/usr/bin/vk_pro new file mode 100755 index 0000000..e3900db --- /dev/null +++ b/pika-amdgpu-switcher/usr/bin/vk_pro @@ -0,0 +1,20 @@ +#!/usr/bin/bash + +# This script applies amdvlk-pro/amdvlk/radv Vulkan driver for specific application. +# You can see the list of available drivers with vulkaninfo utility, see the driverName and driverID lines. +# +# Usage: +# +# For example: +# $ vk_pro vkmark +# This will start vkmark with AMDGPU PRO vulkan driver. + +# When amdvlk is installed, then VK_ICD_FILENAMES is ignored and AMD_VULKAN_ICD is read instead. However, AMD_VULKAN_ICD does not allow you (afaics) select pro driver. +# So we revert this behavior to standard one. + +export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 +export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/lib/i386-linux-gnu:${LD_LIBRARY_PATH}" +export VK_ICD_FILENAMES="/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd32.json:/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json" + +# applied variables, now execute the rest of the command +"$@" diff --git a/pika-amdgpu-switcher/usr/bin/vk_radv b/pika-amdgpu-switcher/usr/bin/vk_radv new file mode 100755 index 0000000..c11f42e --- /dev/null +++ b/pika-amdgpu-switcher/usr/bin/vk_radv @@ -0,0 +1,18 @@ +#!/usr/bin/bash + +# This script applies amdvlk-pro/amdvlk/radv Vulkan driver for specific application. +# You can see the list of available drivers with vulkaninfo utility, see the driverName and driverID lines. +# +# Usage: +# +# For example: +# $ vk_pro vkmark +# This will start vkmark with AMDGPU PRO vulkan driver. + +# When amdvlk is installed, then VK_ICD_FILENAMES is ignored and AMD_VULKAN_ICD is read instead. However, AMD_VULKAN_ICD does not allow you (afaics) select pro driver. +# So we revert this behavior to standard one. + +export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json" + +# applied variables, now execute the rest of the command +"$@" diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/cl_pro b/pika-amdgpu-switcher/usr/share/bash-completion/completions/cl_pro new file mode 100644 index 0000000..4a78a17 --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/cl_pro @@ -0,0 +1 @@ +_have cl_pro && complete -F _command cl_pro diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_mesa b/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_mesa new file mode 100644 index 0000000..fb26129 --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_mesa @@ -0,0 +1,3 @@ +_have gl_mesa && complete -F _command gl_mesa +_have gl_zink && complete -F _command gl_zink +_have gl_pro && complete -F _command gl_pro diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_pro b/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_pro new file mode 100644 index 0000000..fb26129 --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_pro @@ -0,0 +1,3 @@ +_have gl_mesa && complete -F _command gl_mesa +_have gl_zink && complete -F _command gl_zink +_have gl_pro && complete -F _command gl_pro diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_zink b/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_zink new file mode 100644 index 0000000..fb26129 --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/gl_zink @@ -0,0 +1,3 @@ +_have gl_mesa && complete -F _command gl_mesa +_have gl_zink && complete -F _command gl_zink +_have gl_pro && complete -F _command gl_pro diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_amdvlk b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_amdvlk new file mode 100644 index 0000000..545981b --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_amdvlk @@ -0,0 +1,4 @@ +_have vk_radv && complete -F _command vk_radv +_have vk_amdvlk && complete -F _command vk_amdvlk +_have vk_pro && complete -F _command vk_pro +_have vk_legacy && complete -F _command vk_legacy diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_legacy b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_legacy new file mode 100644 index 0000000..545981b --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_legacy @@ -0,0 +1,4 @@ +_have vk_radv && complete -F _command vk_radv +_have vk_amdvlk && complete -F _command vk_amdvlk +_have vk_pro && complete -F _command vk_pro +_have vk_legacy && complete -F _command vk_legacy diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_pro b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_pro new file mode 100644 index 0000000..545981b --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_pro @@ -0,0 +1,4 @@ +_have vk_radv && complete -F _command vk_radv +_have vk_amdvlk && complete -F _command vk_amdvlk +_have vk_pro && complete -F _command vk_pro +_have vk_legacy && complete -F _command vk_legacy diff --git a/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_radv b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_radv new file mode 100644 index 0000000..545981b --- /dev/null +++ b/pika-amdgpu-switcher/usr/share/bash-completion/completions/vk_radv @@ -0,0 +1,4 @@ +_have vk_radv && complete -F _command vk_radv +_have vk_amdvlk && complete -F _command vk_amdvlk +_have vk_pro && complete -F _command vk_pro +_have vk_legacy && complete -F _command vk_legacy