-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added some workarounds for known issues, reviews appreciated #10
base: master
Are you sure you want to change the base?
Conversation
sudo mkdir /etc/modprobe.d | ||
sudo mkdir -p /etc/modprobe.d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is unnecessary because /etc
exists by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah right, added it out of habit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete this
@@ -74,15 +136,11 @@ if ! sudo sh "$INSTALLER" \ | |||
--x-library-path=/opt/nvidia/lib64 \ | |||
--x-sysconfig-path=/etc/X11/xorg.conf.d \ | |||
--documentation-prefix=/opt/nvidia \ | |||
--application-profile-path=/etc/nvidia/nvidia-application-profiles-rc.d \ | |||
--application-profile-path=/etc/nvidia \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must have been an error while editing, didn't intend it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete this
if [ ! -d ./${DRIVER}] | ||
if ! sudo sh "$INSTALLER" --extract-only; then | ||
echo -e "\e[31m Installation failed! Aborting...\e[m" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two problems.
First, the syntax is incorrect
if [ ! -d ./${DRIVER} ]; then
if ! sudo sh "$INSTALLER" --extract-only; then
echo -e "\e[31m Installation failed! Aborting...\e[m"
exit 1
fi
fi
Second, according to this post, setting CONFIG_SECTION_MISMATCH_WARN_ONLY=y
should be sufficient and I don't understand why it doesn't work in your case.
Though extracting saves time, I don't think it makes a significant difference.
So unless it's made sure that we have to extract this, I prefer not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added extraction because in a previous version of the driver I also had to apply some corrections to the files inside the driver. Now I don't need it anymore, but I still extract since OS updates are much more frequent than driver updates, and this saves up some time (especially on slow drives).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is not essential, I prefer to delete this. The extraction doesn't take much time in any case.
cat <<EOF | sudo tee /etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf > /dev/null | ||
# This xorg.conf.d configuration snippet configures the X server to | ||
# automatically load the nvidia X driver when it detects a device driven by the | ||
# nvidia-drm.ko kernel module. Please note that this only works on Linux kernels | ||
# version 3.9 or higher with CONFIG_DRM enabled, and only if the nvidia-drm.ko | ||
# kernel module is loaded before the X server is started. | ||
Section "OutputClass" | ||
Identifier "intel" | ||
MatchDriver "i915" | ||
Driver "modesetting" | ||
EndSection | ||
|
||
Section "OutputClass" | ||
Identifier "nvidia" | ||
MatchDriver "nvidia-drm" | ||
Driver "nvidia" | ||
Option "AllowEmptyInitialConfiguration" | ||
Option "PrimaryGPU" "yes" | ||
ModulePath "/opt/nvidia/lib64/xorg/modules" | ||
ModulePath "/usr/lib64/xorg/modules" | ||
EndSection | ||
EOF | ||
cat <<EOF | sudo tee /etc/X11/xorg.conf.d/90-mwhd.conf > /dev/null | ||
Section "Module" | ||
Load "modesetting" | ||
EndSection | ||
|
||
Section "Device" | ||
Identifier "nvidia" | ||
Driver "nvidia" | ||
BusID "PCI:1:0:0" | ||
Option "AllowEmptyInitialConfiguration" | ||
EndSection | ||
EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any references?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 58 to 79 LGTM. But Line 76 to 77 may be redundant given line 52 to 55.
Line 88 could be problematic. Suppose the GPU is not on PCI 1, or there are multiple GPUs, this won't work properly.
# Optimus workaround (maybe should ask user first?) | ||
echo -e "\e[33m\xe2\x8f\xb3 Applying Optimus workarounds...\e[m" | ||
if [ ! -d /usr/local/share ]; then | ||
sudo mkdir -p /usr/local/share | ||
fi | ||
cat <<EOF | sudo tee /usr/local/share/optimus.desktop > /dev/null | ||
[Desktop Entry] | ||
Type=Application | ||
Name=Optimus | ||
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto" | ||
NoDisplay=true | ||
X-GNOME-Autostart-Phase=DisplayServer | ||
EOF | ||
sudo ln -s /usr/local/share/optimus.desktop /usr/share/gdm/greeter/autostart/optimus.desktop | ||
sudo ln -s /usr/local/share/optimus.desktop /etc/xdg/autostart/optimus.desktop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer not to add this part for two reasons:
Optimus
support isn't reliable. Even NVIDIA itself suggests that if you cannot turn off integrated GPU this may not work.- I cannot test this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have never ever been able to boot CL without this specific workaround, even when disabling iGPU (via the kernel command line arguments). Furthermore it never caused any trouble, so I don't think it will affect non-optimus devices...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 106: This is not halal because it's modifying /usr/share
. The solution is to do something similar to line 31 to 38 in pre_install.bash
.
line 107: Make sure /etc/xdg/autostart/
exists before creating that symlink
I just installed the driver and I only added So here's what I'm thinking:
Please merge into |
Just as the title says, might need some polish, especially considering that all the DKMS stuff has no impact since we are not using it anymore. This has never been a problem IMO: every OS update I always had to reinstall the drivers anyway.
Another thing is that the installer is NOT run silently: if the generated keys get dropped, installation fails, and I found no command line option to keep them (if there is, then we can make the installer silent again, and avoid user confusion)