ElectricRCAircraftGuy / ElectricRCAircraftGuy.github.io

My github pages website at gabrielstaples.com
https://gabrielstaples.com/
5 stars 1 forks source link

https://gabrielstaples.com/common-ways-to-fix-linux-video-driver-issues/ #51

Closed utterances-bot closed 1 year ago

utterances-bot commented 1 year ago

Common ways to fix video driver (and related) issues in Linux Ubuntu | GabrielStaples.com home

…in case you are experiencing any of these issues:

https://gabrielstaples.com/common-ways-to-fix-linux-video-driver-issues/

ElectricRCAircraftGuy commented 1 year ago

I'm still having issues on a brand new Dell Precision 5570 running Ubuntu 22.04 with X11 (not Wayland) for which I've already done my own recommendations above. So, here are some more things I'm trying:

From my answer here: Ask Ubuntu: ucsi_acpi PPM init failed (-110):

Also try

  1. NVIDIA Settings: change to "Performance mode" instead of "On-Demand" mode.
  2. Manually make your AMDgpu NOT primary (Option "PrimaryGPU" "no"), and your NVIDIA GPU primary (Option "PrimaryGPU" "yes"): Unix & Linux: Mint 19.3 Cinnamon: ucsi_acpi USBC000:00: PPM init failed (-110)

See my answer above for more details on these 2 other things to try.

See also my comment here.

ElectricRCAircraftGuy commented 1 year ago

Alright, here is my test process:

Problem:

My Dell Precision 5570 laptop won't suspend.

Ubuntu 22.04 OS. NVIDIA graphics card with the driver chosen and "step 1" done, as explained in my answer here: Ask Ubuntu: ucsi_acpi PPM init failed (-110)

X11 Window manager.

Steps to reproduce

  1. Click in the top-right of Ubuntu --> "Power Off/Log Out" --> "Suspend".
  2. Wait 20 seconds. The screen will be black. Hit any key, such as Escape. The screen will wake up and ask for your password to log in. This is wrong. Waking up from suspend should require pressing the Power button. This means it wasn't fully suspended.
  3. As it begins to wake up, I also see these errors. I recorded a video to catch it in time, then paused on the frame with these errors: image

    Here are the errors (with an extra line added at the end from a later screenshot I took from the same video):

    [ 9376.997917] i915 0000:00:02.0: [drm] *ERROR* [ENCODER:271:DDI TC2/PHY TC2] [DPRX] Failed to enable link training
    [ 9399.622716] ucsi_acpi USBC000:00: failed to re-enable notifications (-110)
    [ 9429.834129] ucsi_acpi USBC000:00: failed to re-enable notifications (-110)
    [ 9439.529120] ucsi_acpi USBC000:00: failed to re-enable notifications (-110)
    [ 9458.178700] ucsi_acpi USBC000:00: failed to re-enable notifications (-110)
    [ 9505.841380] ucsi_acpi USBC000:00: failed to re-enable notifications (-110)

Additional references and links to look into / potential fixes to try

  1. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1970957

    Liam Coogan (lcoogan) said:

    I was able to fix this problem on 22.04 LTS by disabling 'Always on USB' in the BIOS.

    The same fix does NOT work on 22.10. Why? Beats me.

  2. https://gist.github.com/bmcbm/375f14eaa17f88756b4bdbbebbcfd029

    See the comments by @Wezel and @bmharper!

ElectricRCAircraftGuy commented 1 year ago

More potential fixes that did not fix my failure-to-suspend issue:

  1. [x] NVIDIA Settings: change to "Performance mode" instead of "On-Demand" mode.
  2. [x] Upgrading my BIOS to the latest version 1.13.1.
  3. [x] Setting this BIOS setting: Power → USB Wake Support → turn OFF the option for “Wake on Dell USB-C Dock”.
ElectricRCAircraftGuy commented 1 year ago

This did not fix the suspend issue either :(:

See: https://unix.stackexchange.com/a/597882/114401

Note: in the commands below, subl is my text editor (Sublime Text 3).

# Back up all files at `/usr/share/X11/xorg.conf.d`.
mkdir -p ~/bak/usr__share__X11
cp -ai /usr/share/X11/xorg.conf.d ~/bak/usr__share__X11
# create an empty file with a note to contain the backup date
touch ~/bak/usr__share__X11/backed_up_2023.06.11
cd /usr/share/X11/xorg.conf.d 
sudo subl 10-amdgpu.conf

Change this:

Section "OutputClass"
    Identifier "AMDgpu"
    MatchDriver "amdgpu"
    Driver "amdgpu"
EndSection

to this:

Section "OutputClass"
    Identifier "AMDgpu"
    MatchDriver "amdgpu"
    Driver "amdgpu"
    Option "PrimaryGPU" "no"
EndSection
sudo subl /usr/share/X11/xorg.conf.d/10-nvidia.conf

Change this:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

to this:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection
ElectricRCAircraftGuy commented 1 year ago

Let's try downgrading the graphics driver. In "Software & Updates" --> Additional Drivers, I have the 530 (proprietary) driver selected:

image

Let's try 530-open (proprietary, tested), then 525 (proprietary), 525-server (proprietary), 525-open (proprietary), etc. etc.

Video driver test results (a check mark means it has been tested):

  1. [x] 530 (proprietary) - boots; external monitors work; laptop screen brightness buttons work; it will not properly suspend (pressing a key wakes it up).
  2. [x] 530-open (proprietary, tested) - will NOT boot. When I tried to boot, I typed in my LUKS-encryption password, and it successfully decrypted, but then it got stuck on a type of Ubuntu loading screen. Pressing Ctrl + Alt + Delete revealed this text output on the screen, with the given errors at the bottom of that output: PXL_20230612_005202176
    1. To fix it, I had to hard reset by holding down the power button, then in the grub boot menu, instead of choosing "Ubuntu", I chose "Advanced options for Ubuntu": image Then I chose "Ubuntu, with Linux 5.19.0-43-generic (recovery mode)" --> then it booted into a "Recovery Menu" screen with a purple background and a window menu. I chose "resume" at the top of that window, to "Resume normal boot". This booted into a recovery mode version of Ubuntu, where I could not choose Wayland nor Gnome at login, and which did not work with external monitors, and which did not properly suspend either. I think it was using a software-based video card or something as part of the safe mode to let it boot. From there, I opened the "Software & Updates" --> Additional Drivers menu again, and downgraded to the following NVIDIA driver, then rebooted to test it.
  3. [x] 470 (proprietary) - [same behavior as 530 (proprietary)] boots; external monitors work; laptop screen brightness buttons work; it will not properly suspend (pressing a key wakes it up).
  4. [x] 470-server (proprietary) - [same behavior as 530 (proprietary)] boots; external monitors work; laptop screen brightness buttons work; it will not properly suspend (pressing spacebar wakes it up).
    1. Also of note is that there is no nvidia-settings utility to change the settings. I haven't been thoroughly checking this with the other drivers, so I don't know exactly which do vs don't have the NVIDIA settings GUI application.
  5. [x] 525 (proprietary) - [same behavior as 530 (proprietary)] boots; external monitors work; laptop screen brightness buttons work; it will not properly suspend (pressing spacebar wakes it up). The NVIDIA settings GUI application is there.
  6. [x] At this point, I decided to try a BIOS setting change. I rebooted into the BIOS --> Integrated Devices --> in the "Video/Power only on Type-C Ports" section, I turned ON this feature which "Limits Type-C port functionality to Video or Power only".
    1. This did no good. All it did was make my external mouse quit working since the USB mouse dongle is plugged into my Dell-provided USB-C to HDMI and USB-A adapter hub. This BIOS feature apparently made that hub only allow video output to my HDMI monitor, rather than also work as a USB hub for my mouse dongle. There was no change to suspend, when I tested that. The laptop still won't suspend fully.
    2. So, I rebooted back into the BIOS after testing this, and turned this feature back OFF again.
  7. [x] 515 (proprietary) - [same behavior as 530 (proprietary)] boots; external monitors work; laptops screen brightness buttons work; it will not properly suspend (pressing spacebar wakes it up). The NVIDIA settings GUI application is there.
  8. [ ] 510 (proprietary)
  9. [ ] nouveau (open source)
ElectricRCAircraftGuy commented 1 year ago

Linux Sleep States: Update: nothing is wrong with my new laptop's sleep!

Ok, so I've learned a lot over the last couple weeks, and absolutely nothing is wrong with my brand new Dell Precision 5570 laptop running Ubuntu 22.04 with X11 (not Wayland).

The fact that pressing any key wakes up the laptop from sleep does not mean it wasn't properly asleep, or that sleep wasn't working! Rather, this laptop simply supports a shallower s2idle sleep mode, rather than the deeper deep sleep mode. Apparently, all of my main Linux laptops in the past have supported the deep sleep mode, so I just got used to that behavior is all, and expected it on this laptop too. This laptop is fine.

I'll write a follow-up article about it.

Meanwhile, I am doing the following:

  1. [x] undo these changes to my /usr/share/X11/xorg.conf.d/10-amdgpu.conf and /usr/share/X11/xorg.conf.d/10-nvidia.conf files.
  2. [x] put my video driver back to the 530 (proprietary) one which works perfectly and is the latest proprietary NVIDIA video driver provided by Ubuntu.

And here are some links to get me started on my next article about Linux sleep modes:

  1. Google search for "s2idle"
  2. https://askubuntu.com/q/1455199/327339
  3. https://learnubuntumate.weebly.com/draining-battery.html
  4. Google search for "linux power consumption s2idle raid vs ahci"
  5. https://discussion.fedoraproject.org/t/dell-battery-drained-while-suspended/66514/2
  6. Google search for "linux /sys/power/mem_sleep echo set to deep not s2idle"
  7. What does this command do (echo deep | sudo tee -a /sys/power/mem_sleep)?
  8. ***** https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-power
  9. Suspend when lid is closed:
    1. How to make Ubuntu suspend when we close the laptop lid
    2. https://itsfoss.com/ubuntu-close-lid-suspend/
ElectricRCAircraftGuy commented 9 months ago

If you need a USB-C or USB-A video adapter to HDMI, DP, etc., see also my answer here:

Ask Ubuntu: USB video card adapters for Linux Ubuntu

ElectricRCAircraftGuy commented 7 months ago

A few Linux links of mine you might want, for right after installing Ubuntu 22.04 or later:

  1. fix video driver issues: ⁠https://gabrielstaples.com/common-ways-to-fix-linux-video-driver-issues/#gsc.tab=0
  2. trackpad and mouse scroll fix: https://askubuntu.com/a/991680/327339
    1. https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/useful_scripts/touchpad_toggle.sh
  3. Nemo file manager (see the screenshots at the bottom): https://askubuntu.com/a/1446372/327339
  4. Window snapping: https://askubuntu.com/a/1446690/327339