first commit

This commit is contained in:
Ward 2023-02-23 22:04:12 +02:00
commit b2520ca5af
22 changed files with 395 additions and 0 deletions

1
orig.source.txt Normal file
View File

@ -0,0 +1 @@
Source is this git's root

View File

@ -0,0 +1,6 @@
all:
true
install:
install -d $(DESTDIR)/
cp -r usr $(DESTDIR)/

View File

@ -0,0 +1,5 @@
pika-amdgpu-switcher (1.0-99pika1) kinetic; urgency=low
* Initial Creation
-- Ward Nakchbandi <hotrod.master@hotmail.com> Sun, 09 Oct 2022 18:34:00 +0300

View File

@ -0,0 +1,17 @@
Source: pika-amdgpu-switcher
Section: misc
Priority: optional
Maintainer: Ward Nakchbandi <hotrod.master@hotmail.com>
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.

View File

@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@

View File

@ -0,0 +1 @@
3.0 (native)

View File

@ -0,0 +1,20 @@
#!/usr/bin/bash
# This script applies amdocl-pro OpenGL driver for specific application.
# You can test the difference with clinfo utility.
#
cl_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:/opt/amdgpu-pro/lib/x86_64-linux-gnu:/opt/amdgpu-pro/lib/i386-linux-gnu:${LD_LIBRARY_PATH}"
}
if [[ $(basename $0) == cl_pro ]]; then
cl_pro
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1,36 @@
#!/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:
# <gl_mesa|gl_zink|gl_pro> <app and its parameters>
# For example:
# $ gl_pro davinci-resolve
# This will start davinci resolve with AMDGPU PRO OpenGL driver.
gl_mesa() {
export __GLX_VENDOR_LIBRARY_NAME=mesa
}
gl_zink() {
export __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink
}
gl_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:/opt/amdgpu-pro/lib/x86_64-linux-gnu:/opt/amdgpu-pro/lib/i386-linux-gnu:${LD_LIBRARY_PATH}"
}
if [[ $(basename $0) == gl_mesa ]]; then
gl_mesa
elif [[ $(basename $0) == gl_zink ]]; then
gl_zink
elif [[ $(basename $0) == gl_pro ]]; then
gl_pro
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1,36 @@
#!/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:
# <gl_mesa|gl_zink|gl_pro> <app and its parameters>
# For example:
# $ gl_pro davinci-resolve
# This will start davinci resolve with AMDGPU PRO OpenGL driver.
gl_mesa() {
export __GLX_VENDOR_LIBRARY_NAME=mesa
}
gl_zink() {
export __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink
}
gl_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:/opt/amdgpu-pro/lib/x86_64-linux-gnu:/opt/amdgpu-pro/lib/i386-linux-gnu:${LD_LIBRARY_PATH}"
}
if [[ $(basename $0) == gl_mesa ]]; then
gl_mesa
elif [[ $(basename $0) == gl_zink ]]; then
gl_zink
elif [[ $(basename $0) == gl_pro ]]; then
gl_pro
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1,36 @@
#!/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:
# <gl_mesa|gl_zink|gl_pro> <app and its parameters>
# For example:
# $ gl_pro davinci-resolve
# This will start davinci resolve with AMDGPU PRO OpenGL driver.
gl_mesa() {
export __GLX_VENDOR_LIBRARY_NAME=mesa
}
gl_zink() {
export __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink
}
gl_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:/opt/amdgpu-pro/lib/x86_64-linux-gnu:/opt/amdgpu-pro/lib/i386-linux-gnu:${LD_LIBRARY_PATH}"
}
if [[ $(basename $0) == gl_mesa ]]; then
gl_mesa
elif [[ $(basename $0) == gl_zink ]]; then
gl_zink
elif [[ $(basename $0) == gl_pro ]]; then
gl_pro
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1,52 @@
#!/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:
# <vk_radv|vk_amdvlk|vk_pro> <app and its parameters>
# 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
RADV_DIR="/usr/share/vulkan/icd.d"
PRO_DIR="/opt/amdgpu-pro/etc/vulkan/icd.d"
VLK_DIR="/etc/vulkan/icd.d"
LEGACY_DIR="/opt/amdgpu-pro/vulkan-legacy/etc/vulkan/icd.d"
vk_radv() {
export VK_ICD_FILENAMES="${RADV_DIR}/radeon_icd.i686.json:${RADV_DIR}/radeon_icd.x86_64.json"
}
vk_amdvlk() {
export VK_ICD_FILENAMES="${VLK_DIR}/amd_icd32.json:${VLK_DIR}/amd_icd64.json"
}
vk_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:${LD_LIBRARY_PATH}"
export VK_ICD_FILENAMES="${PRO_DIR}/amd_icd32.json:${PRO_DIR}/amd_icd64.json"
}
vk_legacy() {
export VK_ICD_FILENAMES="${LEGACY_DIR}/amd_icd32.json:${LEGACY_DIR}/amd_icd64.json"
}
if [[ $(basename $0) == vk_radv ]]; then
vk_radv
elif [[ $(basename $0) == vk_amdvlk ]]; then
vk_amdvlk
elif [[ $(basename $0) == vk_pro ]]; then
vk_pro
elif [[ $(basename $0) == vk_legacy ]]; then
vk_legacy
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1,52 @@
#!/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:
# <vk_radv|vk_amdvlk|vk_pro> <app and its parameters>
# 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
RADV_DIR="/usr/share/vulkan/icd.d"
PRO_DIR="/opt/amdgpu-pro/etc/vulkan/icd.d"
VLK_DIR="/etc/vulkan/icd.d"
LEGACY_DIR="/opt/amdgpu-pro/vulkan-legacy/etc/vulkan/icd.d"
vk_radv() {
export VK_ICD_FILENAMES="${RADV_DIR}/radeon_icd.i686.json:${RADV_DIR}/radeon_icd.x86_64.json"
}
vk_amdvlk() {
export VK_ICD_FILENAMES="${VLK_DIR}/amd_icd32.json:${VLK_DIR}/amd_icd64.json"
}
vk_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:${LD_LIBRARY_PATH}"
export VK_ICD_FILENAMES="${PRO_DIR}/amd_icd32.json:${PRO_DIR}/amd_icd64.json"
}
vk_legacy() {
export VK_ICD_FILENAMES="${LEGACY_DIR}/amd_icd32.json:${LEGACY_DIR}/amd_icd64.json"
}
if [[ $(basename $0) == vk_radv ]]; then
vk_radv
elif [[ $(basename $0) == vk_amdvlk ]]; then
vk_amdvlk
elif [[ $(basename $0) == vk_pro ]]; then
vk_pro
elif [[ $(basename $0) == vk_legacy ]]; then
vk_legacy
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1,52 @@
#!/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:
# <vk_radv|vk_amdvlk|vk_pro> <app and its parameters>
# 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
RADV_DIR="/usr/share/vulkan/icd.d"
PRO_DIR="/opt/amdgpu-pro/etc/vulkan/icd.d"
VLK_DIR="/etc/vulkan/icd.d"
LEGACY_DIR="/opt/amdgpu-pro/vulkan-legacy/etc/vulkan/icd.d"
vk_radv() {
export VK_ICD_FILENAMES="${RADV_DIR}/radeon_icd.i686.json:${RADV_DIR}/radeon_icd.x86_64.json"
}
vk_amdvlk() {
export VK_ICD_FILENAMES="${VLK_DIR}/amd_icd32.json:${VLK_DIR}/amd_icd64.json"
}
vk_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:${LD_LIBRARY_PATH}"
export VK_ICD_FILENAMES="${PRO_DIR}/amd_icd32.json:${PRO_DIR}/amd_icd64.json"
}
vk_legacy() {
export VK_ICD_FILENAMES="${LEGACY_DIR}/amd_icd32.json:${LEGACY_DIR}/amd_icd64.json"
}
if [[ $(basename $0) == vk_radv ]]; then
vk_radv
elif [[ $(basename $0) == vk_amdvlk ]]; then
vk_amdvlk
elif [[ $(basename $0) == vk_pro ]]; then
vk_pro
elif [[ $(basename $0) == vk_legacy ]]; then
vk_legacy
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1,52 @@
#!/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:
# <vk_radv|vk_amdvlk|vk_pro> <app and its parameters>
# 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
RADV_DIR="/usr/share/vulkan/icd.d"
PRO_DIR="/opt/amdgpu-pro/etc/vulkan/icd.d"
VLK_DIR="/etc/vulkan/icd.d"
LEGACY_DIR="/opt/amdgpu-pro/vulkan-legacy/etc/vulkan/icd.d"
vk_radv() {
export VK_ICD_FILENAMES="${RADV_DIR}/radeon_icd.i686.json:${RADV_DIR}/radeon_icd.x86_64.json"
}
vk_amdvlk() {
export VK_ICD_FILENAMES="${VLK_DIR}/amd_icd32.json:${VLK_DIR}/amd_icd64.json"
}
vk_pro() {
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/i386-linux-gnu:${LD_LIBRARY_PATH}"
export VK_ICD_FILENAMES="${PRO_DIR}/amd_icd32.json:${PRO_DIR}/amd_icd64.json"
}
vk_legacy() {
export VK_ICD_FILENAMES="${LEGACY_DIR}/amd_icd32.json:${LEGACY_DIR}/amd_icd64.json"
}
if [[ $(basename $0) == vk_radv ]]; then
vk_radv
elif [[ $(basename $0) == vk_amdvlk ]]; then
vk_amdvlk
elif [[ $(basename $0) == vk_pro ]]; then
vk_pro
elif [[ $(basename $0) == vk_legacy ]]; then
vk_legacy
else
echo "Unknown function"
exit 1
fi
# applied variables, now execute the rest of the command
"$@"

View File

@ -0,0 +1 @@
_have cl_pro && complete -F _command cl_pro

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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