first commit
This commit is contained in:
commit
b2520ca5af
1
orig.source.txt
Normal file
1
orig.source.txt
Normal file
@ -0,0 +1 @@
|
||||
Source is this git's root
|
6
pika-amdgpu-switcher/Makefile
Normal file
6
pika-amdgpu-switcher/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
all:
|
||||
true
|
||||
|
||||
install:
|
||||
install -d $(DESTDIR)/
|
||||
cp -r usr $(DESTDIR)/
|
5
pika-amdgpu-switcher/debian/changelog
Normal file
5
pika-amdgpu-switcher/debian/changelog
Normal 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
|
17
pika-amdgpu-switcher/debian/control
Normal file
17
pika-amdgpu-switcher/debian/control
Normal 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.
|
||||
|
||||
|
||||
|
3
pika-amdgpu-switcher/debian/rules
Executable file
3
pika-amdgpu-switcher/debian/rules
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/make -f
|
||||
%:
|
||||
dh $@
|
1
pika-amdgpu-switcher/debian/source/format
Normal file
1
pika-amdgpu-switcher/debian/source/format
Normal file
@ -0,0 +1 @@
|
||||
3.0 (native)
|
20
pika-amdgpu-switcher/usr/bin/cl_pro
Executable file
20
pika-amdgpu-switcher/usr/bin/cl_pro
Executable 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
|
||||
"$@"
|
36
pika-amdgpu-switcher/usr/bin/gl_mesa
Executable file
36
pika-amdgpu-switcher/usr/bin/gl_mesa
Executable 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
|
||||
"$@"
|
36
pika-amdgpu-switcher/usr/bin/gl_pro
Executable file
36
pika-amdgpu-switcher/usr/bin/gl_pro
Executable 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
|
||||
"$@"
|
36
pika-amdgpu-switcher/usr/bin/gl_zink
Executable file
36
pika-amdgpu-switcher/usr/bin/gl_zink
Executable 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
|
||||
"$@"
|
52
pika-amdgpu-switcher/usr/bin/vk_amdvlk
Executable file
52
pika-amdgpu-switcher/usr/bin/vk_amdvlk
Executable 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
|
||||
"$@"
|
52
pika-amdgpu-switcher/usr/bin/vk_legacy
Executable file
52
pika-amdgpu-switcher/usr/bin/vk_legacy
Executable 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
|
||||
"$@"
|
52
pika-amdgpu-switcher/usr/bin/vk_pro
Executable file
52
pika-amdgpu-switcher/usr/bin/vk_pro
Executable 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
|
||||
"$@"
|
52
pika-amdgpu-switcher/usr/bin/vk_radv
Executable file
52
pika-amdgpu-switcher/usr/bin/vk_radv
Executable 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
|
||||
"$@"
|
@ -0,0 +1 @@
|
||||
_have cl_pro && complete -F _command cl_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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
Loading…
Reference in New Issue
Block a user