update to lunar and adapt to dir patcher

This commit is contained in:
Ward Nakchbandi 2023-04-05 23:57:32 +03:00
parent 0f698065e3
commit 68ceef5e76
9 changed files with 12 additions and 236 deletions

View File

@ -1,4 +1,4 @@
pika-amdgpu-switcher (1.0-99pika1) kinetic; urgency=low
pika-amdgpu-switcher (2.0-99pika1) lunar; urgency=low
* Initial Creation

View File

@ -2,19 +2,8 @@
# 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
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
"$@"

View File

@ -9,28 +9,7 @@
# $ 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
export __GLX_VENDOR_LIBRARY_NAME=mesa
# applied variables, now execute the rest of the command
"$@"

View File

@ -9,28 +9,7 @@
# $ 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
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
"$@"

View File

@ -9,28 +9,7 @@
# $ 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
export __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink
# applied variables, now execute the rest of the command
"$@"

View File

@ -11,42 +11,10 @@
# 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
export LD_LIBRARY_PATH="/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/lib/i386-linux-gnu:${LD_LIBRARY_PATH}"
export VK_ICD_FILENAMES="/etc/vulkan/icd.d/amd_icd32.json:/etc/vulkan/icd.d/amd_icd64.json"
# applied variables, now execute the rest of the command
"$@"

View File

@ -1,52 +0,0 @@
#!/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

@ -11,42 +11,10 @@
# 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
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
"$@"

View File

@ -11,42 +11,8 @@
# 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
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
"$@"