You are not logged in.

#1 2019-08-10 23:27:33

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

[Solved] Prime Sync between dGPU Nvidia and iGPU Amd

HI, I got one amd laptop GA502 that have these two gpus

~inxi -G
Graphics:  Device-1: NVIDIA TU116M [GeForce GTX 1660 Mobile] driver: nvidia v: 430.40 
           Device-2: Advanced Micro Devices [AMD/ATI] Picasso driver: amdgpu v: kernel 
           Display: tty server: X.Org 1.20.5 driver: amdgpu resolution: 1920x1080~120Hz 
           OpenGL: renderer: AMD RAVEN (DRM 3.32.0 5.2.8-1-ck-zen LLVM 8.0.1) v: 4.5 Mesa 19.1.4 

I managed to configure nvidia-xrun, but I cannot make the modeset sync to work to get rid of the tearing.

When the nvidia_drm module loads, it correctly sets the modeset flag to "Y"

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

But looking at the journal logs I see this:

[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.

And in the .local/share/xorg/Xorg.1.log appears this line when the new xserver runs:

randr: falling back to unsynchronized pixmap sharing

When I run glxgears or any game there is no sync between nvidia and amd gpu's even if i reduce the fps in game to 60 or 120 it is noticeable the tearing.

If I do a xrandr --verbose I can see that Prime Sync is enabled only for the HDMI output and available for the eDP but not set:

eDP-1-0 connected 1920x1080+0+0 (0x46) normal (normal left inverted right x axis y axis) 344mm x 194mm
...
	PRIME Synchronization: 0 
		supported: 0, 1
...
HDMI-A-1-0 disconnected (normal left inverted right x axis y axis)
...
	PRIME Synchronization: 1 
		supported: 0, 1
...

I tried with "$xrandr --output eDP-1-0 --set "PRIME Synchronization" 1 " but there's no effect. 

This is my /etc/X11/nvidia-xorg.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/xorg/modules"
EndSection

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

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

Section "Screen"
  Identifier "nvidia"
  Device "nvidia"
  Monitor "Monitor0"
  Option "AllowEmptyInitialConfiguration" "True"
  Option "Coolbits" "28"
  Option "TripleBuffer" "true"
EndSection

Section "Device"
  Identifier "amdgpu"
  Driver "modesetting"
EndSection

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

Any advise what else can I test?, or maybe is not yet possible for this type of laptop configuration that is new and there is something to be develop on amdgpu/modeset/nvidia drivers.

EDIT: Solved with latest nvidia driver 450.51 BETA

Last edited by gnox (2020-06-24 15:46:30)

Offline

#2 2020-01-03 20:34:36

dxal34
Member
From: Россия
Registered: 2014-07-18
Posts: 7

Re: [Solved] Prime Sync between dGPU Nvidia and iGPU Amd

Hi!

I've been looking for a solution of just the same problem and encountered this post. After hours of research, I also found this, which didn't exist at the time you wrote this:
https://wiki.archlinux.org/index.php/NV … oken_VSync
The last paragraph in this section as of writing says that screen tearing with PRIME is expected with kernel 5.4. It also links to the discussion of this regression:
https://bbs.archlinux.org/viewtopic.php?id=251032
Is your kernel version 5.4?

Offline

#3 2020-04-16 17:44:00

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

Re: [Solved] Prime Sync between dGPU Nvidia and iGPU Amd

dxal34 wrote:

Hi!

I've been looking for a solution of just the same problem and encountered this post. After hours of research, I also found this, which didn't exist at the time you wrote this:
https://wiki.archlinux.org/index.php/NV … oken_VSync
The last paragraph in this section as of writing says that screen tearing with PRIME is expected with kernel 5.4. It also links to the discussion of this regression:
https://bbs.archlinux.org/viewtopic.php?id=251032
Is your kernel version 5.4?

Hi sorry the late reply, I tested with 5.4, 5.5, 5.6 and the only thing that reduce a lot the tearing is changing this section from "modesetting" to "amdgpu"

Section "Device"
  Identifier "amdgpu"
  Driver "amdgpu" #was modesetting
EndSection

But still there is some stuttering.

Offline

Board footer

Powered by FluxBB