2023-06-30 12:36:00 +02:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
if [[ $1 == "version" ]]
|
|
|
|
then
|
2023-08-14 14:41:42 +02:00
|
|
|
if [[ $2 == "pika-rocm-meta" ]]
|
|
|
|
then
|
|
|
|
echo "Version: $(apt-cache show rocm-core | grep Version: | cut -d":" -f2 | head -n1)"
|
|
|
|
else
|
|
|
|
echo "Version: $(apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1)"
|
|
|
|
fi
|
2023-06-30 12:36:00 +02:00
|
|
|
else
|
|
|
|
if [[ $1 == "description" ]]
|
|
|
|
then
|
2023-06-30 13:50:04 +02:00
|
|
|
apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
|
2023-06-30 12:36:00 +02:00
|
|
|
else
|
|
|
|
if [[ $1 == "device" ]]
|
|
|
|
then
|
|
|
|
if echo "$2" | grep -i -E 'pika-rocm-meta|vulkan-amdgpu-pro|amf-amdgpu-pro|amdvlk|opencl-legacy-amdgpu-pro-icd|amdgpu-pro-oglp' &> /dev/null
|
|
|
|
then
|
2023-07-01 15:49:05 +02:00
|
|
|
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3 | grep -i AMD)"
|
2023-06-30 12:36:00 +02:00
|
|
|
else
|
|
|
|
if echo "$2" | grep -i -E 'xone' &> /dev/null
|
|
|
|
then
|
2023-07-01 15:49:05 +02:00
|
|
|
DEVICE="$(lsusb | grep -i xbox | cut -d":" -f3)"
|
2023-06-30 12:36:00 +02:00
|
|
|
else
|
2023-07-01 15:49:05 +02:00
|
|
|
if echo "$2" | grep -i -E 'nvidia' &> /dev/null
|
|
|
|
then
|
|
|
|
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3 | grep -i nvidia)"
|
|
|
|
else
|
2023-08-14 14:41:42 +02:00
|
|
|
if echo "$2" | grep -i -E 'mesa' &> /dev/null
|
|
|
|
then
|
2023-08-14 14:47:31 +02:00
|
|
|
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3 | grep -vi nvidia)"
|
2023-08-14 14:41:42 +02:00
|
|
|
else
|
|
|
|
DEVICE="$(ubuntu-drivers devices | sed ':a;N;$!ba;s/\nmodel/ /g' | grep vendor | grep -i $2 | sed 's/vendor/Device:/')"
|
|
|
|
fi
|
2023-07-01 15:49:05 +02:00
|
|
|
fi
|
2023-06-30 12:36:00 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2023-07-01 15:49:05 +02:00
|
|
|
if [[ ! -z $DEVICE ]]
|
|
|
|
then
|
|
|
|
echo "Device: $DEVICE"
|
|
|
|
else
|
|
|
|
echo "Device: UNKNOWN!"
|
|
|
|
fi
|
2023-06-30 12:36:00 +02:00
|
|
|
fi
|
|
|
|
fi
|