HP Omen 15 [Ryzen 4600h + Nvidia 1660Ti] - no display over HDMI

Hi,

Recently bought the HP Omen 15 with Ryzen 4600h and NVidia 1660 Ti. The inbuilt AMD graphics as well as display are working as expected. However the HDMI output connected to NVidia GPU does not work.

Using Ubuntu 20.04 with Linux 5.8. Installed Nvidia driver using sudo apt install nvidia-driver-455 and rebooted. Trying to connect display over HDMI, it shows the monitor in diplay settings but does not work (black screen).

There is an error in dmesg:

[   24.379439] ------------[ cut here ]------------
[   24.379443] Unhandled error in __nv_drm_gem_user_memory_handle_vma_fault: -22
[   24.379481] WARNING: CPU: 2 PID: 1504 at /var/lib/dkms/nvidia/455.38/build/nvidia-drm/nvidia-drm-gem-user-memory.c:131 __nv_drm_gem_user_memory_handle_vma_fault+0x92/0xa0 [nvidia_drm]
[   24.379481] Modules linked in: rfcomm ccm cmac algif_hash algif_skcipher af_alg usbhid bnep btusb btrtl btbcm btintel bluetooth ecdh_generic xpad ecc ff_memless amdgpu snd_soc_dmic snd_acp3x_pdm_dma snd_acp3x_rn snd_soc_core snd_compress iommu_v2 ac97_bus gpu_sched snd_pcm_dmaengine ttm snd_rn_pci_acp3x i2c_algo_bit snd_pci_acp3x nvidia_uvm(OE) uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev nvidia_drm(POE) nvidia_modeset(POE) mc nvidia(POE) binfmt_misc snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi nls_iso8859_1 snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core edac_mce_amd kvm_amd snd_hwdep snd_pcm ccp iwlmvm joydev kvm mac80211 crct10dif_pclmul snd_seq_midi ghash_clmulni_intel snd_seq_midi_event libarc4 snd_rawmidi aesni_intel drm_kms_helper snd_seq crypto_simd iwlwifi cec cryptd input_leds glue_helper rc_core snd_seq_device fb_sys_fops rapl hp_wmi syscopyarea hid_multitouch snd_timer serio_raw cfg80211
[   24.379525]  sparse_keymap sysfillrect wmi_bmof efi_pstore ucsi_ccg k10temp snd sysimgblt soundcore ucsi_acpi typec_ucsi typec mac_hid acpi_tad sch_fq_codel parport_pc ppdev lp parport drm ip_tables x_tables autofs4 hid_generic nvme ahci crc32_pclmul sdhci_pci libahci i2c_piix4 nvme_core r8169 cqhci xhci_pci sdhci realtek xhci_pci_renesas i2c_nvidia_gpu wmi video i2c_hid hid
[   24.379562] CPU: 2 PID: 1504 Comm: Xorg Tainted: P        W  OE     5.8.0-33-lowlatency #36~20.04.1-Ubuntu
[   24.379563] Hardware name: HP OMEN Laptop 15-en0xxx/8786, BIOS F.07 09/16/2020
[   24.379568] RIP: 0010:__nv_drm_gem_user_memory_handle_vma_fault+0x92/0xa0 [nvidia_drm]
[   24.379571] Code: bc 00 01 00 00 44 89 e0 41 5c 5d c3 0f 0b 89 c2 48 c7 c6 a0 b6 70 c0 48 c7 c7 e8 b8 70 c0 c6 05 8b 5b 00 00 01 e8 f3 b5 f9 c1 <0f> 0b eb ca 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89
[   24.379573] RSP: 0018:ffff99bfc089ba80 EFLAGS: 00010282
[   24.379575] RAX: 0000000000000000 RBX: ffff99bfc089bb18 RCX: 0000000000000027
[   24.379575] RDX: 0000000000000027 RSI: 0000000000000086 RDI: ffff8a215f698cd8
[   24.379576] RBP: ffff99bfc089ba88 R08: ffff8a215f698cd0 R09: 000000000000054d
[   24.379577] R10: 000000000001c180 R11: 0000000000000004 R12: 0000000000000002
[   24.379577] R13: ffff8a2118dd4680 R14: 00000000000005d0 R15: ffff8a2118dd4680
[   24.379579] FS:  00007f717d52da80(0000) GS:ffff8a215f680000(0000) knlGS:0000000000000000
[   24.379580] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   24.379580] CR2: 000055ae3112aa70 CR3: 00000003ec89c000 CR4: 0000000000340ee0
[   24.379581] Call Trace:
[   24.379595]  nv_drm_vma_fault+0x2b/0x40 [nvidia_drm]
[   24.379602]  __do_fault+0x3e/0xd0
[   24.379607]  ? set_page_dirty+0x61/0xc0
[   24.379608]  do_fault+0x399/0x4d0
[   24.379611]  __handle_mm_fault+0x56c/0x960
[   24.379613]  handle_mm_fault+0xd4/0x200
[   24.379615]  __get_user_pages+0x2c5/0x880
[   24.379618]  __gup_longterm_locked+0x15f/0x210
[   24.379626]  ? sysvec_apic_timer_interrupt+0x46/0x90
[   24.379628]  get_user_pages+0x3c/0x50
[   24.379904]  os_lock_user_pages+0xb6/0x1b0 [nvidia]
[   24.380066]  _nv000635rm+0x7a/0xf0 [nvidia]
[   24.380072] WARNING: kernel stack frame pointer at 00000000f850960b in Xorg:1504 has bad value 00000000de6825d6
[   24.380074] unwind stack type:0 next_sp:0000000000000000 mask:0x2 graph_idx:0
[   24.380076] 0000000029f8b7ee: ffff99bfc089ba98 (0xffff99bfc089ba98)
[   24.380078] 00000000371f3263: ffffffffc070734b (nv_drm_vma_fault+0x2b/0x40 [nvidia_drm])
[   24.380079] 000000000256e380: ffff99bfc089bac0 (0xffff99bfc089bac0)
[   24.380080] 000000004c9610d8: ffffffff82884a6e (__do_fault+0x3e/0xd0)
[   24.380082] 00000000e5dbee45: ffffffff82852231 (set_page_dirty+0x61/0xc0)
[   24.380082] 0000000056e874b2: ffff99bfc089bb18 (0xffff99bfc089bb18)
[   24.380083] 00000000dd290b02: 0000000000000001 (0x1)
[   24.380084] 00000000cdc5b34c: ffff99bfc089baf8 (0xffff99bfc089baf8)
[   24.380085] 000000005e606a44: ffffffff8288a769 (do_fault+0x399/0x4d0)
[   24.380085] 00000000463ba09f: 0000000000000001 (0x1)
[   24.380086] 00000000b1a29867: 0400000000000080 (0x400000000000080)
[   24.380087] 0000000053a61288: 00007f7117418000 (0x7f7117418000)
[   24.380087] 00000000e3d6d76e: 00000000000005d0 (0x5d0)
[   24.380088] 00000000127ffd11: ffff8a2118dd4680 (0xffff8a2118dd4680)
[   24.380089] 00000000820635c8: ffff99bfc089bba8 (0xffff99bfc089bba8)
[   24.380090] 00000000460d68ff: ffffffff8288d56c (__handle_mm_fault+0x56c/0x960)
[   24.380091] 000000002ecba9fb: 00007f7117418000 (0x7f7117418000)
[   24.380091] 000000000a22b301: ffff8a212daed940 (0xffff8a212daed940)
[   24.380092] 000000005f4a2de8: ffff8a2118dd4680 (0xffff8a2118dd4680)
[   24.380093] 0000000065a8dcac: 00100cca00000001 (0x100cca00000001)
[   24.380093] 000000006697fe5f: 0000000000100001 (0x100001)
[   24.380094] 0000000064b238db: 00007f7117418000 (0x7f7117418000)
[   24.380095] 00000000f3da9fc6: ffff8a212d39c5d0 (0xffff8a212d39c5d0)
[   24.380095] 000000002d7fedfc: ffff8a212cb72e20 (0xffff8a212cb72e20)
[   24.380096] 00000000dfb2cba1: 0000000000000000 ...
[   24.380096] 0000000030fe71f2: c388b71ac21ec600 (0xc388b71ac21ec600)
[   24.380097] 00000000545bd096: 0000000000000000 ...
[   24.380097] 000000008176cdf0: 0000000000000001 (0x1)
[   24.380098] 00000000770ce2a0: ffff8a2118dd4680 (0xffff8a2118dd4680)
[   24.380098] 00000000c187c84d: 00007f7117418000 (0x7f7117418000)
[   24.380099] 0000000089e1727d: 0000000000000001 (0x1)
[   24.380100] 000000006b524308: ffff99bfc089bbd8 (0xffff99bfc089bbd8)
[   24.380101] 00000000c51ea54a: ffffffff8288da34 (handle_mm_fault+0xd4/0x200)
[   24.380101] 00000000865e9aaf: 0000000000000207 (0x207)
[   24.380102] 00000000a47212de: 0000000000000001 (0x1)
[   24.380102] 000000003a394ae9: 0000000000000000 ...
[   24.380103] 000000002ebf621d: ffff8a2118dd4680 (0xffff8a2118dd4680)
[   24.380104] 0000000004b78f65: ffff99bfc089bc80 (0xffff99bfc089bc80)
[   24.380105] 000000000e4bb322: ffffffff82881d85 (__get_user_pages+0x2c5/0x880)
[   24.380105] 000000000b8e56a2: ffffffff00000207 (0xffffffff00000207)
[   24.380106] 0000000020166ca0: ffff8a212daed940 (0xffff8a212daed940)
[   24.380107] 00000000da99faee: ffff8a212f84a6c0 (0xffff8a212f84a6c0)
[   24.380107] 0000000057be1c14: ffff8a212f84a6c0 (0xffff8a212f84a6c0)
[   24.380108] 00000000db0d2d3b: ffff8a212f84a6c0 (0xffff8a212f84a6c0)
[   24.380108] 000000003a80f48e: ffff8a212f84a6c0 (0xffff8a212f84a6c0)
[   24.380109] 0000000064e0ecd5: ffff8a21132f4008 (0xffff8a21132f4008)
[   24.380109] 00000000b2490d0b: 0000000000000000 ...
[   24.380110] 00000000f6963a80: 00000000000007e8 (0x7e8)
[   24.380111] 00000000d3f4b3b7: 00007f7117418000 (0x7f7117418000)
[   24.380111] 00000000007badcc: 0000000000000000 ...
[   24.380112] 000000003fc9923d: c388b71ac21ec600 (0xc388b71ac21ec600)
[   24.380112] 000000006b309100: ffff8a21132f4008 (0xffff8a21132f4008)
[   24.380113] 0000000005d49c96: ffff8a212f84a6c0 (0xffff8a212f84a6c0)
[   24.380113] 00000000fa93d3be: 0000000000000000 ...
[   24.380114] 00000000348f290d: ffff8a212daed940 (0xffff8a212daed940)
[   24.380114] 00000000ae05cc2a: ffff99bfc089bcd8 (0xffff99bfc089bcd8)
[   24.380115] 000000005e52b224: ffffffff82882c8f (__gup_longterm_locked+0x15f/0x210)
[   24.380116] 000000007a3467ff: 0000000000000000 ...
[   24.380118] 000000003f1ca3fe: ffffffff83182816 (sysvec_apic_timer_interrupt+0x46/0x90)
[   24.380118] 00000000ffecd4a7: 0000000000003f50 (0x3f50)
[   24.380119] 00000000d0aaf73e: 00000000000007e9 (0x7e9)
[   24.380119] 0000000039fcc56d: 0000000000000001 (0x1)
[   24.380120] 00000000ffd047fd: 0000000000000000 ...
[   24.380120] 0000000000ff392f: 00007f7117417000 (0x7f7117417000)
[   24.380121] 000000008a6d62df: ffff8a212c94afd8 (0xffff8a212c94afd8)
[   24.380122] 0000000083e0a1b6: ffff99bfc089bcf0 (0xffff99bfc089bcf0)
[   24.380123] 00000000a4293014: ffffffff82882d7c (get_user_pages+0x3c/0x50)
[   24.380123] 00000000b2f31c4d: 0000000000000003 (0x3)
[   24.380124] 00000000185c9432: ffff99bfc089bd40 (0xffff99bfc089bd40)
[   24.380268] 00000000dac3e63e: ffffffffc12178c6 (os_lock_user_pages+0xb6/0x1b0 [nvidia])
[   24.380269] 00000000292549d6: ffff8a212daed9b8 (0xffff8a212daed9b8)
[   24.380270] 00000000bd890314: ffff8a21132f4008 (0xffff8a21132f4008)
[   24.380270] 00000000798e7220: c388b71ac21ec600 (0xc388b71ac21ec600)
[   24.380271] 000000002d77ef8f: ffff8a215108f440 (0xffff8a215108f440)
[   24.380272] 00000000944bbf7e: 00007f7117417000 (0x7f7117417000)
[   24.380272] 0000000082e21cbd: 00000000000007e9 (0x7e9)
[   24.380273] 000000003daf9f2b: ffff8a21523ec400 (0xffff8a21523ec400)
[   24.380273] 00000000cbd2595d: 000000000000004a (0x4a)
[   24.380274] 00000000f850960b: ffff8a212c94afd0 (0xffff8a212c94afd0)
[   24.380367] 0000000004e63afe: ffffffffc1a05f8a (_nv000635rm+0x7a/0xf0 [nvidia])
[   24.380616] 0000000027999663: ffffffffc2aba2c0 (nv_kthread_q+0x40/0xfffffffffeffbd80 [nvidia])
[   24.380623] 00000000d87e636c: ffff8a215108f440 (0xffff8a215108f440)
[   24.380623] 0000000045ed5d41: ffff8a21523ec400 (0xffff8a21523ec400)
[   24.380782] 00000000f3ed22cf: ffffffffc1a0670c (_nv000710rm+0x70c/0x880 [nvidia])
[   24.380788] 00000000c396ee4d: ffff8a212c94aff0 (0xffff8a212c94aff0)
[   24.380791] 00000000718d96f1: ffff8a212c948000 (0xffff8a212c948000)
[   24.380922] 00000000644b20a1: ffffffffc2aba2c0 (nv_kthread_q+0x40/0xfffffffffeffbd80 [nvidia])
[   24.380925] 000000008bdbec74: ffff99bfc089bed0 (0xffff99bfc089bed0)
[   24.380927] 00000000ba94cad2: ffff8a21523ec400 (0xffff8a21523ec400)
[   24.381082] 00000000a2391af2: ffffffffc1a10914 (rm_ioctl+0x54/0xb0 [nvidia])
[   24.381086] 00000000aa9c44d1: 000000b800000008 (0xb800000008)
[   24.381089] 0000000026cb6aea: ffff8a215108f440 (0xffff8a215108f440)
[   24.381093] 0000000045ca436e: 00000000007e9000 (0x7e9000)
[   24.381095] 00000000173cc9a8: 00000000000005e0 (0x5e0)
[   24.381100] 00000000cd893b9b: 00007f7100000b7c (0x7f7100000b7c)
[   24.381102] 00000000d1a1966a: 000f41ffc8fab7c0 (0xf41ffc8fab7c0)
[   24.381105] 0000000053581f76: 000f4200b765dfc0 (0xf4200b765dfc0)
[   24.381107] 000000003ed3d3e5: 000f4200b765dfc0 (0xf4200b765dfc0)
[   24.381110] 00000000d91ac378: 000f420040304bc0 (0xf420040304bc0)
[   24.381112] 00000000971f4978: 0000000000000000 ...
[   24.381115] 00000000a2e8107b: 0000000000000200 (0x200)
[   24.381117] 000000005ac254bd: 0000002000000002 (0x2000000002)
[   24.381120] 00000000b56b7f1d: 00000000000005e0 (0x5e0)
[   24.381122] 000000000eb31c72: 0000000000000000 ...
[   24.381124] 000000007912af38: ffff99bfc089be00 (0xffff99bfc089be00)
[   24.381129] 000000004f4c63cd: ffffffff82901901 (__check_object_size+0x81/0x150)
[   24.381131] 0000000014e8af46: ffff8a215108f440 (0xffff8a215108f440)
[   24.381134] 0000000064c82500: 00000000000000b8 (0xb8)
[   24.381136] 0000000050be8af6: ffff8a21523ec400 (0xffff8a21523ec400)
[   24.381264] 000000004ab9633f: ffffffffc2aba2c0 (nv_kthread_q+0x40/0xfffffffffeffbd80 [nvidia])
[   24.381267] 00000000f03299f1: 0000000000000000 ...
[   24.381418] 00000000bb3b0b56: ffffffffc120b7f5 (nvidia_ioctl+0x5f5/0x8f0 [nvidia])
[   24.381435] 00000000d227e76e: ffff8a212c948000 (0xffff8a212c948000)
[   24.381436] 0000000030f1fe7c: 00007ffee4585910 (0x7ffee4585910)
[   24.381436] 00000000ff07563d: ffff8a21523ec448 (0xffff8a21523ec448)
[   24.381437] 0000000022f742af: 00007ffe0000004a (0x7ffe0000004a)
[   24.381437] 00000000764c0d53: ffff99bfc089bec0 (0xffff99bfc089bec0)
[   24.381440] 000000006427aa70: ffffffff8292efda (__fget_files+0x6a/0x90)
[   24.381441] 00000000314e1520: c388b71ac21ec600 (0xc388b71ac21ec600)
[   24.381441] 000000001983662f: ffff8a215999d101 (0xffff8a215999d101)
[   24.381442] 00000000c4bf7923: 00000000fffffdfd (0xfffffdfd)
[   24.381442] 000000007bed97f5: 00000000c0b8464a (0xc0b8464a)
[   24.381443] 00000000bcb6bf96: 00007ffee4585910 (0x7ffee4585910)
[   24.381444] 000000007a58983a: 000000000000000f (0xf)
[   24.381444] 0000000029f987e5: ffff99bfc089bee0 (0xffff99bfc089bee0)
[   24.381590] 00000000fc186c2c: ffffffffc120707b (nvidia_frontend_unlocked_ioctl+0x3b/0x50 [nvidia])
[   24.381594] 000000000e031818: ffff99bfc089bf20 (0xffff99bfc089bf20)
[   24.381599] 0000000024f58d81: ffffffff829229ad (ksys_ioctl+0x9d/0xd0)
[   24.381602] 00000000a3404fad: ffff8a215999d100 (0xffff8a215999d100)
[   24.381605] 00000000ca09da53: 0000000000000000 ...
[   24.381612] 0000000058d9b2c7: ffff99bfc089bf58 (0xffff99bfc089bf58)
[   24.381614] 00000000e71901ef: 0000000000000000 ...
[   24.381617] 000000007d5c1771: ffff99bfc089bf30 (0xffff99bfc089bf30)
[   24.381620] 0000000020f0fc41: ffffffff829229fa (__x64_sys_ioctl+0x1a/0x20)
[   24.381622] 00000000c9ac9039: ffff99bfc089bf48 (0xffff99bfc089bf48)
[   24.381626] 000000000ae1e648: ffffffff8317f6c9 (do_syscall_64+0x49/0xc0)
[   24.381629] 00000000356ae0c3: 0000000000000000 ...
[   24.381633] 00000000d4689d76: ffffffff8320008c (entry_SYSCALL_64_after_hwframe+0x44/0xa9)
[   24.381636] 0000000073723100: 000000000000004a (0x4a)
[   24.381638] 000000005e6102ab: 00000000000000b8 (0xb8)
[   24.381640] 00000000b5853e82: 00000000c0b8464a (0xc0b8464a)
[   24.381643] 000000009f50b133: 00007ffee4585924 (0x7ffee4585924)
[   24.381645] 00000000f48532d2: 00007ffee4585910 (0x7ffee4585910)
[   24.381648] 00000000c88492a0: 000000005ff53707 (0x5ff53707)
[   24.381651] 0000000082ce3f26: 0000000000000246 (0x246)
[   24.381653] 000000000d387060: 0000000000000001 (0x1)
[   24.381655] 00000000f06ca2ee: 00007ffee4585924 (0x7ffee4585924)
[   24.381658] 000000004003cd54: 00007ffee4585910 (0x7ffee4585910)
[   24.381662] 00000000c7669d98: ffffffffffffffda (0xffffffffffffffda)
[   24.381664] 00000000791fa53f: 00007f717d88d50b (0x7f717d88d50b)
[   24.381667] 00000000120e7ee3: 00007ffee4585910 (0x7ffee4585910)
[   24.381669] 00000000642c4ce1: 00000000c0b8464a (0xc0b8464a)
[   24.381672] 000000004baefb1b: 000000000000000f (0xf)
[   24.381674] 000000002188c6c4: 0000000000000010 (0x10)
[   24.381676] 0000000089ff23fb: 00007f717d88d50b (0x7f717d88d50b)
[   24.381679] 000000009fe0bcd8: 0000000000000033 (0x33)
[   24.381681] 00000000a9820875: 0000000000000246 (0x246)
[   24.381684] 00000000f77839fa: 00007ffee45857a8 (0x7ffee45857a8)
[   24.381686] 00000000acf06f26: 000000000000002b (0x2b)
[   24.381845]  ? _nv000710rm+0x70c/0x880 [nvidia]
[   24.382007]  ? rm_ioctl+0x54/0xb0 [nvidia]
[   24.382018]  ? __check_object_size+0x81/0x150
[   24.382172]  ? nvidia_ioctl+0x5f5/0x8f0 [nvidia]
[   24.382181]  ? __fget_files+0x6a/0x90
[   24.382333]  ? nvidia_frontend_unlocked_ioctl+0x3b/0x50 [nvidia]
[   24.382341]  ? ksys_ioctl+0x9d/0xd0
[   24.382350]  ? __x64_sys_ioctl+0x1a/0x20
[   24.382368]  ? do_syscall_64+0x49/0xc0
[   24.382370]  ? entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   24.382373] ---[ end trace b19437fd54b462a3 ]---
[   24.382380] Cannot map memory with base addr 0x7f7117417000 and size of 0x7e9 pages

Some outputs:

$ nvidia-smi 
Wed Jan  6 10:05:48 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.38       Driver Version: 455.38       CUDA Version: 11.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  GeForce GTX 166...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   39C    P8     3W /  N/A |      5MiB /  5944MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3467      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+
$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x54 cap: 0x9, Source Output, Sink Offload crtcs: 4 outputs: 1 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:07:00.0
Provider 1: id: 0x1d7 cap: 0x2, Sink Output crtcs: 4 outputs: 5 associated providers: 1 name:NVIDIA-G0
$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.02*+  39.98  
   1680x1050     60.02  
   1280x1024     60.02  
   1440x900      60.02  
   1280x800      60.02  
   1280x720      60.02  
   1024x768      60.02  
   800x600       60.02  
   640x480       60.02  
DP-1-0 disconnected
DP-1-1 disconnected
HDMI-1-0 connected
   1920x1080     60.00 +  59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.93    59.94  
DP-1-2 disconnected
DP-1-3 disconnected

My system specs:

$ inxi -Fxz
System:    Kernel: 5.8.0-33-lowlatency x86_64 bits: 64 compiler: N/A Desktop: Xfce 4.14.2 
           Distro: Ubuntu 20.04.1 LTS (Focal Fossa) 
Machine:   Type: Laptop System: HP product: OMEN Laptop 15-en0xxx v: N/A serial: <filter> 
           Mobo: HP model: 8786 v: 22.54 serial: <filter> UEFI: AMI v: F.07 date: 09/16/2020 
Battery:   ID-1: BAT0 charge: 42.5 Wh condition: 67.6/67.6 Wh (100%) model: Hewlett-Packard Primary status: Discharging 
CPU:       Topology: 6-Core model: AMD Ryzen 5 4600H with Radeon Graphics bits: 64 type: MT MCP arch: Zen rev: 1 
           L2 cache: 3072 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 71864 
           Speed: 1397 MHz min/max: 1400/3000 MHz Core speeds (MHz): 1: 1397 2: 1398 3: 1401 4: 1397 5: 1401 6: 1396 7: 1397 
           8: 1397 9: 1447 10: 1397 11: 1397 12: 1397 
Graphics:  Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] vendor: Hewlett-Packard driver: nvidia v: 455.38 
           bus ID: 01:00.0 
           Device-2: Advanced Micro Devices [AMD/ATI] Renoir vendor: Hewlett-Packard driver: amdgpu v: kernel bus ID: 07:00.0 
           Display: x11 server: X.Org 1.20.8 driver: amdgpu,ati,nvidia unloaded: fbdev,modesetting,nouveau,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: AMD RENOIR (DRM 3.38.0 5.8.0-33-lowlatency LLVM 10.0.0) v: 4.6 Mesa 20.0.8 direct render: Yes 
Audio:     Device-1: NVIDIA TU116 High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 01:00.1 
           Device-2: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor vendor: Hewlett-Packard 
           driver: snd_rn_pci_acp3x v: kernel bus ID: 07:00.5 
           Device-3: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 07:00.6 
           Sound Server: ALSA v: k5.8.0-33-lowlatency 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard driver: r8169 v: kernel 
           port: e000 bus ID: 02:00.0 
           IF: eno1 state: down mac: <filter> 
           Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel port: e000 bus ID: 03:00.0 
           IF: wlo1 state: up mac: <filter> 
Drives:    Local Storage: total: 931.51 GiB used: 86.60 GiB (9.3%) 
           ID-1: /dev/nvme0n1 vendor: Kingston model: SA2000M81000G size: 931.51 GiB 
           ID-2: /dev/nvme1n1 vendor: Samsung model: MZVLB512HBJQ-000H1 size: 476.94 GiB 
Partition: ID-1: / size: 161.41 GiB used: 46.35 GiB (28.7%) fs: ext4 dev: /dev/nvme0n1p1 
Sensors:   System Temperatures: cpu: 36.0 C mobo: N/A gpu: amdgpu temp: 35 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 428 Uptime: 26m Memory: 15.07 GiB used: 2.36 GiB (15.7%) Init: systemd runlevel: 5 Compilers: gcc: 9.3.0 
           Shell: bash v: 5.0.17 inxi: 3.0.38 

Logs attached. Its working as expected in Windows, so not a hardware issue I guess. Let me know how to get it working in Linux. Thanks.

nvidia-bug-report.log.gz (709.6 KB)

There’s a known incompatibility currently with the way the amdgpu driver uses transparent huge pages that prevents the NVIDIA driver from importing them. Please see this caveat in Chapter 33 of the README:

The NVIDIA driver currently cannot be used as an output sink when the output source driver is xf86-video-amdgpu.

Thats unfortunate. Thanks for the information @aplattner. Is there a roadmap/plan to implement this feature?

1 Like

You can use Prime output to make use of external monitors:
https://forums.developer.nvidia.com/t/nvidia-xconfig-doesnt-do-what-i-want-it-to-nor-does-nvidia-settings/107883/7?u=generix
aplattner was talking of using the output sink feature.

1 Like

What @aplattner mentioned is what I ideally desire, ie, to use amdgpu as my primary GPU, and configure NVidia as a sink in order to use its HDMI output.

If I understand correctly, by following your guide, NVidia would be the primary GPU, and amdgpu (via modesetting) would be configured as a sink to show output on the laptop display.

Please correct me if I am mistaken. Thanks for your help @generix !

correct. For the state of using the nvidia gpu as output sink for amdgpu, please see this thread:
https://forums.developer.nvidia.com/t/ryzen-7-gtx-1660ti-blank-screen-on-external-outputs-in-hybrid-graphics-mode/157800/3

@generix your solution works!

It consumes much more battery than amdgpu. Usually I am connected to a power source while connected via HDMI, so its ok for now. To back to using amdgpu I revert the changes made and restart the Xserver.

I marked @aplattner 's answer as the solution since its not currently supported. Hopefully you guys can figure out a simple solution that works out of the box without recompiling the kernel.

Thanks for your help!

Scrolling feels sluggish when running Xserver on NVidia. On searching, it may be due to Prime Synchorinzation being disabled. Tried enabling it using following guide: How to enable PRIME Synchronization? - #3 by zibri1

Output says that drm modeset is enabled:

$ sudo cat /sys/module/nvidia_drm/parameters/modeset
Y

Does not seem to be working though:

$ xrandr --output HDMI-0 --set "PRIME Synchronization" 1
X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  11 (RRQueryOutputProperty)
  Serial number of failed request:  53
  Current serial number in output stream:  53

Am I missing something? This is with Xfce 4.14 on Ubuntu 20.04 with composting enabled. Can open a new topic for this as appropriate.

2 Likes

The xfwm compositor doesn’t work with nvidia. Please turn off compositing with it.
The internal display will be tear-free due to Prime sync nevertheless. The external monitors which are connected directly to the nvidia gpu will need to have “ForceCompositionPipeline” enabled on xorg.conf or through nvidia-settings for tear-free display.
The changes in the Ubuntu config mentioned in the thread are ment to be able to use Ubuntu’s prime-select {nvidia|intel} to switch between the modes.

1 Like

Thanks for the help @generix, much appreciated. I removed /etc/X11/xorg.conf generated by nvidia-xconfig, copied /usr/share/X11/xorg.conf.d/10-amdgpu.conf and /usr/share/X11/xorg.conf.d/10-nvidia.conf to /etc/X11/xorg.conf.d , made the changes written in your post, and restarted the X server.

Its smoother now, with just a little tearing.

Two things remain:

  • Xorg CPU usage gets quite high, especially on moving windows.
  • Transparency is gone in xfce terminal after disabling composting. Is it possible/advisable to use a compositor like compton with glx backend?

Thanks!

IIRC, it’s quite common people using xfce replaced the built-in compositing with compton due to general problems. I don’t know how well it works with nvidia but it’s sure worth a shot.
The best working compositing WM so far is Gnome’s mutter. In general all of this also depends on screen estate, i.e. FHD screens work better than 4k.

HP Omen 15 (Ryzen 5 4600H + NVIDIA 1660Ti) running Debian 11/SDDM

Hi @generix and @aplattner,

Thanks for your contributions to these threads.

My system

I have a HP Omen 15 (Ryzen 4600H + NVIDIA 1660Ti), the same machine as the OP, but I’m running KDE (with SDDM) on Debian Bullseye (testing) and not Gnome (with GDM) on Ubuntu. On this machine, the HDMI port is connected directly to the eGPU.

I know how to set up my system in both of these modes:

  • the iGPU renders the image on the laptop’s display but external displays don’t work (the default configuration out-of-the-box), and
  • the NVIDIA eGPU renders the image on the external display but the laptop’s display does not work (by doing some xorg.conf modifications listed on some relevant threads, described later in ths post).

What I’d like

I would like to know how to configure my machine in one of these configurations:

  1. The AMD iGPU renders all applications and displays them on the laptop’s display (natively) and on external monitor(s) via HDMI (by passing through the NVIDIA eGPU)
  2. The NVIDIA eGPU renders all applications and displays them on the external monitor via HDMI (natively) and on the laptop’s display (by passing through the AMD iGPU)

Despite the configuration, I’d like certain applications to run on the NVIDIA eGPU if desired.

My understanding so far

As far as I can tell, Configuration 1 (the ideal hybrid graphics configuration) is not possible yet (from this post, but is being worked on (?)

Configuration 2 (more battery intensive) has instructions on several threads, but they all seem to refer to GNOME/GDM/Ubuntu systems and not KDE/SDDM/Debian systems.

Some relevant outputs

lspci | grep "VGA"

01:00.0 VGA compatible controller: NVIDIA Corporation TU116M [GeForce GTX 1660 Ti Mobile] (rev a1)
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c7)

nvidia-smi

Tue Jun 29 11:25:51 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: N/A      |
|-------------------------------+----------------------+----------------------+
| 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  GeForce GTX 166...  On   | 00000000:01:00.0  On |                  N/A |
| N/A   44C    P8     4W /  N/A |    472MiB /  5944MiB |      5%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       907      G   /usr/lib/xorg/Xorg                168MiB |
|    0   N/A  N/A      1304      G   /usr/bin/kwin_x11                  60MiB |
|    0   N/A  N/A      1371      G   /usr/bin/plasmashell               41MiB |
|    0   N/A  N/A      1608      G   ...mail/bridge/proton-bridge        1MiB |
|    0   N/A  N/A      1636      G   /app/lib/librewolf/librewolf      166MiB |
|    0   N/A  N/A      4715      G   ...AAAAAAAAA= --shared-files       25MiB |
+-----------------------------------------------------------------------------+

Configuration that that allows only external monitors to work (using NVIDIA eGPU)

I cobbled this together by reading the Debian documentation for using only the NVIDIA eGPU (but that only refers to Intel/NVIDIA combinations) and some of the threads you’ve contributed to.

/etc/X11/xorg.conf

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "AMD"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier  "nvidia"
    Driver      "nvidia"
    BusID       "PCI:01:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier  "AMD"
    Driver      "modesetting"
    BusID       "PCI:06:0:0"
    Option "DRI" "3"
    Option "TearFree" "true"
EndSection

Section "Screen"
    Identifier "AMD"
    Device "AMD"
EndSection

./xsessionrc

xrandr --setprovideroutputsource modesetting NVIDIA-G0
xrandr --auto
xrandr --dpi 96

/usr/share/sddm/scripts/Xsetup

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

xrandr --setprovideroutputsource modesetting NVIDIA-G0
xrandr --auto
xrandr --dpi 96

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

I was expecting that this configuration would also allow my laptop’s display to work (in addition to the external monitor), but apparently not, and I’m not sure why (my understanding of the technicalities involved is limited).

Looking forward to your help!

Thank you :)

EDIT: Partially resolved

I managed to achieve Configuration 2 by tweaking some settings further. Oddly, when I ran xrandr --listproviders, I got the output:

Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 5 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x1fe cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 1 name:modesetting

Earlier (before the configuration changes I described, the NVIDIA GPU was named NVIDIA-G0, but now it’s somehow named NVIDIA-0. I replaced this name in ~/.xsessionrc and in /usr/share/sddm/scripts/Xsetup and now it works perfectly! I had a minor issue where KDE Plasma refused to display panels on the screens, but I found a fix for that too on https://askubuntu.com/questions/930183/plasma-multiple-displays-panel-disappears (sorry, as a new user, I can only add 3 links per post).

I’d still appreciate knowing if the ideal hybrid graphics configuration would be possible on this machine though!

2 Likes

Please try with the 470 beta driver, this has added support for using amdgpu as display source. Don’t know if further kernel requirements have to be met.

My H/W:
Laptop: HP Pavilion Gaming Laptop 15-ec1045nw
CPU: AMD Ryzen 5 4600H with Radeon Graphics

lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile] (rev a1)
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c7)

Works correct - Debian 11 / SDDM.

Resolutions:

  • Internal / cover monitor 1920x1080 / FullHD @144Hz
  • external via HDMI 3840x2160 / 4K @60Hz.

BIG THX !!! Short & full working out of box /etc/X11/xorg.conf & completed Xsetup.
BIG THX again !!!

1 Like

I confirm, it works,

HW
HP Pavilion Gaming Laptop 15-ec1038LA
AMD Ryzen 7 4800H

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 1 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x1fd cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 1 name:modesetting
lspci | grep "VGA"
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile] (rev a1)
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c6)

Thank you!!

1 Like