File tree 1 file changed +12
-3
lines changed
core/tabs/system-setup/arch
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,21 @@ installDeps() {
16
16
done
17
17
}
18
18
19
- checkHardware () {
19
+ checkNvidiaHardware () {
20
20
# Refer https://nouveau.freedesktop.org/CodeNames.html for model code names
21
- model=$( lspci -k | grep -A 2 -E " (VGA|3D)" | grep controller | cut -d ' ' -f 7 | cut -c 1-2 )
21
+ model=$( lspci -k | grep -A 2 -E " (VGA|3D)" | grep NVIDIA | sed ' s/.*Corporation //;s/ .*// ' | cut -c 1-2)
22
22
case " $model " in
23
23
GM|GP|GV) return 1 ;;
24
24
TU|GA|AD) return 0 ;;
25
25
* ) printf " %b\n" " ${RED} Unsupported hardware." && exit 1 ;;
26
26
esac
27
27
}
28
28
29
+ checkIntelHardware () {
30
+ model=$( grep " model name" /proc/cpuinfo | head -n 1 | cut -d ' :' -f 2 | cut -c 2-3)
31
+ [ " $model " -ge 11 ]
32
+ }
33
+
29
34
promptUser () {
30
35
printf " %b" " Do you want to $1 ? [y/N]:"
31
36
read -r confirm
@@ -82,7 +87,7 @@ setupHardwareAcceleration() {
82
87
83
88
installDriver () {
84
89
# Refer https://wiki.archlinux.org/title/NVIDIA for open-dkms or dkms driver selection
85
- if checkHardware && promptUser " install nvidia's open source drivers" ; then
90
+ if checkNvidiaHardware && promptUser " install nvidia's open source drivers" ; then
86
91
printf " %b\n" " ${YELLOW} Installing nvidia open source driver...${RC} "
87
92
installDeps
88
93
" $ESCALATION_TOOL " " $PACKAGER " -S --needed --noconfirm nvidia-open-dkms
@@ -92,6 +97,10 @@ installDriver() {
92
97
" $ESCALATION_TOOL " " $PACKAGER " -S --needed --noconfirm nvidia-dkms
93
98
fi
94
99
100
+ if checkIntelHardware; then
101
+ setKernelParam " ibt=off"
102
+ fi
103
+
95
104
# Refer https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend
96
105
setKernelParam " nvidia.NVreg_PreserveVideoMemoryAllocations=1"
97
106
" $ESCALATION_TOOL " systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
You can’t perform that action at this time.
0 commit comments