Second monitor on Asus ROG Zephyrus with AMD & Nvidia graphics

Hello guys.

I have a laptop with AMD & Nvidia cards, latest Manjaro stable installed.
My laptop has an HDMI port and usb type-c 3.1 gen port, which supports video channel.

My aim is to connect 2 monitors at the same time. HDMI port works fine, but the type-c does not.
Tried different hubs/switchers. Almost all of them do not even show video port after connecting, but the one do show. It works on Windows without any additional settings, but on Manjaro I can only see a black screen while in the video configuration settings it is presented. I can switch on the display plugged in by this hub, but the configuration does not apply.
I am facing the next message using sudo dmesg -w command.
Cannot map memory with base addr 0x7f14b9bb6000 and size of 0x7e9 pages

Summary

System: Kernel: 5.9.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0

Machine: Type: Laptop System: ASUSTeK product: ROG Zephyrus G14 GA401IV_GA401IV v: 1.0 serial:
CPU: Info: 8-Core model: AMD Ryzen 9 4900HS with Radeon Graphics bits: 64 type: MT MCP arch:
Graphics: Device-1: NVIDIA TU106M [GeForce RTX 2060 Max-Q] vendor: ASUSTeK driver: nvidia v: 455.45.01
alternate: nouveau,nvidia_drm bus ID: 01:00.0 chip ID: 10de:1f12
Device-2: Advanced Micro Devices [AMD / ATI] Renoir vendor: ASUSTeK driver: amdgpu v: kernel bus ID: 04:00.0
chip ID: 1002:1636
Display: x11 server: X .org 1.20.10 compositor: gnome-shell driver: amdgpu,ati,nvidia unloaded: modesetting,nouveau
alternate: fbdev,nv,vesa resolution: <missing: xdpyinfo>
OpenGL: renderer: AMD RENOIR (DRM 3.39.0 5.9.16-1-MANJARO LLVM 11.0.0) v: 4.6 Mesa 20.3.1 direct render: Yes

Please help to find out the solution to make my second monitor working.

Please post the output of xrandr -q and xrandr --listproviders after you connected the two monitors.

2 monitors are plugged in

  • first one via HDMI → hub → type-C (black screen)
  • second via VGA → vga-to-hdmi switcher cable → HDMI (works, but not very clear image because of VGA connection to the monitor as I have only one HDMI cable now)

please do not pay attention on my simple vga-to-hdmi switcher as it is only used till I buy the second hdmi-hdmi cable :slight_smile:

Summary

Screen 0: minimum 320 x 200, current 5760 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
1920x1080 120.00*+ 60.00
1680x1050 120.00
1280x1024 120.00
1440x900 120.00
1280x800 120.00
1280x720 120.00
1024x768 120.00
800x600 120.00
640x480 120.00
HDMI-A-0 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 476mm x 268mm
1920x1080 60.00*+ 59.94
1680x1050 59.88
1600x900 60.00
1280x1024 60.02
1440x900 59.90
1280x800 59.91
1280x720 60.00 59.94
1024x768 60.00
800x600 60.32
720x480 60.00 59.94
640x480 60.00 59.94
720x400 70.08
DP-1-0 connected
1920x1080 60.00 + 59.94 50.00
1680x1050 59.95
1600x900 60.00
1440x900 59.89
1280x1024 60.02
1280x800 59.81
1280x720 60.00 59.94
1024x768 60.00
800x600 60.32
720x576 50.00
720x480 59.94
640x480 59.94 59.93
DP-1-1 disconnected
1920x1080 (0x60) 148.500MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.50KHz
v: height 1080 start 1084 end 1089 total 1125 clock 60.00Hz
1600x900 (0x64) 108.000MHz +HSync +VSync
h: width 1600 start 1624 end 1704 total 1800 skew 0 clock 60.00KHz
v: height 900 start 901 end 904 total 1000 clock 60.00Hz
1280x1024 (0x65) 108.000MHz +HSync +VSync
h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 63.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 60.02Hz
1280x720 (0x68) 74.250MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 45.00KHz
v: height 720 start 725 end 730 total 750 clock 60.00Hz
1024x768 (0x6b) 65.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.36KHz
v: height 768 start 771 end 777 total 806 clock 60.00Hz
800x600 (0x6c) 40.000MHz +HSync +VSync
h: width 800 start 840 end 968 total 1056 skew 0 clock 37.88KHz
v: height 600 start 601 end 605 total 628 clock 60.32Hz
720x480 (0x6f) 27.000MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.47KHz
v: height 480 start 489 end 495 total 525 clock 59.94Hz
640x480 (0x71) 25.175MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz
v: height 480 start 490 end 492 total 525 clock 59.94Hz

Summary

Providers: number : 2
Provider 0: id: 0x55 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 2 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:04:00.0
Provider 1: id: 0x20b cap: 0x2, Sink Output crtcs: 4 outputs: 2 associated providers: 1 name:NVIDIA-G0

I believe this a known limitation at the moment for AMD + NVIDIA configurations. What you can do is install optimus-manager:

pamac build optimus-manager-git gdm-prime

After that you need to remove (back up) every display-related Xorg configuration: /etc/X11/xorg.conf and any such files in /etc/X11/xorg.cond.d/. (If you have 00-keyboard.conf, you don’t need to remove it, but you should remove 90-mhwd.conf, for example - if you’re unsure, ask.)

Then you need to reboot. If everything goes successfully, you can now run optimus-manager --switch nvidia after logging in, and use all external monitors.

There is a guide, but it’s quite old now, and has multiple unnecessary steps (e.g. you don’t need to concern yourself with bumblebee, you don’t need to remove manjaro-gdm-tweaks).

Used your approach.

  1. After reboot I did

sudo optimus-manager --switch nvidia

Summary

[130]
ERROR: a GPU setup was initiated but Xorg post-start hook did not run.
Log at /var/log/optimus-manager/switch/switch-20210117T215837.log
If your login manager is GDM, make sure to follow those instructions:
GitHub - Askannz/optimus-manager: A Linux program to handle GPU switching on Optimus laptops.
If your display manager is neither GDM, SDDM nor LightDM, or if you don’t use one, read the wiki:
FAQ, common issues, troubleshooting · Askannz/optimus-manager Wiki · GitHub
Cannot execute command because of previous errors.

While there is no errors in the log file (whaaaaattt?)

Summary

[19] INFO: # Xorg pre-start hook
[19] INFO: Previous state was: {‘type’: ‘pending_pre_xorg_start’, ‘requested_mode’: ‘integrated’, ‘current_mode’: None}
[19] INFO: Requested mode is: integrated
[242] INFO: Available modules: [‘nouveau’, ‘nvidia’, ‘nvidia_drm’, ‘nvidia_modeset’, ‘nvidia_uvm’]
[329] INFO: No processes currently holding the Nvidia GPU
[329] INFO: Unloading modules [‘nvidia_drm’, ‘nvidia_modeset’, ‘nvidia_uvm’, ‘nvidia’] (if loaded)
[336] INFO: switching=none, nothing to do
[362] INFO: Loaded extra integrated-gpu Xorg options (0 lines)
[362] INFO: Loaded extra nvidia-gpu Xorg options (0 lines)
[363] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[363] INFO: Writing state {‘type’: ‘pending_post_xorg_start’, ‘switch_id’: ‘20210117T215837’, ‘requested_mode’: ‘integrated’}
[364] INFO: Xorg pre-start hook completed successfully.

  1. Used workaround:
    prime-offload
  2. sudo optimus-manager --switch nvidia
Summary

WARNING : no power management option is currently enabled (this is the default since v1.2). Switching between GPUs will work but you will likely experience poor battery life.
Follow instructions at A guide to power management options · Askannz/optimus-manager Wiki · GitHub to enable power management.
If you have already enabled the new Runtime D3 power management inside the Nvidia driver (for Turing+ GPU + Coffee Lake+ CPU), you can safely ignore this warning.

WARNING : there is at least one Wayland session running on this computer. Wayland is not supported by this optimus-manager, so GPU switching may fail.
Continue anyway ? (y/N)

y
You are about to switch GPUs. This will forcibly close all graphical sessions and all your applications WILL CLOSE.
(you can pass the --no-confirm option to disable this warning)
Continue ? (y/N)
y
Switching to mode : nvidia

  1. I don’t see my monitor connected at all now… I mean nothing happens and no display showing in settings while connecting, xrandr -q shows only laptop’s main display.

You don’t need to use sudo. Can you reboot again and see if anything changes?

the same happens

optimus-manager --switch nvidia

Summary

ERROR: a GPU setup was initiated but Xorg post-start hook did not run.
Log at /var/log/optimus-manager/switch/switch-20210118T125420.log
If your login manager is GDM, make sure to follow those instructions:
GitHub - Askannz/optimus-manager: A Linux program to handle GPU switching on Optimus laptops.
If your display manager is neither GDM, SDDM nor LightDM, or if you don’t use one, read the wiki:
FAQ, common issues, troubleshooting · Askannz/optimus-manager Wiki · GitHub
Cannot execute command because of previous errors.

nano /var/log/optimus-manager/switch/switch-20210118T125420.log

Summary

[20] INFO: # Xorg pre-start hook
[20] INFO: Previous state was: {‘type’: ‘pending_pre_xorg_start’, ‘requested_mode’: ‘integrated’, ‘current_mode’: None}
[20] INFO: Requested mode is: integrated
[236] INFO: Available modules: [‘nouveau’, ‘nvidia’, ‘nvidia_drm’, ‘nvidia_modeset’, ‘nvidia_uvm’]
[283] INFO: No processes currently holding the Nvidia GPU
[283] INFO: Unloading modules [‘nvidia_drm’, ‘nvidia_modeset’, ‘nvidia_uvm’, ‘nvidia’] (if loaded)
[289] INFO: switching=none, nothing to do
[321] INFO: Loaded extra integrated-gpu Xorg options (0 lines)
[321] INFO: Loaded extra nvidia-gpu Xorg options (0 lines)
[321] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[321] INFO: Writing state {‘type’: ‘pending_post_xorg_start’, ‘switch_id’: ‘20210118T125420’, ‘requested_mode’: ‘integrated’}
[322] INFO: Xorg pre-start hook completed successfully.

This issue seems to be very similar. Run prime-offload first, and then try optimus-manager --switch nvidia.

Done.

But after I plug in my hub, the system falls into permanent freeze state and nothing help but hard reboot :frowning:

Can you try what happens when you plug the hub in before booting? And post the output of inxi -Gazy and xrandr --listproviders after you switched to “nvidia” mode. And try to find the logs from around the time the system froze in journalctl (e.g. journalct -b -1 will show you the logs from previous boot until shutdown).

After switching to nvidia and without pluging-in hub
inxi -Gazy

Summary

Graphics:
Device-1: NVIDIA TU106M [GeForce RTX 2060 Max-Q] vendor: ASUSTeK
driver: nvidia v: 455.45.01 alternate: nouveau,nvidia_drm bus ID: 01:00.0
chip ID: 10de:1f12
Device-2: AMD Renoir vendor: ASUSTeK driver: amdgpu v: kernel
bus ID: 04:00.0 chip ID: 1002:1636
Display: wayland server: X.org 1.20.10 compositor: gnome-shell v: 3.38.2
driver: amdgpu note: n/a (using device driver) - try sudo/root
unloaded: modesetting display ID: 0 resolution: <missing: xdpyinfo>
OpenGL: renderer: AMD RENOIR (DRM 3.39.0 5.9.16-1-MANJARO LLVM 11.0.0)
v: 4.6 Mesa 20.3.1 direct render: Yes

xrandr --listproviders

Summary

Providers: number : 0

Let me try now to gather the logs after freeze

I plug in my HUB → system falls in freeze → I do the hard reboot → journalctl -b -1

Summary

– Journal begins at Wed 2020-12-30 01:30:26 EET, ends at Wed 2021-01-20 14:37:02 EET. –
Jan 20 14:29:42 denis-zephyrus-g14 kernel: Linux version 5.9.16-1-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Mon Dec 21 22:00:46 UTC 2020
Jan 20 14:29:42 denis-zephyrus-g14 kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 root=UUID=4c849827-bda6-4484-b090-0da7780e51cf rw quiet splash apparmor=1 security=apparmor >
Jan 20 14:29:42 denis-zephyrus-g14 kernel: KERNEL supported cpus:
Jan 20 14:29:42 denis-zephyrus-g14 kernel: Intel GenuineIntel
Jan 20 14:29:42 denis-zephyrus-g14 kernel: AMD AuthenticAMD
Jan 20 14:29:42 denis-zephyrus-g14 kernel: Hygon HygonGenuine
Jan 20 14:29:42 denis-zephyrus-g14 kernel: Centaur CentaurHauls
Jan 20 14:29:42 denis-zephyrus-g14 kernel: zhaoxin Shanghai
Jan 20 14:29:42 denis-zephyrus-g14 kernel: x86/fpu: Supporting XSAVE feature 0x001: ‘x87 floating point registers’
Jan 20 14:29:42 denis-zephyrus-g14 kernel: x86/fpu: Supporting XSAVE feature 0x002: ‘SSE registers’
Jan 20 14:29:42 denis-zephyrus-g14 kernel: x86/fpu: Supporting XSAVE feature 0x004: ‘AVX registers’
Jan 20 14:29:42 denis-zephyrus-g14 kernel: x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
Jan 20 14:29:42 denis-zephyrus-g14 kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using ‘compacted’ format.
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-provided physical RAM map:
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x0000000000100000-0x0000000009bfefff] usable
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x0000000009bff000-0x0000000009ffffff] reserved
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x000000000a000000-0x000000000a1fffff] usable
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x000000000a200000-0x000000000a20cfff] ACPI NVS
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x000000000a20d000-0x00000000aaec2fff] usable
Jan 20 14:29:42 denis-zephyrus-g14 kernel: BIOS-e820: [mem 0x00000000aaec3000-0x00000000ac3ddfff] reserved

But I guess this is now what you want to see.
I cannot see the logs in runtime if I plug in and plug out my hub, because after I plug out the system is still in freeze state.
Let me try few different scenarios

UPDATE:
Nothing changes in the logs :frowning:

Maybe I can try to use AMD card instead of nvidia?

After you run this, keep pressing page down / press the end key to go to the last entries before the system shut down. You posted the entries from right after booting the system, which are not as interesting right now.

You are using a Wayland compositor? Did you modify /etc/gdm/custom.conf to include WaylandEnable=false?

Regarding Wayland, here is my configuration.

Summary
`    # GDM configuration storage

[daemon]
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
#Enable=true`

After you run this, keep pressing page down / press the end key

let me try

Here are logs with error you want to see , I hope
P.S. I posted wrong logs… so now updating my post

I done again with some pauses between my actions to be able to separate logs to find the correct one:

  • 13.30 switch to nvidia
  • 13.31 plug in my hub
  • 13.32 restart
Summary
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1: new high-speed USB device number 4 using xhci_hcd
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1: New USB device found, idVendor=05e3, idProduct=0608, bcdDevice=60.70
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1: Product: USB2.0 Hub
Jan 21 13:31:08 denis-zephyrus-g14 kernel: hub 5-1:1.0: USB hub found
Jan 21 13:31:08 denis-zephyrus-g14 kernel: hub 5-1:1.0: 4 ports detected
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1.4: new high-speed USB device number 5 using xhci_hcd
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1.4: New USB device found, idVendor=05e3, idProduct=0751, bcdDevice=14.04
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1.4: New USB device strings: Mfr=3, Product=4, SerialNumber=0
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1.4: Product: USB Storage
Jan 21 13:31:08 denis-zephyrus-g14 kernel: usb 5-1.4: Manufacturer: USB Storage
Jan 21 13:31:09 denis-zephyrus-g14 upowerd[1652]: treating change event as add on /sys/devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb5/5-1
Jan 21 13:31:09 denis-zephyrus-g14 mtp-probe[5225]: checking bus 5, device 5: "/sys/devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb5/5-1/5-1.4"
Jan 21 13:31:09 denis-zephyrus-g14 mtp-probe[5225]: bus: 5, device: 5 was not an MTP device
Jan 21 13:31:09 denis-zephyrus-g14 gnome-shell[5227]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Jan 21 13:31:09 denis-zephyrus-g14 gnome-shell[5227]: > Warning:          Unsupported maximum keycode 569, clipping.
Jan 21 13:31:09 denis-zephyrus-g14 gnome-shell[5227]: >                   X11 cannot support keycodes above 255.
Jan 21 13:31:09 denis-zephyrus-g14 gnome-shell[5227]: Errors from xkbcomp are not fatal to the X server
Jan 21 13:31:09 denis-zephyrus-g14 kernel: usb-storage 5-1.4:1.0: USB Mass Storage device detected
Jan 21 13:31:09 denis-zephyrus-g14 kernel: scsi host2: usb-storage 5-1.4:1.0
Jan 21 13:31:09 denis-zephyrus-g14 kernel: usbcore: registered new interface driver usb-storage
Jan 21 13:31:09 denis-zephyrus-g14 kernel: usbcore: registered new interface driver uas
Jan 21 13:31:09 denis-zephyrus-g14 mtp-probe[5258]: checking bus 5, device 5: "/sys/devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb5/5-1/5-1.4"
Jan 21 13:31:09 denis-zephyrus-g14 mtp-probe[5258]: bus: 5, device: 5 was not an MTP device
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: DING: GNOME nautilus 3.38.2
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: Error looking up permission: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for geolocation
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: Timelines with detached actors are not supported
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: Can't update stage views actor StWidget is on because it needs an allocation.
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: Can't update stage views actor StWidget is on because it needs an allocation.
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: Can't update stage views actor StWidget is on because it needs an allocation.
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: setup_framebuffers: assertion 'width > 0' failed
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: setup_framebuffers: assertion 'width > 0' failed
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: setup_framebuffers: assertion 'width > 0' failed
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: setup_framebuffers: assertion 'width > 0' failed
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: setup_framebuffers: assertion 'width > 0' failed
Jan 21 13:31:10 denis-zephyrus-g14 gnome-shell[4309]: setup_framebuffers: assertion 'width > 0' failed
Jan 21 13:31:10 denis-zephyrus-g14 kernel: [drm] Failed to add display topology, DTM TA is not initialized.
Jan 21 13:31:10 denis-zephyrus-g14 kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to get memory pages for NvKmsKapiMemory 0x000000008dc82a96
Jan 21 13:31:10 denis-zephyrus-g14 kernel: BUG: kernel NULL pointer dereference, address: 0000000000000008
Jan 21 13:31:10 denis-zephyrus-g14 kernel: #PF: supervisor read access in kernel mode
Jan 21 13:31:10 denis-zephyrus-g14 kernel: #PF: error_code(0x0000) - not-present page
Jan 21 13:31:10 denis-zephyrus-g14 kernel: PGD 919ea4067 P4D 919ea4067 PUD 0 
Jan 21 13:31:10 denis-zephyrus-g14 kernel: Oops: 0000 [#1] PREEMPT SMP NOPTI
Jan 21 13:31:10 denis-zephyrus-g14 kernel: CPU: 6 PID: 4309 Comm: gnome-shell Tainted: P        W  OE     5.9.16-1-MANJARO #1
Jan 21 13:31:10 denis-zephyrus-g14 kernel: Hardware name: ASUSTeK COMPUTER INC. ROG Zephyrus G14 GA401IV_GA401IV/GA401IV, BIOS GA401IV.212 05/08/2020
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RIP: 0010:drm_gem_map_dma_buf+0x37/0xb0 [drm]
Jan 21 13:31:10 denis-zephyrus-g14 kernel: Code: 48 89 fb 48 8b b8 88 00 00 00 83 fe 03 74 7c 48 8b 87 40 01 00 00 41 89 f5 48 85 c0 74 54 48 8b 40 38 e8 4c 2e 88 e8 49 89 c4 <41> >
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RSP: 0018:ffffba1985757cb0 EFLAGS: 00010296
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RAX: 0000000000000000 RBX: ffff9b900aeb4000 RCX: 0000000000000000
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RDX: 0000000000000000 RSI: ffffffffa9989e1a RDI: 00000000ffffffff
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RBP: ffff9b902fe6d000 R08: 000000000000051d R09: 0000000000000001
Jan 21 13:31:10 denis-zephyrus-g14 kernel: R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
Jan 21 13:31:10 denis-zephyrus-g14 kernel: R13: 0000000000000000 R14: ffff9b8f64f80850 R15: ffff9b9030e375d0
Jan 21 13:31:10 denis-zephyrus-g14 kernel: FS:  00007fa2431fcd00(0000) GS:ffff9b9047580000(0000) knlGS:0000000000000000
Jan 21 13:31:10 denis-zephyrus-g14 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jan 21 13:31:10 denis-zephyrus-g14 kernel: CR2: 0000000000000008 CR3: 0000000919e56000 CR4: 0000000000350ee0
Jan 21 13:31:10 denis-zephyrus-g14 kernel: Call Trace:
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  dma_buf_dynamic_attach+0x16e/0x270
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  amdgpu_gem_prime_import+0x10f/0x200 [amdgpu]
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  drm_gem_prime_fd_to_handle+0xc0/0x1d0 [drm]
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  ? drm_prime_destroy_file_private+0x20/0x20 [drm]
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  drm_ioctl_kernel+0xb2/0x100 [drm]
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  drm_ioctl+0x215/0x390 [drm]
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  ? drm_prime_destroy_file_private+0x20/0x20 [drm]
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  __x64_sys_ioctl+0x83/0xb0
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  do_syscall_64+0x33/0x40
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RIP: 0033:0x7fa246f70f6b
Jan 21 13:31:10 denis-zephyrus-g14 kernel: Code: 89 d8 49 8d 3c 1c 48 f7 d8 49 39 c4 72 b5 e8 1c ff ff ff 85 c0 78 ba 4c 89 e0 5b 5d 41 5c c3 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> >
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RSP: 002b:00007ffc39c7bb98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RAX: ffffffffffffffda RBX: 00007ffc39c7bbdc RCX: 00007fa246f70f6b
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RDX: 00007ffc39c7bbdc RSI: 00000000c00c642e RDI: 0000000000000012
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RBP: 00000000c00c642e R08: 0000000000000002 R09: 0000564ecf93c010
Jan 21 13:31:10 denis-zephyrus-g14 kernel: R10: 00007fa2213b0530 R11: 0000000000000246 R12: 0000000000000002
Jan 21 13:31:10 denis-zephyrus-g14 kernel: R13: 0000000000000012 R14: 00007ffc39c7bc90 R15: 0000000000000000
Jan 21 13:31:10 denis-zephyrus-g14 kernel: Modules linked in: uas usb_storage nvidia_drm(POE) nvidia_modeset(POE) rfcomm ccm cmac algif_hash algif_skcipher af_alg nvidia(POE) input>
Jan 21 13:31:10 denis-zephyrus-g14 kernel:  i2c_hid tpm hid rng_core acpi_cpufreq evdev pinctrl_amd mac_hid asus_wireless msr crypto_user fuse ip_tables x_tables ext4 crc32c_generi>
Jan 21 13:31:10 denis-zephyrus-g14 kernel: CR2: 0000000000000008
Jan 21 13:31:10 denis-zephyrus-g14 kernel: ---[ end trace 6502c3602e5dffee ]---
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RIP: 0010:drm_gem_map_dma_buf+0x37/0xb0 [drm]
Jan 21 13:31:10 denis-zephyrus-g14 kernel: Code: 48 89 fb 48 8b b8 88 00 00 00 83 fe 03 74 7c 48 8b 87 40 01 00 00 41 89 f5 48 85 c0 74 54 48 8b 40 38 e8 4c 2e 88 e8 49 89 c4 <41> >
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RSP: 0018:ffffba1985757cb0 EFLAGS: 00010296
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RAX: 0000000000000000 RBX: ffff9b900aeb4000 RCX: 0000000000000000
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RDX: 0000000000000000 RSI: ffffffffa9989e1a RDI: 00000000ffffffff
Jan 21 13:31:10 denis-zephyrus-g14 kernel: RBP: ffff9b902fe6d000 R08: 000000000000051d R09: 0000000000000001
Jan 21 13:31:10 denis-zephyrus-g14 kernel: R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
Jan 21 13:31:10 denis-zephyrus-g14 kernel: R13: 0000000000000000 R14: ffff9b8f64f80850 R15: ffff9b9030e375d0
Jan 21 13:31:10 denis-zephyrus-g14 kernel: FS:  00007fa2431fcd00(0000) GS:ffff9b9047580000(0000) knlGS:0000000000000000
Jan 21 13:31:10 denis-zephyrus-g14 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jan 21 13:31:10 denis-zephyrus-g14 kernel: CR2: 0000000000000008 CR3: 0000000919e56000 CR4: 0000000000350ee0
Jan 21 13:31:10 denis-zephyrus-g14 dbus-daemon[831]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested by ':>
Jan 21 13:31:10 denis-zephyrus-g14 dbus-daemon[831]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service n>
Jan 21 13:31:10 denis-zephyrus-g14 kernel: scsi 2:0:0:0: Direct-Access     Generic  STORAGE DEVICE   1404 PQ: 0 ANSI: 6
Jan 21 13:31:10 denis-zephyrus-g14 kernel: sd 2:0:0:0: [sda] Attached SCSI removable disk
Jan 21 13:31:11 denis-zephyrus-g14 dbus-daemon[831]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested by ':>
Jan 21 13:31:11 denis-zephyrus-g14 dbus-daemon[831]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service n>
Jan 21 13:31:14 denis-zephyrus-g14 geoclue[3983]: Service not used for 60 seconds. Shutting down..
Jan 21 13:31:14 denis-zephyrus-g14 systemd[1]: geoclue.service: Succeeded.
Jan 21 13:31:14 denis-zephyrus-g14 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=geoclue comm="systemd" exe="/usr/lib/systemd/systemd>
Jan 21 13:31:15 denis-zephyrus-g14 kernel: audit: type=1131 audit(1611228674.994:182): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=geoclue comm="systemd" >
Jan 21 13:32:08 denis-zephyrus-g14 kernel: ucsi_acpi USBC000:00: GET_CURRENT_CAM command failed
Jan 21 13:32:20 denis-zephyrus-g14 systemd[1]: Starting Cleanup of Temporary Directories...
Jan 21 13:32:20 denis-zephyrus-g14 systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
Jan 21 13:32:20 denis-zephyrus-g14 systemd[1]: Finished Cleanup of Temporary Directories.
Jan 21 13:32:20 denis-zephyrus-g14 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib>
Jan 21 13:32:20 denis-zephyrus-g14 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/>
Jan 21 13:32:20 denis-zephyrus-g14 kernel: audit: type=1130 audit(1611228740.879:183): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-tmpfiles-clean >
Jan 21 13:32:20 denis-zephyrus-g14 kernel: audit: type=1131 audit(1611228740.879:184): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-tmpfiles-clean 

Does glxinfo -B | grep renderer correctly report the name of the NVIDIA GPU after switching?

seems like NO.

Summary

Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: AMD RENOIR (DRM 3.39.0, 5.9.16-1-MANJARO, LLVM 11.0.1)

What’s the output of xrandr -q, nvidia-smi, and head -n999 /etc/X11/xorg.conf /etc/X11/xorg.conf.d/* after the switch?

Summary
Screen 0: minimum 16 x 16, current 3840 x 1080, maximum 32767 x 32767
XWAYLAND0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 310mm x 170mm
   1920x1080    119.93*+
   1440x1080    119.92  
   1400x1050    119.90  
   1280x1024    119.83  
   1280x960     119.89  
   1152x864     119.77  
   1024x768     119.80  
   800x600      119.85  
   640x480      119.52  
   320x240      117.34  
   1680x1050    119.89  
   1440x900     119.94  
   1280x800     119.85  
   720x480      119.65  
   640x400      119.64  
   320x200      117.55  
   1600x900     119.95  
   1368x768     119.83  
   1280x720     119.86  
   1024x576     119.85  
   864x486      119.69  
   720x400      119.54  
   640x350      119.24  
XWAYLAND1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
   1920x1080     59.96*+
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  

nvidia-smi

Summary

Fri Jan 22 19:09:41 2021
±----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------±---------------------±---------------------+
| 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 RTX 206… Off | 00000000:01:00.0 Off | N/A |
| N/A 38C P8 2W / N/A | 1MiB / 5934MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+

head -n999 /etc/X11/xorg.conf /etc/X11/xorg.conf.d/*

Summary
head -n999 /etc/X11/xorg.conf /etc/X11/xorg.conf.d/*                  [1]
head: cannot open '/etc/X11/xorg.conf' for reading: No such file or directory
==> /etc/X11/xorg.conf.d/00-keyboard.conf <==
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,ru,ua"
        Option "XkbVariant" ",,"
EndSection

==> /etc/X11/xorg.conf.d/10-optimus-manager.conf <==
Section "Files"
	ModulePath "/usr/lib/nvidia"
	ModulePath "/usr/lib32/nvidia"
	ModulePath "/usr/lib32/nvidia/xorg/modules"
	ModulePath "/usr/lib32/xorg/modules"
	ModulePath "/usr/lib64/nvidia/xorg/modules"
	ModulePath "/usr/lib64/nvidia/xorg"
	ModulePath "/usr/lib64/xorg/modules"
EndSection

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

Section "Device"
	Identifier "nvidia"
	Driver "nvidia"
	BusID "PCI:1:0:0"
	Option "Coolbits" "28"
EndSection

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

Section "Device"
	Identifier "integrated"
	Driver "modesetting"
	BusID "PCI:4:0:0"
EndSection

Section "Screen"
	Identifier "integrated"
	Device "integrated"
EndSection


==> /etc/X11/xorg.conf.d/90-mhwd.conf.bak <==
##
## Generated by mhwd - Manjaro Hardware Detection
##

You seem to be using Wayland. Can you uncomment (remove # from front) the WaylandEnable=false line in /etc/gdm/custom.conf, and then reboot, and try optimus-manager --switch nvidia again?