Add intel drivers

This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-10-29 17:55:47 +03:00 committed by GitHub
parent e1f8d37c48
commit cf1171ef3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 43 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "pika-drivers"
version = "0.4.3"
version = "0.4.4"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -8,7 +8,7 @@ DRIVERS="$DRIVERS mesa-hybrid mesa-stable mesa-git"
### Check if the amdgpu module is loaded
### advanced micro devices graphics cards with "radeon" module only do not support the additional drivers
if inxi -G | grep driver | grep amdgpu &> /dev/null
if inxi -G | grep driver | grep -i amdgpu &> /dev/null
then
DRIVERS="$DRIVERS pika-rocm-meta vulkan-amdgpu-pro amf-amdgpu-pro amdvlk opencl-legacy-amdgpu-pro-icd amdgpu-pro-oglp"
fi
@ -19,6 +19,12 @@ then
DRIVERS="$DRIVERS xone-dkms"
fi
### Check for Intel GPUs
if inxi -G | grep driver | grep -i intel &> /dev/null
then
DRIVERS="$DRIVERS intel-gpu-compute"
fi
### If no drivers were found set them to random hash to trigger no drivers needed dialog in gui app
if [[ -z $DRIVERS ]]
then
@ -26,4 +32,4 @@ then
fi
### Print result
echo -e "$DRIVERS" | tr ' ' '\n' | grep "\S"
echo -e "$DRIVERS" | tr ' ' '\n' | grep "\S"

View File

@ -8,45 +8,36 @@ then
else
echo "Version: $(apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1)"
fi
else
if [[ $1 == "description" ]]
elif [[ $1 == "description" ]]
then
if echo "$2" | grep mesa-git &> /dev/null
then
if echo "$2" | grep mesa-git &> /dev/null
then
printf "WARNING: THIS DRIVER IS EXPERMINTAL USE AT YOUR OWN RISK!\n$(apt-cache show mesa-git | grep 'Description*' | cut -d":" -f2 | head -n1)"
else
apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
fi
printf "WARNING: THIS DRIVER IS EXPERMINTAL USE AT YOUR OWN RISK!\n$(apt-cache show mesa-git | grep 'Description*' | cut -d":" -f2 | head -n1)"
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
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3 | grep -i AMD)"
else
if echo "$2" | grep -i -E 'xone' &> /dev/null
then
DEVICE="$(lsusb | grep -i xbox | cut -d":" -f3)"
else
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
if echo "$2" | grep -i -E 'mesa' &> /dev/null
then
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3 | grep -vi nvidia)"
else
DEVICE="$(ubuntu-drivers devices | sed ':a;N;$!ba;s/\nmodel/ /g' | grep vendor | grep -i $2 | sed 's/vendor/Device:/')"
fi
fi
fi
fi
fi
if [[ ! -z $DEVICE ]]
then
echo "Device: $DEVICE"
else
echo "Device: UNKNOWN!"
fi
apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
fi
fi
elif [[ $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
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -i AMD)"
elif echo "$2" | grep -i -E 'xone' &> /dev/null
then
DEVICE="$(lsusb | grep -i xbox)"
elif echo "$2" | grep -i -E 'intel' &> /dev/null
then
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -i intel)"
elif echo "$2" | grep -i -E 'nvidia' &> /dev/null
then
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -i nvidia)"
elif echo "$2" | grep -i -E 'mesa' &> /dev/null
then
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -vi nvidia)"
fi
if [[ ! -z $DEVICE ]]
then
echo "Device: $DEVICE"
else
echo "Device: UNKNOWN!"
fi
fi

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
pika-drivers (0.4.3-100pika1) pikauwu; urgency=medium
pika-drivers (0.4.4-100pika1) pikauwu; urgency=medium
* initial release

View File

@ -355,6 +355,8 @@ fn get_drivers(main_window: &gtk::Box, loading_box: &gtk::Box, ubuntu_drivers_li
driver_icon.set_from_icon_name(Some("input-gaming"));
} else if driver_name.contains("nvidia") {
driver_icon.set_from_icon_name(Some("nvidia"));
} else if driver_name.contains("intel") {
driver_icon.set_from_icon_name(Some("intel"));
} else {
driver_icon.set_from_icon_name(Some("pika-drivers"));
}