Black screen reboot Ubuntu 23.04

BRRG Posted messages 1129 Registration date   Status Member Last intervention   -  
mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   -

Hello, after installing version 23.04. The installation was complicated because in normal mode, it crashed on the USB stick, I had to switch to "safe graphics" mode for Ubuntu 23.04 to install in dual boot on an Asus Zephyrus GM501GS.

When I go into recovery mode, everything goes fine until resume. The program that launches the keyboard RGB works well since the RGB lights up properly. However, there is a white line flashing in the top left corner, to proceed, I press the on/off button, information scrolls by with OK in green (impossible to read everything and then the PC shuts down). I saw online that some say to use the nomodeset command but I hesitate to do it.

What I noticed in the Ubuntu settings is that before I only had my Intel graphics card detected and now I have the Intel + the larger one which is an Nvidia.

Have you ever encountered this problem and found a solution to fix it?

4 answers

  1. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 942
     

    Hello,

    What do you mean by the RGB of the keyboard?

    Problem Explanation

    Based on what you describe, the graphical server (xorg) crashes because the loaded graphics driver fails. We need to look at the errors in a bit more detail to identify which driver you are using and reinstall it properly.

    Basically, there are two drivers for NVIDIA cards:

    • the nouveau driver (open-source)
    • the nvidia driver (proprietary but more performant).

    There’s nothing stopping you from installing both: in this case, it’s the nvidia driver that takes precedence.

    Regarding the NVIDIA driver, you need to be cautious about the installed version, as there are several versions available (as demonstrated on this page). The issue is that the latest drivers tend to no longer support older NVIDIA cards. Therefore, the installed nvidia driver must support your model of NVIDIA card; otherwise, you'll end up with a black screen.

    To see which NVIDIA driver supports which card, you need to take the time to check the NVIDIA site. The previous link lists all existing NVIDIA drivers for Linux 64-bit. Click on a driver to see which products are supported, (for example here for driver 470).

    In your case, the nvidia driver is installed but not in a version that supports your NVIDIA card model. The nouveau driver is likely also installed, but since the nvidia driver takes precedence, the graphical server crashes anyway.

    How to Resolve the Problem

    Since the graphical mode is broken, you will need to repair it by going through text mode (ctrl alt f2). You should then have the opportunity to type your login (then enter) and your password blind (then enter). If all goes well, you should see a command prompt like this:

     login@machine:~$

    It is at such a prompt that we will be able to type a command (and as you will see below, there will be several to type!).

    From there, two approaches are possible, depending on what you want to do:

    • Approach 1: either you remove the nvidia driver and keep only the nouveau driver, and normally everything should return to normal upon the next reboot
    sudo apt update sudo apt install xserver-xorg-video-nouveau sudo apt purge $(dpkg -l | cut -d" " -f3 | grep nvidia) sudo reboot
    • Approach 2: or you can install the correct nvidia driver, and everything should return to normal upon the next reboot. Since this depends on the exact model of your card, to tell you more, you'll need to report the result of:
    lspci | grep -i nvidia

    However, be careful: to properly execute this second approach, you should install the driver via apt whenever possible. You only download the NVIDIA driver from the NVIDIA site if there is no other choice.

    Let's assume that driver 470 is the latest version that supports your NVIDIA card:

    sudo apt update sudo apt install xserver-xorg-video-nvidia-470 sudo reboot

    Good luck

    0
    1. BRRG Posted messages 1129 Registration date   Status Member Last intervention   4
       

      Hello, what I call the RGB is the multi-color backlighting of the keyboard.

      I have the boot-info if that can help: https://paste.ubuntu.com/p/d6kmmqHBXg/

       lspci | grep -i nvidia 01:00.0 VGA compatible controller: NVIDIA Corporation GP104M [GeForce GTX 1070 Mobile] (rev a1) 01:00.1 Audio device: NVIDIA Corporation GP104 High Definition Audio Controller (rev a1) 

      Since I have a graphics card, shouldn't I use it?

      Also, is it not possible to start on the Intel graphics card and only use the NVIDIA when needed?

      0
    2. BRRG Posted messages 1129 Registration date   Status Member Last intervention   4
       

      Before, I had the black screen with the dash when I went into recovery mode.

      I must have done something silly, because now every time the PC starts, I land on it.

      0
  2. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 942
     

    Hello

    What I call RGB is the multi-color backlighting of the keyboard

    The keyboard is an independent consideration from your graphics card. I have no idea how it is managed under Linux, but if you have questions about it, you should address it in a new discussion.

     NVIDIA Corporation GP104M

    This is the important information. Now you need to check (if you want to use the nvidia driver instead of nouveau). Apparently, the GP100 series is supported by driver 535 (see this link), which means that in your case, you can install the corresponding package.

    sudo apt update sudo apt install xserver-xorg-video-nvidia-535

    Having a graphics card, I might as well use it, right?

    Yes, but as I mentioned in my previous message, you have a choice between two drivers for your NVIDIA card: the nouveau driver and the nvidia driver. And at worst, if you can't figure it out, you can always fall back on your Intel card. In any case, unless you are using your GPU under Linux (for a 3D game or because you are doing machine learning), you don’t really need your NVIDIA card; you can perfectly stay on the Intel card which consumes less power.

    Before, I had a black screen with a dash when I went into recovery mode.

    I must have done something wrong; now I end up there every time the PC starts.

    As mentioned above, it's probably because the driver (in my opinion, an NVIDIA driver) currently loaded is incorrectly installed and/or does not properly support your hardware. Therefore, you need to reinstall the correct driver or use your Intel card. It's also possible that you have secure boot enabled, but the nvidia driver is not signed, which prevents it from loading (I don't know to what extent this problem occurs under Ubuntu, but it can clearly happen under Debian, from which Ubuntu is derived). In short, there are multiple possible explanations.

    One advantage of the nouveau driver is that it works directly (no need to sign it), but it is only loaded if there is no trace of the NVIDIA driver (see approach 1 in my previous message).

    To be sure of what I'm saying, we need to check the errors logged by xorg. What do the following commands give?

    grep EE /var/log/Xorg.0.log
    sudo modprobe nvidia sudo dmesg | tail

    Good luck

    0
    1. BRRG Posted messages 1129 Registration date   Status Member Last intervention   4
       

      Hello

      • Here's what I get after the command:
       $ sudo apt install xserver-xorg-video-nvidia-535 ​​​​​​​xserver-xorg-video-nvidia-535 is already the latest version (535.86.05-0ubuntu0.22.04.1).
      • Regarding secure boot, on my PC, it is disabled, so I need to enable it.
      • Regarding the command grep EE /var/log/Xorg.0.log
       $ grep EE /var/log/Xorg.0.log [    28.308] Current Operating System: Linux asus-zephyrus 6.2.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64     (WW) warning, (EE) error, (NI) not implemented, (??) unknown. [    28.320] (EE) open /dev/dri/card0: No such file or directory [    28.320] (EE) open /dev/dri/card0: No such file or directory [    28.321] (EE) Unable to find a valid framebuffer device [    28.321] (EE) Screen 0 deleted because of no matching config section. [    28.321] (EE) Screen 0 deleted because of no matching config section. [    28.326] (II) Initializing extension MIT-SCREEN-SAVER
      • Regarding the other commands:
       $ sudo modprobe nvidia $ sudo dmesg | tail [   31.983140] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.006194] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.006313] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.006371] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.006423] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.048900] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.049026] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.049095] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   32.049160] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership [   39.676170] audit: type=1326 audit(1692720777.313:83): auid=1000 uid=1000 gid=1000 ses=3 subj=snap.snap-store.ubuntu-software pid=3183 comm="pool-org.gnome." exe="/snap/snap-store/959/usr/bin/snap-store" sig=0 arch=c000003e syscall=93 compat=0 ip=0x7fbfea93fc4b code=0x50000

      After some thought, I think it would be best to use the Intel card by default and have the NVIDIA card take over if needed.

      0
  3. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 942
     

    Hello,

    As I suspected, you have the nvidia driver and it's causing crashes. This error is discussed in this thread (I haven't seen any real solution apart from freeavagames' response). This solution doesn't seem correct from a distance. All of this makes sense only if you want to get the nvidia driver working.

    If you think you can make do with your Intel card and/or the nouveau driver, just uninstall (approach 1 from my message #1) all packages related to nvidia, directly or indirectly, and reboot:

    sudo apt update sudo apt install xserver-xorg-video-nouveau sudo apt purge $(dpkg -l | cut -d" " -f3 | grep nvidia) sudo reboot

    Good luck

    0
    1. BRRG Posted messages 1129 Registration date   Status Member Last intervention   4
       

      this answer :

      freeavagames

      1

      Dec 11

      Ubuntu 22.04.1 Nvidia 525.60.11 Kernel: 5.15.0-56-generic )

      I have the line “options nvidia-drm modeset=1” in three files:

      grep --include=*.conf -rnw ‘/’ -e “nvidia-drm” 2>/dev/null

      “/usr/lib/modprobe.d/nvidia-kms.conf:3:options nvidia-drm modeset=1
      “/etc/modprobe.d/nvidia-graphics-drivers-kms.conf:3:options nvidia-drm modeset=1
      “/etc/modprobe.d/nvidia-nomodset.conf:1:options nvidia-drm modeset=1

      If the lines are commented out, the error message disappears.
      If you leave this uncommented in at least one of the files, the error message will appear again.

      After thinking it over, I would like to use 2 or 3 screens so the Nvidia is probably important.

      I don't know how to set it up but I think the ideal would be to boot according to need.

      0
    2. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 942 > BRRG Posted messages 1129 Registration date   Status Member Last intervention  
       

      Yes, this answer. However, it's rather the second link that seems relevant to me. Regarding multi-monitor setup, if your graphics cards are properly installed, it should work without too much difficulty. However, if you plan to use HDMI, you may need to install the nvidia driver.

      0
    3. BRRG Posted messages 1129 Registration date   Status Member Last intervention   4 > mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention  
       

      I tried the lines as mentioned by the person

       ( Ubuntu 22.04.1 Nvidia 525.60.11 Kernel: 5.15.0-56-generic ) I have the line “options nvidia-drm modeset=1” in three files: grep --include=*.conf -rnw ‘/’ -e “nvidia-drm” 2>/dev/null “/usr/lib/modprobe.d/nvidia-kms.conf:3:options nvidia-drm modeset=1” “/etc/modprobe.d/nvidia-graphics-drivers-kms.conf:3:options nvidia-drm modeset=1” “/etc/modprobe.d/nvidia-nomodset.conf:1:options nvidia-drm modeset=1” If the lines are commented out, the error message disappears. If you leave this uncommented in at least one of the files, the error message will appear again.

      The result, nothing changes, I had to create the last files because they were not present and add the command line "options nvidia-drm modeset=1"

      Yes, it's HDMI but I also use the Asus HZ-3B docking station to have triple screens

      0
    4. BRRG Posted messages 1129 Registration date   Status Member Last intervention   4 > mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention  
       

      I made the modification to the file following the provided link, after going into recovery mode and summarizing, it still shows the fixed dash and after 20 seconds it starts blinking and stays stuck on that.

      Everything I did before, I deleted it.

      0
    5. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 942 > BRRG Posted messages 1129 Registration date   Status Member Last intervention  
       

      Hmm, in that case, I'm not sure what to tell you. If you've installed your nvidia driver as explained in message #5, since it seems to support your card, everything should work. You might try a different nvidia driver (a lower version by installing the appropriate xserver-xorg-video-nvidia package and removing the current one from your package manager, then rebooting).

      If no nvidia driver works, I don't see where the issue comes from. You should check what it says:

      grep EE /var/log/Xorg.0.log modprobe nvidie dmesg | tail

      If the problem persists, too bad, just stick to the old one (approach 1).

      Good luck

      0
  4. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 942
     

    Hello

    In response to message #15 (thank you for the details!):

    • According to what is written here, if it works with nomodeset instead of quiet splash, that’s definitely better. But this concerns grub (the boot menu), and at this stage, the X server or the nvidia/nouveau driver have not yet been loaded. These are therefore two different considerations. However, indeed, if you have a splash screen and for some reason, it is poorly supported by your installation, then you will have problems before reaching the graphical mode. That’s what you described happened to you.
    • If you want to make this change permanent, you need to correct (as root or with sudo) the file /etc/default/grub and inside it the line:
      GRUB_CMDLINE_LINUX=""
      to:
       GRUB_CMDLINE_LINUX="nomodeset"
      Normally, you don't need to change the variable GRUB_CMDLINE_LINUX_DEFAULT. Then save, exit, and run:
      sudo update-grub

    Good luck

    0