-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheck_device.sh
executable file
·50 lines (43 loc) · 1.36 KB
/
check_device.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
echo "Checking kernel configuration for intel discrete GPUs"
echo "===================================================="
overall_status=0
echo "Checking if i915 kernel module is loaded..."
if lsmod | grep i915 > /dev/null; then
echo "i915 kernel module is loaded"
else
echo "i915 kernel module is not loaded"
overall_status=1
fi
echo ""
echo "Checking if the user is in render group..."
if groups | grep render > /dev/null; then
echo "User is in render group"
else
echo "User is not in render group"
overall_status=1
fi
echo ""
echo "Checking if Intel discrete GPU is visible as a pcie device..."
if lspci | grep -i intel | grep -i display > /dev/null; then
echo "Intel discrete GPU is visible"
else
echo "Intel discrete GPU is not visible"
overall_status=1
fi
echo ""
echo "Checking if appropriate graphics microcode is loaded in i915"
if sudo dmesg | grep -i i915 -A20 | grep -i "guc" | grep -iE "dg2_guc_|pvc_guc_|xehpsdv_guc" > /dev/null ; then
guc=$(sudo dmesg | grep -i i915 -A20 | grep -i "guc" | grep -iE "dg2_guc_|pvc_guc_|xehpsdv_guc" | cut -d "/" -f 2)
echo "Discrete GPU GuC loaded with firmware version: $guc"
else
echo "Discrete GPU GUC not loaded"
overall_status=1
fi
echo "===================================================="
echo ""
if [ $overall_status -eq 0 ]; then
exit 0
else
exit 1
fi