PRIME and PRIME Synchronization
@rocha.ab: does setting the environment variable __GL_SYNC_DISPLAY_DEVICE help?
@rocha.ab: does setting the environment variable
__GL_SYNC_DISPLAY_DEVICE
help?

Posted 01/01/2018 08:59 PM   
What should I set it to?
What should I set it to?

Posted 01/01/2018 09:54 PM   
The connector name of the 144Hz monitor as seen in Xorg logs or xrandr, e.g. __GL_SYNC_DISPLAY_DEVICE=DFP-1
The connector name of the 144Hz monitor as seen in Xorg logs or xrandr, e.g.
__GL_SYNC_DISPLAY_DEVICE=DFP-1

Posted 01/01/2018 10:33 PM   
It didn't work. Thanks for the tip. But I'm not really willing to keep investigating it further. I'm gonna return the laptop and get another hardware. Thanks.
It didn't work.

Thanks for the tip. But I'm not really willing to keep investigating it further. I'm gonna return the laptop and get another hardware.

Thanks.

Posted 01/01/2018 11:15 PM   
I have this strange behaviour: I have a laptop with NVIDIA PRIME. modeset is enabled. The display supports frequencies from 20 to 100 hz in xrandr I have 1920x1080_100.00 99.90* where it is: 1920x1080_100.00 (0x225) 302.500MHz -HSync +VSync h: width 1920 start 2072 end 2280 total 2640 skew 0 clock 114.58KHz v: height 1080 start 1083 end 1088 total 1147 clock 99.90Hz but with glxgears I have 2 problems: 1) setting vsync in glsgears seems not to affect the ouput. 2) if I set PRIME SYNCHRONIZATION to 0, glgears goes over 20000 fps. Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 100395 frames in 5.0 seconds = 20078.984 FPS 102430 frames in 5.0 seconds = 20485.918 FPS 101681 frames in 5.0 seconds = 20336.127 FPS 3) if I set PRIME SYNCHRONIZATION to 1 (or anthing different than 0) I get 60 fps Does anybody know why it doesn't sync to 100hz? (same with other refresh rates)
I have this strange behaviour:

I have a laptop with NVIDIA PRIME.
modeset is enabled.
The display supports frequencies from 20 to 100 hz

in xrandr I have
1920x1080_100.00 99.90*

where it is:
1920x1080_100.00 (0x225) 302.500MHz -HSync +VSync
h: width 1920 start 2072 end 2280 total 2640 skew 0 clock 114.58KHz
v: height 1080 start 1083 end 1088 total 1147 clock 99.90Hz

but with glxgears I have 2 problems:
1) setting vsync in glsgears seems not to affect the ouput.
2) if I set PRIME SYNCHRONIZATION to 0, glgears goes over 20000 fps.

Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
100395 frames in 5.0 seconds = 20078.984 FPS
102430 frames in 5.0 seconds = 20485.918 FPS
101681 frames in 5.0 seconds = 20336.127 FPS

3) if I set PRIME SYNCHRONIZATION to 1 (or anthing different than 0) I get 60 fps

Does anybody know why it doesn't sync to 100hz? (same with other refresh rates)

Posted 01/08/2018 01:35 PM   
@Zibri_ This might also depend on the compositor you are using, e.g. compiz can be manually set with ccsm or mutter with CLUTTER_DEFAULT_FPS. See what happens if you run glxgears fullscreen glxgears -fullscreen Also try with plain X. Create a file ~/.xinitrc containing [code]xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto xterm & exec xterm [/code] Switch to VT, then run startx -- :5 You should get an X screen with xterms. There, run glxgears again.
@Zibri_
This might also depend on the compositor you are using, e.g. compiz can be manually set with ccsm or mutter with CLUTTER_DEFAULT_FPS. See what happens if you run glxgears fullscreen
glxgears -fullscreen
Also try with plain X. Create a file ~/.xinitrc containing
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xterm &
exec xterm

Switch to VT, then run
startx -- :5
You should get an X screen with xterms. There, run glxgears again.

Posted 01/09/2018 10:08 AM   
PRIME Synchronization doesn't work with linux 4.15. All previous kernel and driver versions work as expected, but PRIME sync can't be enabled with any driver version combined with linux 4.15. [code]xrandr --output VGA-1-1 --set "PRIME Synchronization" 1[/code] causes the screen to flicker for a second but nothing changes. [code]xrandr --prop | grep PRIME PRIME Synchronization: 0 sudo cat /sys/module/nvidia_drm/parameters/modeset Y[/code]
PRIME Synchronization doesn't work with linux 4.15. All previous kernel and driver versions work as expected, but PRIME sync can't be enabled with any driver version combined with linux 4.15.

xrandr --output VGA-1-1 --set "PRIME Synchronization" 1

causes the screen to flicker for a second but nothing changes.


xrandr --prop | grep PRIME
PRIME Synchronization: 0

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

Posted 01/31/2018 09:05 AM   
I've lately switched to Debian 9 from Ubuntu 17.10, and had a hard time setting up PRIME Sync for my system. But thanks to this post, it's finally working flawlessly. Thanks, yalniz! Kernel: 4.9.0-5-amd64 Xorg: 1.19.2 Nvidia Driver: 375.82 [quote="yalniz"]I finally solved I installed Debian and I use it without problems There is absolutely no freezing Kernel: 4.9.0-2-amd64 Xorg: 1.19.2 Nvidia Driver: 375.26 Step 1: I followed the instructions from the xrandr guide from the latest driver (375.26) link: http://us.download.nvidia.com/XFree86/Linux-x86_64/375.26/README/randr14.html [code]/etc/X11/xorg.conf[/code] [code] Section "ServerLayout" Identifier "layout" Screen 0 "nvidia" Inactive "intel" EndSection Section "Device" Identifier "nvidia" Driver "nvidia" BusID "PCI:1:0:0" EndSection Section "Screen" Identifier "nvidia" Device "nvidia" Option "AllowEmptyInitialConfiguration" EndSection Section "Device" Identifier "intel" Driver "modesetting" BusID "PCI:0:2:0" Option "AccelMethod" "none" EndSection Section "Screen" Identifier "intel" Device "intel" EndSection[/code] Some versions of the “modesetting” driver try to load a sub-module called “glamor”, which conflicts with the NVIDIA GLX implementation. Please ensure that the libglamoregl.so X module is not installed.As my xorg server package includes the glamor driver, I added the option "AccelMethod" "none" for the Intel driver. Step 2:Added the xrandr lines to GDM config For the GDM display manager create two new .desktop files: [code]/usr/share/gdm/greeter/autostart/optimus.desktop /etc/xdg/autostart/optimus.desktop[/code] [code][Desktop Entry] Type=Application Name=Optimus Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto" NoDisplay=true X-GNOME-Autostart-Phase=DisplayServer[/code] Step 3:Added on the menu grub the option : nvidia-drm.modeset=1 Code: [code]/etc/default/grub[/code] [code]GRUB_CMDLINE_LINUX_DEFAULT="quiet nvidia-drm.modeset=1 acpi_osi="[/code] [code]sudo update-grub2[/code] .after..reboot [/quote]
I've lately switched to Debian 9 from Ubuntu 17.10, and had a hard time setting up PRIME Sync for my system. But thanks to this post, it's finally working flawlessly. Thanks, yalniz!

Kernel: 4.9.0-5-amd64
Xorg: 1.19.2
Nvidia Driver: 375.82

yalniz said:I finally solved
I installed Debian and I use it without problems
There is absolutely no freezing


Kernel: 4.9.0-2-amd64
Xorg: 1.19.2
Nvidia Driver: 375.26


Step 1: I followed the instructions from the xrandr guide from the latest driver (375.26)

link: http://us.download.nvidia.com/XFree86/Linux-x86_64/375.26/README/randr14.html

/etc/X11/xorg.conf


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

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

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

Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
Option "AccelMethod" "none"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
EndSection


Some versions of the “modesetting” driver try to load a sub-module called “glamor”, which conflicts with the NVIDIA GLX implementation. Please ensure that the libglamoregl.so X module is not installed.As my xorg server package includes the glamor driver, I added the option "AccelMethod" "none" for the Intel driver.


Step 2:Added the xrandr lines to GDM config

For the GDM display manager create two new .desktop files:

/usr/share/gdm/greeter/autostart/optimus.desktop
/etc/xdg/autostart/optimus.desktop


[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer





Step 3:Added on the menu grub the option : nvidia-drm.modeset=1

Code:
/etc/default/grub


GRUB_CMDLINE_LINUX_DEFAULT="quiet nvidia-drm.modeset=1 acpi_osi="




sudo update-grub2



.after..reboot

Posted 02/02/2018 09:06 PM   
Hello! When Prime Sync enabled i got an strange lags and freezes in Chrome and Steam when scrolling page. Tested on 390.25 or 387.34 My distro: Ubuntu Mate 16.04.3 Kenel:4.13.0-32 Xorg: 1.19.3 Here my hardware: [code]00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)[/code] I've got error in kern.log [code]nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device VGA-0[/code] But i don't have this output in xrandr and i only use laptop display LVDS: [code]Screen 0: minimum 8 x 8, current 1366 x 768, maximum 16384 x 16384 LVDS-1-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm 1366x768 60.00*+ 1360x768 59.80 59.96 1024x768 60.04 60.00 960x720 60.00 928x696 60.05 896x672 60.01 960x600 60.00 960x540 59.99 800x600 60.00 60.32 56.25 840x525 60.01 59.88 800x512 60.17 700x525 59.98 640x512 60.02 720x450 59.89 640x480 60.00 59.94 680x384 59.80 59.96 576x432 60.06 512x384 60.00 400x300 60.32 56.34 320x240 60.05 VGA-1-1 disconnected (normal left inverted right x axis y axis) HDMI-1-1 disconnected (normal left inverted right x axis y axis) DP-1-1 disconnected (normal left inverted right x axis y axis)[/code] in xorg.log: [code][ 8430.952] (--) NVIDIA(GPU-0): CRT-0: connected [ 8430.952] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 8430.952] (--) NVIDIA(GPU-0): [ 8439.311] (--) NVIDIA(GPU-0): CRT-0: connected [ 8439.311] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 8439.311] (--) NVIDIA(GPU-0): [ 8439.313] (--) NVIDIA(GPU-0): CRT-0: connected [ 8439.313] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 8439.313] (--) NVIDIA(GPU-0): [ 9388.877] (--) NVIDIA(GPU-0): CRT-0: connected [ 9388.877] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 9388.877] (--) NVIDIA(GPU-0): [ 9388.879] (--) NVIDIA(GPU-0): CRT-0: connected [ 9388.879] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 9388.879] (--) NVIDIA(GPU-0): [ 9548.529] (--) NVIDIA(GPU-0): CRT-0: connected [ 9548.529] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 9548.529] (--) NVIDIA(GPU-0): [ 9548.531] (--) NVIDIA(GPU-0): CRT-0: connected [ 9548.531] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 9548.531] (--) NVIDIA(GPU-0): [ 11859.871] (--) NVIDIA(GPU-0): CRT-0: connected [ 11859.876] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 11859.876] (--) NVIDIA(GPU-0): [ 11859.878] (--) NVIDIA(GPU-0): CRT-0: connected [ 11859.878] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock [ 11859.878] (--) NVIDIA(GPU-0): [/code] and in nvidia-setting in section GPU 0 - Geforce GT 540 M there weird output VGA-0 (CRT-0) Here a screen [url]https://drive.google.com/open?id=15KArGe_Kf2TYTe5pi5IWWefw3SkaYDhx[/url] [code]xrandr --prop | grep PRIME PRIME Synchronization: 1 PRIME Synchronization: 1 PRIME Synchronization: 1 PRIME Synchronization: 1 [/code] [code]sudo cat /sys/module/nvidia_drm/parameters/modeset Y[/code] Someone could help with this situation?
Hello!

When Prime Sync enabled i got an strange lags and freezes in Chrome and Steam when scrolling page. Tested on 390.25 or 387.34

My distro: Ubuntu Mate 16.04.3
Kenel:4.13.0-32
Xorg: 1.19.3

Here my hardware:

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)


I've got error in kern.log

nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device VGA-0

But i don't have this output in xrandr and i only use laptop display LVDS:
Screen 0: minimum 8 x 8, current 1366 x 768, maximum 16384 x 16384
LVDS-1-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.00*+
1360x768 59.80 59.96
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
960x600 60.00
960x540 59.99
800x600 60.00 60.32 56.25
840x525 60.01 59.88
800x512 60.17
700x525 59.98
640x512 60.02
720x450 59.89
640x480 60.00 59.94
680x384 59.80 59.96
576x432 60.06
512x384 60.00
400x300 60.32 56.34
320x240 60.05
VGA-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)


in xorg.log:

[  8430.952] (--) NVIDIA(GPU-0): CRT-0: connected
[ 8430.952] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 8430.952] (--) NVIDIA(GPU-0):
[ 8439.311] (--) NVIDIA(GPU-0): CRT-0: connected
[ 8439.311] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 8439.311] (--) NVIDIA(GPU-0):
[ 8439.313] (--) NVIDIA(GPU-0): CRT-0: connected
[ 8439.313] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 8439.313] (--) NVIDIA(GPU-0):
[ 9388.877] (--) NVIDIA(GPU-0): CRT-0: connected
[ 9388.877] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 9388.877] (--) NVIDIA(GPU-0):
[ 9388.879] (--) NVIDIA(GPU-0): CRT-0: connected
[ 9388.879] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 9388.879] (--) NVIDIA(GPU-0):
[ 9548.529] (--) NVIDIA(GPU-0): CRT-0: connected
[ 9548.529] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 9548.529] (--) NVIDIA(GPU-0):
[ 9548.531] (--) NVIDIA(GPU-0): CRT-0: connected
[ 9548.531] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 9548.531] (--) NVIDIA(GPU-0):
[ 11859.871] (--) NVIDIA(GPU-0): CRT-0: connected
[ 11859.876] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 11859.876] (--) NVIDIA(GPU-0):
[ 11859.878] (--) NVIDIA(GPU-0): CRT-0: connected
[ 11859.878] (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock
[ 11859.878] (--) NVIDIA(GPU-0):


and in nvidia-setting in section GPU 0 - Geforce GT 540 M there weird output VGA-0 (CRT-0)
Here a screen https://drive.google.com/open?id=15KArGe_Kf2TYTe5pi5IWWefw3SkaYDhx

xrandr --prop | grep PRIME
PRIME Synchronization: 1
PRIME Synchronization: 1
PRIME Synchronization: 1
PRIME Synchronization: 1


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



Someone could help with this situation?

Posted 02/18/2018 08:31 AM   
Hello! Lately I've been experimenting with a simple solution to get some basic prime-select function in Debian 9. PRIME Sync is working as expected (see #323). What I'm trying to do is a scripted version of aforementioned tutorial. It is very simple, just some rm, cp and mv commands, I will post it when it works. My problem is that even though I even remove the nvidia-driver package from the system, I still can't get it to load GDM. It hangs on boot and the screen flickers, I can't even log in to the CLI, because it doesn't always get what I'm typing. When this happens, the same happens to the recovery mode too, so a reinstall is needed. Experimenting is not a problem on this system, but I hope someone here could give me a pointer or two, what else is needed to be done for the Intel GPU to take over again and let the Xserver start. I've checked, if anything conflicts with the nvidia-driver package, but apt says that "0 upgraded, 41 newly installed, 0 to remove and 0 not upgraded", which is supposed to mean that when nvidia-driver is removed and the config files as well as grub are rolled back to stock, it should be working. Thanks for your input in advance!
Hello!

Lately I've been experimenting with a simple solution to get some basic prime-select function in Debian 9. PRIME Sync is working as expected (see #323). What I'm trying to do is a scripted version of aforementioned tutorial. It is very simple, just some rm, cp and mv commands, I will post it when it works.

My problem is that even though I even remove the nvidia-driver package from the system, I still can't get it to load GDM. It hangs on boot and the screen flickers, I can't even log in to the CLI, because it doesn't always get what I'm typing. When this happens, the same happens to the recovery mode too, so a reinstall is needed. Experimenting is not a problem on this system, but I hope someone here could give me a pointer or two, what else is needed to be done for the Intel GPU to take over again and let the Xserver start.

I've checked, if anything conflicts with the nvidia-driver package, but apt says that "0 upgraded, 41 newly installed, 0 to remove and 0 not upgraded", which is supposed to mean that when nvidia-driver is removed and the config files as well as grub are rolled back to stock, it should be working.

Thanks for your input in advance!

Posted 02/22/2018 10:27 AM   
[quote=""]Hello! It hangs on boot and the screen flickers, I can't even log in to the CLI, because it doesn't always get what I'm typing. [/quote] I suspect this is just the effect of the Xserver not starting, then systemd is restarting it over and over again in fast succession and only gives up after 90-120 seconds. So simply wait for two minutes, then you're able to log in on console and run nvidia-bug-report.sh or check your dmesg and logs.
said:Hello!
It hangs on boot and the screen flickers, I can't even log in to the CLI, because it doesn't always get what I'm typing.

I suspect this is just the effect of the Xserver not starting, then systemd is restarting it over and over again in fast succession and only gives up after 90-120 seconds. So simply wait for two minutes, then you're able to log in on console and run nvidia-bug-report.sh or check your dmesg and logs.

Posted 02/22/2018 10:54 AM   
PRIME Synchronization doesn't work with linux-kernel 4.15.
PRIME Synchronization doesn't work with linux-kernel 4.15.

Posted 02/23/2018 06:20 PM   
[quote=""] PRIME Synchronization doesn't work with linux-kernel 4.15. [/quote] 4.15 works for me. Have you enabled modesetting? What distro and configuration are you using?
said: PRIME Synchronization doesn't work with linux-kernel 4.15.

4.15 works for me. Have you enabled modesetting? What distro and configuration are you using?

Posted 02/27/2018 11:32 PM   
The plain driver as provided by nvidia does not work with kernel 4.15 in regard to drm kms/Prime sync. A patch is available in this forum, Arch and some other distros incorporate that, others not.
The plain driver as provided by nvidia does not work with kernel 4.15 in regard to drm kms/Prime sync. A patch is available in this forum, Arch and some other distros incorporate that, others not.

Posted 02/28/2018 10:32 AM   
Would it possible to add some configuration so you could run on the performance mode PRIME profile while having a minimum of power saving on battery? It would make the experience so much better!
Would it possible to add some configuration so you could run on the performance mode PRIME profile while having a minimum of power saving on battery? It would make the experience so much better!

Posted 03/21/2018 12:50 PM   
Scroll To Top

Add Reply