Bug report for fedora 37 (with wayland, RTX 2060 Rev. 1): x11 works but wayland only provides 1024x768 resolution

This is a bug report for Fedora 37 against nvidia driver 530.30.02 (for CUDA 12.1).

I have run nvidia-bug-report.sh on plasma X11:
nvidia-bug-report.log.gz (366.3 KB)

x11 works but wayland only provides 1024x768 resolution.

$ nvidia-smi 
Mon Apr 10 16:32:47 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.30.02              Driver Version: 530.30.02    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                  Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf            Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 2060         Off| 00000000:01:00.0 Off |                  N/A |
| 30%   33C    P8               11W / 160W|    923MiB /  6144MiB |      1%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A     10542      G   /usr/libexec/Xorg                           328MiB |
|    0   N/A  N/A     11074      G   /usr/bin/ksmserver                            2MiB |
|    0   N/A  N/A     11076      G   /usr/bin/kded5                                2MiB |
|    0   N/A  N/A     11077      G   /usr/bin/kwin_x11                            94MiB |
|    0   N/A  N/A     11113      G   /usr/bin/plasmashell                         19MiB |
|    0   N/A  N/A     11138      G   ...5/polkit-kde-authentication-agent-1        2MiB |
|    0   N/A  N/A     11140      G   /usr/libexec/xdg-desktop-portal-kde           2MiB |
|    0   N/A  N/A     11271      G   /usr/bin/nextcloud                           11MiB |
|    0   N/A  N/A     11329      G   /usr/bin/kaccess                              2MiB |
|    0   N/A  N/A     11337      G   /usr/libexec/DiscoverNotifier                 2MiB |
|    0   N/A  N/A     11339      G   /usr/bin/kalendarac                           2MiB |
|    0   N/A  N/A     11532      G   /usr/bin/akonadi_control                      2MiB |
|    0   N/A  N/A     11622      G   /usr/bin/kwalletd5                            2MiB |
|    0   N/A  N/A     11673      G   /usr/bin/akonadi_akonotes_resource            2MiB |
|    0   N/A  N/A     11674      G   /usr/bin/akonadi_archivemail_agent            2MiB |
|    0   N/A  N/A     11675      G   /usr/bin/akonadi_birthdays_resource           2MiB |
|    0   N/A  N/A     11676      G   /usr/bin/akonadi_contacts_resource            2MiB |
|    0   N/A  N/A     11677      G   .../bin/akonadi_followupreminder_agent        2MiB |
|    0   N/A  N/A     11678      G   /usr/bin/akonadi_ical_resource                2MiB |
|    0   N/A  N/A     11679      G   /usr/bin/akonadi_indexing_agent               2MiB |
|    0   N/A  N/A     11680      G   /usr/bin/akonadi_maildir_resource             2MiB |
|    0   N/A  N/A     11681      G   /usr/bin/akonadi_maildispatcher_agent         2MiB |
|    0   N/A  N/A     11682      G   /usr/bin/akonadi_mailfilter_agent             2MiB |
|    0   N/A  N/A     11683      G   /usr/bin/akonadi_mailmerge_agent              2MiB |
|    0   N/A  N/A     11688      G   /usr/bin/akonadi_migration_agent              2MiB |
|    0   N/A  N/A     11689      G   /usr/bin/akonadi_newmailnotifier_agent        2MiB |
|    0   N/A  N/A     11690      G   /usr/bin/akonadi_sendlater_agent              2MiB |
|    0   N/A  N/A     11691      G   /usr/bin/akonadi_unifiedmailbox_agent         2MiB |
|    0   N/A  N/A     11924      G   ...rker,SpareRendererForSitePerProcess       16MiB |
|    0   N/A  N/A     12075      G   /usr/bin/konsole                              2MiB |
|    0   N/A  N/A     12298      G   /usr/lib64/firefox/firefox                  240MiB |
|    0   N/A  N/A     12440      G   /usr/lib64/thunderbird/thunderbird          134MiB |
|    0   N/A  N/A     12803      G   ...bin/plasma-browser-integration-host        2MiB |
|    0   N/A  N/A     18589      G   dolphin                                       2MiB |
|    0   N/A  N/A     18907      G   /usr/libexec/kf5/kioslave5                    1MiB |
+---------------------------------------------------------------------------------------+

Seems to be because the kernel only knows the 1024x786 resolution:

$ cat /sys/class/drm/card0-Unknown-1/modes
1024x768

I’ve just upgraded to fedora 38. The problem is still there.

A few more words might be in order:

  1. /sys/class/drm/card0-Unknown-1/edid does not contain any edid data
    $ export EDID=`cat /sys/class/drm/card0-Unknown-1/edid`
    $ echo a-${EDID}-b
    a--b
    
  2. But under X11, xrandr --props shows them (see below).
  3. Also nvidia-settings is able to retrieve edid data. In addition, it reports ‘GPU 0 - (NVIDIA GeForce RTX 2060)’ to be connected to ‘DP-0 - (LG Electronics LG HDR 4K)’.
  4. Adding something like vidio=0-Unknown-1:3840x2160@60 to grub in the lines of Add custom resolution and refresh rate when using Wayland is possible. However, it will work for resolutions up to 1920x1080 only, but not for HiDPI (3840x2160) which I require.
  5. Providing an edid file on boot in the lines of Custom mode lines in Wayland - Ricky's Hodgepodge seem to have no effect at all.

Edid details

$ cat /sys/class/drm/card0-Unknown-1/edid | edid-decode 
EDID of 'stdin' was empty.

But xrandr has edid info

$ xrandr --props | edid-decode 
edid-decode (hex):

00 ff ff ff ff ff ff 00 1e 6d 07 77 2d a5 02 00
05 1d 01 04 b5 3c 22 78 9e 3e 31 ae 50 47 ac 27
0c 50 54 21 08 00 71 40 81 80 81 c0 a9 c0 d1 c0
81 00 01 01 01 01 4d d0 00 a0 f0 70 3e 80 30 20
65 0c 58 54 21 00 00 1a 28 68 00 a0 f0 70 3e 80
08 90 65 0c 58 54 21 00 00 1a 00 00 00 fd 00 38
3d 1e 87 38 00 0a 20 20 20 20 20 20 00 00 00 fc
00 4c 47 20 48 44 52 20 34 4b 0a 20 20 20 01 96

02 03 19 71 44 90 04 03 01 23 09 07 07 83 01 00
00 e3 05 c0 00 e3 06 05 01 02 3a 80 18 71 38 2d
40 58 2c 45 00 58 54 21 00 00 1e 56 5e 00 a0 a0
a0 29 50 30 20 35 00 58 54 21 00 00 1a 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.4
  Vendor & Product Identification:
    Manufacturer: GSM
    Model: 30471
    Serial Number: 173357
    Made in: week 5 of 2019
  Basic Display Parameters & Features:
    Digital display
    Bits per primary color channel: 10
    DisplayPort interface
    Maximum image size: 60 cm x 34 cm
    Gamma: 2.20
    DPMS levels: Standby
    Supported color formats: RGB 4:4:4, YCrCb 4:4:4, YCrCb 4:2:2
    Default (sRGB) color space is primary color space
    First detailed timing includes the native pixel format and preferred refresh rate
  Color Characteristics:
    Red  : 0.6796, 0.3154
    Green: 0.2802, 0.6738
    Blue : 0.1523, 0.0498
    White: 0.3125, 0.3291
  Established Timings I & II:
    DMT 0x04:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
    DMT 0x09:   800x600    60.316541 Hz   4:3     37.879 kHz     40.000000 MHz
    DMT 0x10:  1024x768    60.003840 Hz   4:3     48.363 kHz     65.000000 MHz
  Standard Timings:
    GTF     :  1152x864    60.000000 Hz   4:3     53.700 kHz     81.624000 MHz
    DMT 0x23:  1280x1024   60.019740 Hz   5:4     63.981 kHz    108.000000 MHz
    DMT 0x55:  1280x720    60.000000 Hz  16:9     45.000 kHz     74.250000 MHz
    DMT 0x53:  1600x900    60.000000 Hz  16:9     60.000 kHz    108.000000 MHz (RB)
    DMT 0x52:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz
    DMT 0x1c:  1280x800    59.810326 Hz  16:10    49.702 kHz     83.500000 MHz
  Detailed Timing Descriptors:
    DTD 1:  3840x2160   59.996625 Hz  16:9    133.312 kHz    533.250000 MHz (600 mm x 340 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol P
                 Vfront   54 Vsync   5 Vback    3 Vpol N
    DTD 2:  3840x2160   30.000000 Hz  16:9     66.660 kHz    266.640000 MHz (600 mm x 340 mm)
                 Hfront    8 Hsync 144 Hback    8 Hpol P
                 Vfront   54 Vsync   5 Vback    3 Vpol N
    Display Range Limits:
      Monitor ranges (GTF): 56-61 Hz V, 30-135 kHz H, max dotclock 560 MHz
    Display Product Name: 'LG HDR 4K'
  Extension blocks: 1
Checksum: 0x96

----------------

Block 1, CTA-861 Extension Block:
  Revision: 3
  Basic audio support
  Supports YCbCr 4:4:4
  Supports YCbCr 4:2:2
  Native detailed modes: 1
  Video Data Block:
    VIC  16:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz (native)
    VIC   4:  1280x720    60.000000 Hz  16:9     45.000 kHz     74.250000 MHz
    VIC   3:   720x480    59.940060 Hz  16:9     31.469 kHz     27.000000 MHz
    VIC   1:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
  Audio Data Block:
    Linear PCM:
      Max channels: 2
      Supported sample rates (kHz): 48 44.1 32
      Supported sample sizes (bits): 24 20 16
  Speaker Allocation Data Block:
    FL/FR - Front Left/Right
  Colorimetry Data Block:
    BT2020YCC
    BT2020RGB
  HDR Static Metadata Data Block:
    Electro optical transfer functions:
      Traditional gamma - SDR luminance range
      SMPTE ST2084
    Supported static metadata descriptors:
      Static metadata type 1
  Detailed Timing Descriptors:
    DTD 3:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz (600 mm x 340 mm)
                 Hfront   88 Hsync  44 Hback  148 Hpol P
                 Vfront    4 Vsync   5 Vback   36 Vpol P
    DTD 4:  2560x1440   59.950550 Hz  16:9     88.787 kHz    241.500000 MHz (600 mm x 340 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol P
                 Vfront    3 Vsync   5 Vback   33 Vpol N
Checksum: 0x29  Unused space in Extension Block: 66 bytes

Monitor controls are found as well:

$ ddccontrol -p
ddccontrol version 0.5.1
Copyright 2004-2005 Oleg I. Vdovikin (oleg@cs.msu.su)
Copyright 2004-2006 Nicolas Boichat (nicolas@boichat.ch)
This program comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of this program under the terms of the GNU General Public License.

Detected monitors :
 - Device: dev:/dev/i2c-3
   DDC/CI supported: Yes
   Monitor Name: LG GSM770 Display Port
   Input type: Digital
  (Automatically selected)
Reading EDID and initializing DDC/CI at bus dev:/dev/i2c-3...

EDID readings:
        Plug and Play ID: GSM7707 [LG GSM770 Display Port]
        Input type: Analog

= LG GSM770 Display Port
> Color settings
        > Brightness and Contrast
                > id=brightness, name=Brightness, address=0x10, delay=-1ms, type=0
                  supported, value=21, maximum=100
                > id=contrast, name=Contrast, address=0x12, delay=-1ms, type=0
                  supported, value=50, maximum=100
                > id=sharpness, name=Sharpness, address=0x87, delay=-1ms, type=0
                  supported, value=50, maximum=100
        > LG Picture
                > id=lgmode, name=Picture Mode, address=0x15, delay=-1ms, type=2
                  Possible values:
                        > id=reader - name=Reader, value=1
                        > id=custom - name=Custom, value=11
                        > id=srgb - name=sRGB, value=15
                        > id=fps - name=FPS, value=30
                        > id=rts - name=RTS, value=31
                        > id=hdreffect - name=HDR Effect, value=39
                        > id=cinema - name=Cinema, value=48
                        > id=vivid - name=Vivid, value=49
                        > id=dcip3 - name=DCI-P3, value=25
                        > id=ebu - name=EBU, value=22
                        > id=rec709 - name=REC709, value=23
                  supported, value=11, maximum=255
        > Gamma
                > id=gammamode, name=Gamma, address=0xfe, delay=-1ms, type=2
                  Possible values:
                        > id=mode1 - name=Mode 1, value=2
                        > id=mode2 - name=Mode 2, value=3
                        > id=mode3 - name=Mode 3, value=4
                        > id=mode4 - name=Mode 4, value=16
                  supported, value=3, maximum=255
        > Color maximum level
                > id=red, name=Red maximum level, address=0x16, delay=-1ms, type=0
                  supported, value=62, maximum=100
                > id=green, name=Green maximum level, address=0x18, delay=-1ms, type=0
                  supported, value=50, maximum=100
                > id=blue, name=Blue maximum level, address=0x1a, delay=-1ms, type=0
                  supported, value=45, maximum=100
        > Various color settings
                > id=colorpreset, name=Color Preset, address=0x14, delay=-1ms, type=2
                  Possible values:
                        > id=6500k - name=6500K, value=5
                        > id=9300k - name=9300K, value=8
                        > id=user - name=User, value=11
                  supported, value=11, maximum=11
> Position and size
        > Automatic adjustments
                > id=ratio, name=Aspect Ratio, address=0xf5, delay=-1ms, type=2
                  Possible values:
                        > id=1to1 - name=1:1, value=0
                        > id=wide - name=Full Wide, value=1
                        > id=original - name=Original, value=2
                  supported, value=1, maximum=255
> Others
        > Restore defaults
                > id=defaults, name=Restore Factory Defaults, address=0x4, delay=2000ms, type=1
                  Possible values:
                        > id=default - name=Restore Factory Defaults, value=1
                  supported, value=0, maximum=255
                > id=defaultluma, name=Restore Brightness and Contrast, address=0x5, delay=2000ms, type=1
                  Possible values:
                        > id=default - name=Restore Brightness and Contrast, value=1
                  supported, value=0, maximum=1
                > id=defaultcolor, name=Restore Factory Default Color, address=0x8, delay=2000ms, type=1
                  Possible values:
                        > id=default - name=Restore Factory Default Color, value=1
                  supported, value=0, maximum=255
        > Audio
                > id=audiospeakervolume, name=Audio Speaker Volume Adjust, address=0x62, delay=-1ms, type=0
                  supported, value=30, maximum=100
                > id=audiospeakermute, name=Audio Speaker Mute, address=0x8d, delay=-1ms, type=2
                  Possible values:
                        > id=mute - name=Mute, value=1
                        > id=unmute - name=Unmute, value=2
                  supported, value=2, maximum=100
        > OSD
                > id=language, name=Language, address=0xcc, delay=-1ms, type=2
                  Possible values:
                        > id=english - name=English, value=0
                        > id=french - name=Français (French), value=2
                        > id=finnish - name=Suomi (Finnish), value=6
                        > id=german - name=Deutsch (German), value=1
                        > id=italian - name=Italiano (Italian), value=4
                        > id=korean - name=한국어 (Korean), value=16
                        > id=spanish - name=Castellano (Spanish), value=3
                        > id=russian - name=Русский (Russian), value=10
                        > id=swedish - name=Svenska (Swedish), value=5
                        > id=chinese_tw - name=繁體中文 (Traditional Chinese), value=14
                        > id=chinese - name=简体中文 (Simplified Chinese), value=13
                        > id=japanese - name=日本語 (Japanese), value=15
                        > id=polish - name=Polski (Polish), value=9
                        > id=czech - name=Český (Czech), value=11
                        > id=portuguese - name=Português (Portuguese), value=7
                        > id=finnish - name=Suomalainen (Finnish), value=6
                        > id=brazilian - name=Português do Brasil (Brazilian Portuguese), value=8
                        > id=ukrainian - name=українська (Ukrainian), value=12
                  supported, value=0, maximum=255
                > id=osdlock, name=OSD Lock, address=0xeb, delay=-1ms, type=2
                  Possible values:
                        > id=off - name=Off, value=0
                        > id=on - name=On, value=1
                  supported, value=0, maximum=1
        > Power control
                > id=power, name=Power control, address=0xd6, delay=-1ms, type=2
                  Possible values:
                        > id=off - name=Off, value=5
                        > id=on - name=On, value=1
                  supported, value=1, maximum=5
                > id=energysaving, name=Smart Energy Saving, address=0xf6, delay=-1ms, type=2
                  Possible values:
                        > id=off - name=Off, value=0
                        > id=low - name=Low, value=1
                        > id=high - name=High, value=2
                  supported, value=2, maximum=255
        > Game Adjust
                > id=freesync, name=FreeSync, address=0xf8, delay=-1ms, type=2
                  Possible values:
                        > id=off - name=Off, value=0
                        > id=base - name=Base, value=2
                        > id=extended - name=Extended, value=3
                  supported, value=0, maximum=255
                > id=responsetime, name=Response Time, address=0xf7, delay=-1ms, type=2
                  Possible values:
                        > id=off - name=Off, value=0
                        > id=high - name=High, value=1
                        > id=middle - name=Middle, value=2
                        > id=low - name=Low, value=3
                  supported, value=2, maximum=255
$ cat lg.bin | monitor-parse-edid 
Name: LG HDR 4K
EISA ID: GSM7707
EDID version: 1.4
EDID extension blocks: 1
Screen size: 60.0 cm x 34.0 cm (27.15 inches, aspect ratio 16/9 = 1.76)
Gamma: 2.2
Digital signal
Max video bandwidth: 560 MHz

        HorizSync 30-135
        VertRefresh 56-61

        # Monitor preferred modeline (60.0 Hz vsync, 133.3 kHz hsync, ratio 16/9, 162 dpi)
        ModeLine "3840x2160" 533.25 3840 3888 3920 4000 2160 2214 2219 2222 -hsync +vsync

        # Monitor supported modeline (30.0 Hz vsync, 66.7 kHz hsync, ratio 16/9, 162 dpi)
        ModeLine "3840x2160" 266.64 3840 3848 3992 4000 2160 2214 2219 2222 -hsync +vsync

        # Monitor supported CEA modeline (60.0 Hz vsync, 67.5 kHz hsync, ratio 16/9, 81 dpi)
        ModeLine "1920x1080" 148.5 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync

        # Monitor supported CEA modeline (60.0 Hz vsync, 45.0 kHz hsync, ratio 16/9, 54 dpi)
        ModeLine "1280x720" 74.25 1280 1390 1430 1650 720 725 730 750 +hsync +vsync

        # Monitor supported CEA modeline (59.9 Hz vsync, 31.5 kHz hsync, ratio 3/2, 30x35 dpi) (bad ratio)
        ModeLine "720x480" 27 720 736 798 858 480 489 495 525 -hsync -vsync

        # Monitor supported CEA modeline (59.9 Hz vsync, 31.5 kHz hsync, ratio 4/3, 27x35 dpi) (bad ratio)
        ModeLine "640x480" 25.175 640 656 752 800 480 490 492 525 -hsync -vsync

        # Monitor supported modeline (60.0 Hz vsync, 67.5 kHz hsync, ratio 16/9, 81 dpi)
        ModeLine "1920x1080" 148.5 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync

        # Monitor supported modeline (60.0 Hz vsync, 88.8 kHz hsync, ratio 16/9, 108 dpi)
        ModeLine "2560x1440" 241.5 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync

Problem is still present on Fedora 38 with driver 535.86.10, CUDA 12.2 and kernel 6.4.11-200.fc38.x86_64 .