You are not logged in.

#1 2021-10-01 15:35:21

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Hello everyone. I bought a new laptop for job-related needs (Lenovo Ideapad 3 Gaming 15ARH05), which sports an Optimus configuration (AMD Renoir iGPU+Nvidia GTX 1650 dGPU). It works well, until you try to play a game via PRIME render offload. I am using the default kernel+dkms drivers. No matter what i do, it has an atrocious issue with tearing. I disabled Secure Boot, added the nvidia.modeset=1 kernel parameter, i did everything as per the official Arch wiki guide, the logs show the nvidia module being loaded early as expected, xrandr --props shows PRIME sync enabled, xorg logs don't show any meaningful error. I do have to mention i have amdgpu set to early KMS via mkinitcpio. I am only using the default modesetting driver, no xf86 drivers of any kind. I had to go back to Windows temporarily since the tearing issue was affecting my job, i render 3D models and the higher ups disliked the tearing issue sad. Any help will be appreciated.

Offline

#2 2021-10-02 11:48:43

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Please post output of

$ glxinfo -B
$ prime-run glxinfo -B

xorg log and the output of xrandr --props would also be helpful .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2021-10-02 13:00:53

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Hi Lone_Wolf, i'll reinstall Arch today since i had to wipe it due to needing the full SSD for Windows (i do renders for my job, and they usually take up a lot of my storage, and i needed the full space). If you can give me some hours i can clone my Arch installation back to my SSD and paste the output of said commands.

Offline

#4 2021-10-03 19:02:32

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Lone_Wolf wrote:

Please post output of

$ glxinfo -B
$ prime-run glxinfo -B

xorg log and the output of xrandr --props would also be helpful .

glxinfo -B:
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: AMD RENOIR (DRM 3.42.0, 5.14.8-zen1-1-zen, LLVM 12.0.1) (0x1636)
    Version: 21.2.3
    Accelerated: yes
    Video memory: 512MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 66 MB, largest block: 66 MB
    VBO free aux. memory - total: 2534 MB, largest block: 2534 MB
    Texture free memory - total: 66 MB, largest block: 66 MB
    Texture free aux. memory - total: 2534 MB, largest block: 2534 MB
    Renderbuffer free memory - total: 66 MB, largest block: 66 MB
    Renderbuffer free aux. memory - total: 2534 MB, largest block: 2534 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 512 MB
    Total available memory: 3584 MB
    Currently available dedicated video memory: 66 MB
OpenGL vendor string: AMD
OpenGL renderer string: AMD RENOIR (DRM 3.42.0, 5.14.8-zen1-1-zen, LLVM 12.0.1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.2.3
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.2.3
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
prime-run glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 4096 MB
    Total available memory: 4096 MB
    Currently available dedicated video memory: 3903 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1650/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 470.74
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 470.74
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 470.74
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
xrandr --props:
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
        EDID: 
                00ffffffffffff000daee71500000000
                211a0104a52213780228659759548e27
                1e505400000001010101010101010101
                010101010101b43b804a713834405036
                680058c110000018000000fe004e3135
                364843412d4541420a20000000fe0043
                4d4e0a202020202020202020000000fe
                004e3135364843412d4541420a2000b2
        HDCP Content Type: HDCP Type0 
                supported: HDCP Type0, HDCP Type1
        Content Protection: Undesired 
                supported: Undesired, Desired, Enabled
        vrr_capable: 0 
                range: (0, 1)
        abm level: 0 
                range: (0, 4)
        max bpc: 16 
                range: (8, 16)
        underscan vborder: 0 
                range: (0, 128)
        underscan hborder: 0 
                range: (0, 128)
        underscan: off 
                supported: off, on, auto
        scaling mode: None 
                supported: None, Full, Center, Full aspect
        link-status: Good 
                supported: Good, Bad
        CONNECTOR_ID: 78 
                supported: 78
        non-desktop: 0 
                range: (0, 1)
   1920x1080     60.01*+  60.01    59.97    59.96    59.93  
   1680x1050     60.01    59.95    59.88  
   1400x1050     59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     60.01    60.02  
   1440x900      60.01  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1280x800      59.99    60.01    59.97    59.81    59.91  
   1280x720      60.00    60.01    59.99    59.86    59.74  
   1024x768      60.01    60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.01    60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   700x450       59.96    59.88  
   640x480       60.01    60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   640x400       59.88    59.98  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: HDMI 
        ConnectorNumber: 2 
        _ConnectorLocation: 2 
        non-desktop: 0 
                supported: 0, 1

xorg log
https://gist.github.com/CygnusTerminal/ … e93e93b2db

I tried

cat /sys/module/nvidia_drm/parameters/modeset

and it returned "N" even though i have the kernel parameter. I also have my amdgpu module set on mkinitcpio for early loading.
Kernel is zen, with nvidia-dkms
EDIT: modeset is now enabled, but i still get tearing sad

Last edited by Vektor_98 (2021-10-05 20:27:59)

Offline

#5 2021-10-04 10:20:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

glxinfo outputs look good.

[    48.143] (EE) modeset(0): Failed to make import prime FD as pixmap: 22

Is that line still present in current xorg log ?


For testing purpose install xf86-video-amdgpu and restart X , check tearing with prime-run .

Does the firmware allow changing amount of memory used by the iGPU ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#6 2021-10-04 13:47:24

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Lone_Wolf wrote:

glxinfo outputs look good.

[    48.143] (EE) modeset(0): Failed to make import prime FD as pixmap: 22

Is that line still present in current xorg log ?


For testing purpose install xf86-video-amdgpu and restart X , check tearing with prime-run .

Does the firmware allow changing amount of memory used by the iGPU ?

Regarding xorg:

[    12.098] (II) modeset(0): Damage tracking initialized
[    12.098] (II) modeset(0): Setting screen physical size to 508 x 285
[    12.167] (EE) modeset(0): Failed to make import prime FD as pixmap: 22

Still there sad

My laptop's firmware does not allow the memory to be changed. I double checked and there aren't any options. I'll try xf86-video-amdgpu and see how i do. Thanks!
EDIT: No dice with the xf86 driver. Still get that damned tearing.

Last edited by Vektor_98 (2021-10-05 20:28:31)

Offline

#7 2021-10-05 12:09:52

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Something I forgot to mention : please use [ code ] tags for outputs like in post #4 to make them more readable.
https://bbs.archlinux.org/help.php#bbcode for details

This is beginning to look like  a driver/firmware issue and we may have to abandon prime sybnchronization and look at other options.

Let's check some more basics first though :

Latest firmware for your laptop[1]  is FCCN16W from february 2021 . Are you running that version ?

is microcode early loading configured ?

Post dmesg and SYSTEMD_LESS=FRXMK journalctl -b output (run both as root) .
They could be very large , consider using a pastebin service




[1] https://pcsupport.lenovo.com/nl/en/prod … -3-15arh05

Last edited by Lone_Wolf (2021-10-05 12:10:24)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2021-10-05 20:32:48

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Lone_Wolf wrote:

Something I forgot to mention : please use [ code ] tags for outputs like in post #4 to make them more readable.
https://bbs.archlinux.org/help.php#bbcode for details

This is beginning to look like  a driver/firmware issue and we may have to abandon prime sybnchronization and look at other options.

Let's check some more basics first though :

Latest firmware for your laptop[1]  is FCCN16W from february 2021 . Are you running that version ?

is microcode early loading configured ?

Post dmesg and SYSTEMD_LESS=FRXMK journalctl -b output (run both as root) .
They could be very large , consider using a pastebin service




[1] https://pcsupport.lenovo.com/nl/en/prod … -3-15arh05

Regarding firmware, yes, i have it updated to FCCN16W
Early loading of microcode is enabled too, since i have the amd-ucode package and GRUB added it automatically and i can see in the output of [grub-mkconfig -o]
Regarding the journalctl and dmesg commands, i'll upload them as fast as i can, i am about to board a plane due to my job and i don't know when i'll be able to boot back to Arch. Thanks for all your help and sorry for the code tags, they have been added accordingly

Offline

#9 2021-10-06 07:34:35

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

I don't have sufficient knowledge to assist on the titled issue. But I myself have a new Lenovo laptop with amdgpu integrated and nvidia for dgpu. I found optimus-manager to work much better than prime.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#10 2021-10-06 13:36:07

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Offline

#11 2021-10-07 10:20:58

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

No errrors / warnings that stand out in the logs, but there is something weird.


[   15.462021] nvidia: module license 'NVIDIA' taints kernel.
[   15.462023] Disabling lock debugging due to kernel taint
[   15.512045] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[   15.521755] kvm: Nested Virtualization enabled
[   15.521761] SVM: kvm: Nested Paging enabled
[   15.521785] SVM: Virtual VMLOAD VMSAVE supported
[   15.521786] SVM: Virtual GIF supported
[   15.555863] snd_hda_intel 0000:01:00.1: enabling device (0000 -> 0002)
[   15.555970] snd_hda_intel 0000:01:00.1: Disabling MSI
[   15.555975] snd_hda_intel 0000:01:00.1: Handle vga_switcheroo audio client
[   15.556085] snd_hda_intel 0000:05:00.6: enabling device (0000 -> 0002)
[   15.576422] MCE: In-kernel MCE decoding enabled.
[   15.577162] nvidia-nvlink: Nvlink Core is being initialized, major device number 508
[   15.577851] nvidia 0000:01:00.0: enabling device (0100 -> 0103)
[   15.577985] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[   15.578372] usb 1-3: Found UVC 1.00 device Integrated Camera (13d3:56ff)
[   15.581040] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.1/0000:01:00.1/sound/card0/input12
[   15.581071] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.1/0000:01:00.1/sound/card0/input13
[   15.581094] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.1/0000:01:00.1/sound/card0/input14
[   15.581117] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:01.1/0000:01:00.1/sound/card0/input15
[   15.585007] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC257: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[   15.585012] snd_hda_codec_realtek hdaudioC1D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   15.585014] snd_hda_codec_realtek hdaudioC1D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[   15.585016] snd_hda_codec_realtek hdaudioC1D0:    mono: mono_out=0x0
[   15.585017] snd_hda_codec_realtek hdaudioC1D0:    inputs:
[   15.585018] snd_hda_codec_realtek hdaudioC1D0:      Mic=0x19
[   15.585019] snd_hda_codec_realtek hdaudioC1D0:      Internal Mic=0x12
[   15.590397] input: Integrated Camera: Integrated C as /devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3/1-3:1.0/input/input16
[   15.590471] usbcore: registered new interface driver uvcvideo
[   15.628134] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  470.74  Mon Sep 13 23:09:15 UTC 2021
[   15.665018] r8169 0000:03:00.0 eno1: renamed from eth0
[   15.669862] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  470.74  Mon Sep 13 22:59:50 UTC 2021
[   15.670324] rtw_8822ce 0000:04:00.0: enabling device (0000 -> 0003)
[   15.671710] rtw_8822ce 0000:04:00.0: Firmware version 9.9.4, H2C version 15
[   15.671950] rtw_8822ce 0000:04:00.0: Firmware version 9.9.10, H2C version 15
[   15.675140] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[   15.679290] [drm] amdgpu kernel modesetting enabled.

It does look like the nvidia card is beinng initialised before the amd card.

post /etc/mkinitcpio.conf please

Last edited by Lone_Wolf (2021-10-07 10:21:32)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#12 2021-10-07 12:07:06

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

mkinitcpio.conf config:

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

Offline

#13 2021-10-07 13:59:17

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Looks you're missing the modules= & binaries= part, and the modules= line is the one I'm especially interested in.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#14 2021-10-07 21:30:05

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Lone_Wolf wrote:

Looks you're missing the modules= & binaries= part, and the modules= line is the one I'm especially interested in.

Oops, here it is

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect keyboard keymap modconf block encrypt lvm2 filesystems fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

Offline

#15 2021-10-07 21:32:50

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Also, i've just added "amdgpu" to my modules list. Here are the logs you asked the other day, but with "amdgpu" added for early loading:
https://gist.github.com/CygnusTerminal/ … c9aa731082 dmesg
https://gist.github.com/CygnusTerminal/ … dfad642330 journalctl

Offline

#16 2021-10-07 22:30:10

gnox
Member
Registered: 2013-05-18
Posts: 81

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Do you have TearFree for the amdgpu in the Device section in /etc/X11/xorg.conf ? ..

Section "Device"
    Identifier "amdgpu"
    Driver "amdgpu"
    Option "TearFree" "true"
    Option "DRI" "3"
    Option "VariableRefresh" "true"
#    BusID "PCI:6:0:0"
EndSection

If nvidia modeset is enabled and xrandr shows prime sync enabled, the nvidia driver should match what the device "offload to" can show in fps.

Last edited by gnox (2021-10-07 22:47:13)

Offline

#17 2021-10-08 01:52:28

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

gnox wrote:

Do you have TearFree for the amdgpu in the Device section in /etc/X11/xorg.conf ? ..

Section "Device"
    Identifier "amdgpu"
    Driver "amdgpu"
    Option "TearFree" "true"
    Option "DRI" "3"
    Option "VariableRefresh" "true"
#    BusID "PCI:6:0:0"
EndSection

If nvidia modeset is enabled and xrandr shows prime sync enabled, the nvidia driver should match what the device "offload to" can show in fps.

Nope, i've never enabled tearfree on any of my Optimus laptops (last one was an Intel HD 530+GTX 960m) and never had tearing issues while offloading. Tearing still exists as of right now.
xrandr --props output (note that Screen 0 has no PRIME option)

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
        EDID: 
                00ffffffffffff000daee71500000000
                211a0104a52213780228659759548e27
                1e505400000001010101010101010101
                010101010101b43b804a713834405036
                680058c110000018000000fe004e3135
                364843412d4541420a20000000fe0043
                4d4e0a202020202020202020000000fe
                004e3135364843412d4541420a2000b2
        HDCP Content Type: HDCP Type0 
                supported: HDCP Type0, HDCP Type1
        Content Protection: Undesired 
                supported: Undesired, Desired, Enabled
        vrr_capable: 0 
                range: (0, 1)
        abm level: 0 
                range: (0, 4)
        max bpc: 16 
                range: (8, 16)
        underscan vborder: 0 
                range: (0, 128)
        underscan hborder: 0 
                range: (0, 128)
        underscan: off 
                supported: off, on, auto
        scaling mode: None 
                supported: None, Full, Center, Full aspect
        link-status: Good 
                supported: Good, Bad
        CONNECTOR_ID: 78 
                supported: 78
        non-desktop: 0 
                range: (0, 1)
   1920x1080     60.01*+  60.01    59.97    59.96    59.93  
   1680x1050     60.01    59.95    59.88  
   1400x1050     59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     60.01    60.02  
   1440x900      60.01  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1280x800      59.99    60.01    59.97    59.81    59.91  
   1280x720      60.00    60.01    59.99    59.86    59.74  
   1024x768      60.01    60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.01    60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   700x450       59.96    59.88  
   640x480       60.01    60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   640x400       59.88    59.98  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: HDMI 
        ConnectorNumber: 2 
        _ConnectorLocation: 2 
        non-desktop: 0 
                supported: 0, 1

Last edited by Vektor_98 (2021-10-08 01:53:51)

Offline

#18 2021-10-09 13:21:19

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Logs indicate amdgpu is now initialised when nvidia loads, should help them to cooperate better.

Test again, if issue persists try booting with archlinux official linux kernel instead of tkg kernel .

If both kernels have the issue, try a simple WM without compositing like openbox .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#19 2021-10-09 15:05:07

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Lone_Wolf wrote:

Logs indicate amdgpu is now initialised when nvidia loads, should help them to cooperate better.

Test again, if issue persists try booting with archlinux official linux kernel instead of tkg kernel .

If both kernels have the issue, try a simple WM without compositing like openbox .

Thanks i'll try booting the default kernel and report back.
EDIT: tearing is still there, sadly

5.14.9-arch2-1

Here is xorg log of default kernel while trying to play a Steam game on modesetting driver. Notice the amount of errors:
https://gist.github.com/CygnusTerminal/ … 0c27fc2adb
Edit 2:
Here's one with the xf86-video-amdgpu, i still get tearing
https://gist.github.com/CygnusTerminal/ … e0eafcc206

Edit 3: Using the "nvidia only mode" of optimus-manager, PRIME Synchronization appears as 0 on xrandr --props

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: HDMI 
        ConnectorNumber: 2 
        _ConnectorLocation: 2 
        non-desktop: 0 
                supported: 0, 1
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
        EDID: 
                00ffffffffffff000daee71500000000
                211a0104a52213780228659759548e27
                1e505400000001010101010101010101
                010101010101b43b804a713834405036
                680058c110000018000000fe004e3135
                364843412d4541420a20000000fe0043
                4d4e0a202020202020202020000000fe
                004e3135364843412d4541420a2000b2
        PRIME Synchronization: 0 
                supported: 0, 1
        HDCP Content Type: HDCP Type0 
                supported: HDCP Type0, HDCP Type1
        Content Protection: Undesired 
                supported: Undesired, Desired, Enabled
        vrr_capable: 0 
                range: (0, 1)
        abm level: 0 
                range: (0, 4)
        max bpc: 16 
                range: (8, 16)
        underscan vborder: 0 
                range: (0, 128)
        underscan hborder: 0 
                range: (0, 128)
        underscan: off 
                supported: off, on, auto
        scaling mode: None 
                supported: None, Full, Center, Full aspect
        link-status: Good 
                supported: Good, Bad
        CONNECTOR_ID: 78 
                supported: 78
        non-desktop: 0 
                range: (0, 1)
   1920x1080     60.01*+  60.01    59.97    59.96    59.93  
   1680x1050     60.01    59.95    59.88  
   1400x1050     59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     60.01    60.02  
   1440x900      60.01  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1280x800      59.99    60.01    59.97    59.81    59.91  
   1280x720      60.00    60.01    59.99    59.86    59.74  
   1024x768      60.01    60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.01    60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   700x450       59.96    59.88  
   640x480       60.01    60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   640x400       59.88    59.98  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  

Modeset is enabled:

[root@blackfuture vektor]# cat /sys/module/nvidia_drm/parameters/modeset
Y

I can see this line on the xorg log

[  1290.461] randr: falling back to unsynchronized pixmap sharing

Here is the log while on nvidia only mode
https://gist.github.com/CygnusTerminal/ … 812943ac3a

Last edited by Vektor_98 (2021-10-09 17:43:59)

Offline

#20 2021-10-11 11:27:34

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Still unclear what's causing this, but linux 5.15 is supposed to have many amd related fixes, try https://aur.archlinux.org/packages/linux-mainline/ .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#21 2021-10-11 14:57:07

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

Lone_Wolf wrote:

Still unclear what's causing this, but linux 5.15 is supposed to have many amd related fixes, try https://aur.archlinux.org/packages/linux-mainline/ .

Thanks Lone_Wolf, hopefully upcoming kernels/nvidia drivers fix the issue!

Last edited by Vektor_98 (2021-10-13 19:45:48)

Offline

#22 2021-10-13 19:46:03

Vektor_98
Member
Registered: 2021-04-03
Posts: 24

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

EDIT
Well, after a test on Kubuntu, i'm... glad? To say that the tearing and stuttering/jittering issues i have on my Arch install are not present here. Everything works just as i remembered, on nvidia mode, haven't tested hybrid yet.
xorg log after playing a game:
https://gist.github.com/CygnusTerminal/ … a4b046ed71

Xorg version: 1.20.11 (12011000)

Kernel version: 5.11.0-37-generic

Nvidia driver version: 470.63.01

EDIT 2: Seems to be a regression on xorg. Today i clean-installed Kubuntu 21.10 and i am having the exact same issues as on Arch. I downgraded nvidia drivers, amd drivers, kernels and nothing helped.

Last edited by Vektor_98 (2021-10-16 00:20:25)

Offline

#23 2021-10-19 10:08:28

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: nvidia PRIME Synchronization on AMD iGPU (Ryzen 5 4600H) not working

[     5.353] (II) xfree86: Adding drm device (/dev/dri/card1)
[     5.376] (II) xfree86: Adding drm device (/dev/dri/card0)
[     5.389] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules"
[     5.389] (**) OutputClass "Nvidia Prime" ModulePath extended to "/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules"
[     5.389] (**) OutputClass "Nvidia Prime" setting /dev/dri/card1 as PrimaryGPU
[     5.390] (--) PCI:*(1@0:0:0) 10de:1f99:17aa:3a45 rev 161, Mem @ 0xd0000000/16777216, 0xfcc0000000/268435456, 0xfcd0000000/33554432, I/O @ 0x00004000/128, BIOS @ 0x????????/524288
[     5.390] (--) PCI: (5@0:0:0) 1002:1636:17aa:3a45 rev 199, Mem @ 0xfce0000000/268435456, 0xfcf0000000/2097152, 0xd1500000/524288, I/O @ 0x00001000/256

That log indicates X uses nvidia as primary card and doesn't mention prime synchronization .
I think optimus-manager tries to do something similar.

No idea why newer kubuntu has the same issue as archlinux , but I think it's time to try a static conf file.

try creating /etc/X11/xorg.conf.d/10-gpu.conf with this content :

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

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

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

Section "Device"
    Identifier "amd"
    Driver "modesetting"
    BusID "PCI:5@0:0:0"
EndSection

Section "Screen"
    Identifier "amd"
    Device "amd"
EndSection

It's part guesswork so may fail.
Post xorg log from a start with it.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB