Kubuntu 18.04 gives black screen when SDDM starts (no login)

After upgrading from 17.10 to 18.04 I could only have DE with the Intel gpu. Many options tested in grub like the typical nomodeset.

[url]https://pastebin.com/DuZfv57Z[/url] grub config
[url]https://pastebin.com/26L9sfCE[/url] xorg config

I need a fix soon to could work with the Nvidia GPU and Cuda
nvidia-bug-report.log.gz (108 KB)

Please run nvidia-bug-report.sh as root and attach the resulting .gz file to your post. Hovering the mouse over an existing post will reveal a paperclip icon.

Done, thanks for your help.

It’s an Optimus system with hybrid graphics. Don’t use the .run installer, uninstall it. Use only the drivers from ubuntus graphics ppa. Have the package nvidia-prime installed, remove the ‘nomodeset’ parameter, run sudo prime-select nvidia and reboot.

I am already using the official package provided by Ubuntu repositories (nvidia-driver-390 metapackage that installs all necessary). Nvidia prime it’s installed (I am using Kubuntu in this laptop with nvidia-prime for 2 years). The 'nomodeset" parameter its removed from grub config (I already read your post about blank screen problems). But when I reboot with Nvidia I always get a blank screen when SDDM it’s launched.

Ok, but your xorg.conf is still one generated by nvidia-xsetup which doesn’t fit. It should have been overwritten by gpumanager. Please check if the package ubuntu-drivers-common is installed.
Otherwise, you can use the xorg.conf from ths post:
https://devtalk.nvidia.com/default/topic/1022670/linux/official-driver-384-59-with-geforce-1050m-doesn-t-work-on-opensuse-tumbleweed-kde/post/5203910/#5203910
Then, the file /usr/share/sddm/scripts/Xsetup has to contain

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

ubuntu-drivers-common already installed

#!/bin/sh
# Xsetup - run as root before the login dialog appears

if [ -e /sbin/prime-offload ]; then
    echo running NVIDIA Prime setup /sbin/prime-offload
    /sbin/prime-offload
fi

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

It’s correct the Xsetup like that?

Yes, the file /sbin/prime-offload should contain the same commands.

If I understand well that code, it’s not enough to put that two commands in the prime-offload? (I mean that its not necessary in Xsetup if we write it in prime-offload)

Misunderstanding. The file prime-offload should already contain that before.

Then if now my Xsetup it’s ok, I only had to change the xorg.conf that I generated with nvidia-xconfig for the one you said. But it worries me that it have references to other monitors with different resolutions than mine. Could I proceed anyway?

Section "ServerLayout"
    Identifier     "layout"
    Screen      0  "nvidia" 0 0
    Inactive       "intel"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    Modeline "1280x720_60.00"  74.48  1280 1336 1472 1664  720 721 724 746  -HSync +Vsync
EndSection

Section "Device"
    Identifier     "intel"
    Driver         "modesetting"
    Option         "AccelMethod" "none"
    BusID          "PCI:0:2:0"
EndSection

Section "Device"
    Identifier     "nvidia"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
    Identifier     "nvidia"
    Device         "nvidia"
    Monitor        "Monitor0"
    SubSection     "Display"
        Virtual     1920 1080
    EndSubSection
EndSection

I was thinking that maybe I had an automatic copy of my xorg.conf when upgraded (the one that worked well before), and it was there, so I did a test with that one and worked!. So I will write down here the change and configuration that made work again my Nvidia in a laptop with Optimus.

Added lines 9 and 10 to usr/share/sddm/scripts/Xsetup:

#!/bin/sh
# Xsetup - run as root before the login dialog appears

if [ -e /sbin/prime-offload ]; then
    echo running NVIDIA Prime setup /sbin/prime-offload
    /sbin/prime-offload
fi

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

My working xorg.conf:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection

Thank you very much generix, now I could properly work again in Blender and my CAD software.