Last active
June 17, 2021 00:41
-
-
Save kaczor6418/c9d82fcee866322c26b751665ed3055c to your computer and use it in GitHub Desktop.
AMD + NVIDIA setup on linux manjaro / arch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#FOR ARCH LINUX# | |
sudo pacman -S nvidia #or nvidia-lts if linux-lts | |
sudo gedit /etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf | |
#text | |
Section "OutputClass" | |
Identifier "intel" # or amd | |
MatchDriver "i915" # can be removed if amd | |
Driver "modesetting" | |
EndSection | |
Section "OutputClass" | |
Identifier "nvidia" | |
MatchDriver "nvidia-drm" | |
Driver "nvidia" | |
Option "AllowEmptyInitialConfiguration" | |
Option "PrimaryGPU" "yes" | |
ModulePath "/usr/lib/nvidia/xorg" | |
ModulePath "/usr/lib/xorg/modules" | |
EndSection | |
#text | |
sudo gedit /etc/lightdm/display_setup.sh | |
#text | |
#!/bin/sh | |
xrandr --setprovideroutputsource modesetting NVIDIA-0 | |
xrandr --auto | |
#text | |
chmod +x /etc/lightdm/display_setup.sh | |
sudo gedit /etc/lightdm/lightdm.conf | |
#text | |
[Seat:*] | |
display-setup-script=/etc/lightdm/display_setup.sh | |
#text | |
sudo gedit /etc/default/grub | |
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia-drm.modeset=1" #Add nvidia-drm.modeset=1 to the end# | |
sudo grub-mkconfig -o /boot/grub/grub.cfg | |
sudo gedit /etc/mkinitcpio.conf | |
#add text | |
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) | |
#text | |
sudo pacman -S linux #reinstalling the linux kernel to update initramfs. or linux-lts for lts kernel | |
sudo gedit /etc/pacman.d/hooks/nvidia.hook #automatization# | |
[Trigger] | |
Operation=Install | |
Operation=Upgrade | |
Operation=Remove | |
Type=Package | |
Target=nvidia nvidia_modeset nvidia_uvm nvidia_drm | |
Target=linux #or linux-lts if using lts kernel | |
[Action] | |
Description=Update Nvidia module in initcpio | |
Depends=mkinitcpio | |
When=PostTransaction | |
NeedsTargets | |
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment