Hi Lilian,
Lilian:
Dear PTB community,
I started using PTB (version 3.0.14 debian package on octave version 4.2.2) with linux ubuntu 18.04 with low latency kernel and two X screens and it seems that PTB has trouble with my GPU (GeForce GTX 1650 nvidia). The correct driver is installed (NVIDIA 440.100) and I used XOrgConfCreator and XOrgConfSelector to set up my screens, but it seems that the output mapping of my screens by PTB is wrong and results in the following errors/problems. Both screens have a 60 Hz refresh rate and my primary screen (X-Screen 0) is connected to the display port and my secondary screen (X-screen 1), which I use to show my stimuli, is connected to the HDMI port.
The first problem I have is that PTB does not recognize the Nvidia chipset (Unknown NVidia chipset 0x167000a1 - Assuming latest generation). I couldn’t really find what this means and how to solve this, so any suggestions are welcome.
Your Psychtoolbox is way too old to recognize your graphics card. Updating to the latest 3.0.16 beta for Octave from NeuroDebian should solve that:
http://neuro.debian.net/pkgs/octave-psychtoolbox-3.html#pkg-octave-psychtoolbox-3
I have the same GTX1650 is my most modern NVidia card, so i know that it works with current PTB at least on Ubuntu 20.04-LTS. Ie. timestamping is fine and accurate, timing is usually fine.
Another problem is that the mapping of my GPU outputs to CRTC’s seems to be wrong. I’ve checked and my nvidia GPU is the only one in use, so the problem cannot be related to a multi-GPU system. I have therefore tried to circumvent the problem by adding Screen(‘Preference’, ‘ScreenToHead’, 0, 2, 2, 0) and Screen(‘Preference’, ‘ScreenToHead’, 1, 1, 1, 0) to the top of my script, but everytime I run my script it seems that it falls back into the default settings and seems to ignore my manual rewiring attempt. My GPU has 3 outputs and 3 CRTC’s and I believe that my X-Screen 0 is connected to the last output and that X-screen 1 is attached to the middle output. I have tried several combinations of ScreenToHead, but all end up in the same first two output lines when I run my script and somehow seems to fall back into default settings after I call for any kind of Screen function (e.g. SkipSynchTest or Openwindow):
PTB-INFO: Display ':0.0' : X-Screen 0 : Assigning primary output as 1 with RandR-CRTC 0 and GPU-CRTC 0.
PTB-INFO: Display ':0.0' : X-Screen 1 : Assigning primary output as 0 with RandR-CRTC 0 and GPU-CRTC 1.)
Maybe the problem resolves itself after the PTB update. Otherwise, the proper mapping is probably one that only changes the index of the display engine, what is called GPU-CRTC in that output e.g., something like
Screen(‘Preference’, ‘ScreenToHead’, 0, 0, 1);
Screen(‘Preference’, ‘ScreenToHead’, 1, 0, 0);
Usually the 3rd number is what goes wrong as it can’t be auto-detected by PTB on NVidia hardware, and so it uses a heuristic that may or may not be right for any given setup.
Sometimes PTB takes 50 valid samples when it calculates the refresh rate interval even though it throws me the warning that the beamposition queries are unsupported or defective on my system and then runs my script without skipping frames, but then sometimes it says that it cannot compute the refresh rate and takes up to 299 samples and shows that it will fall back into basic timestamping mode. This then results in the ----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! ---- error.
Below the output when I run my script:
>> LE_RandomDotsTask
PTB-INFO: Display ':0.0' : X-Screen 0 : Assigning primary output as 1 with RandR-CRTC 0 and GPU-CRTC 0.
PTB-INFO: Display ':0.0' : X-Screen 1 : Assigning primary output as 0 with RandR-CRTC 0 and GPU-CRTC 1.
PTB-INFO: A total of 2 X-Windows display screens is available for use.
PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under GNU/Octave 64-Bit (Version 3.0.14 - Build date: Jun 26 2017).
PTB-INFO: Support status on this operating system release: Linux 4.15.0-108-lowlatency Supported.
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.
PTB-INFO: NVIDIA Corporation - (null) GPU found. Trying to establish low-level access...
PTB-DEBUG: Unknown NVidia chipset 0x167000a1 - Assuming latest generation.
PTB-INFO: Connected to NVidia (null) GPU of NV-000 family with 4 display heads. Beamposition
PTB-WARNING: Hang in beamposition query detected! Seems my mapping of screen numbers to GPU's and display outputs is wrong?
PTB-WARNING: In a single GPU system you can resolve this by plugging in your monitors in a different order, changing the
PTB-WARNING: display arrangement in the control panel, or using the Screen('Preference', 'ScreenToHead', ...);
PTB-WARNING: command at the top of your scripts to set the mapping manually. See 'help DisplayOutputMappings' for more info.
PTB-WARNING:
PTB-WARNING: I am not yet able to handle multi-GPU systems reliably at all. If you have such a system it may work if
PTB-WARNING: you plug your monitor(s) into one of the other GPU's output connectors, trying different combinations.
PTB-WARNING: Or you simply live without high precision stimulus onset timestamping for now. Or you use the free and open-source
PTB-WARNING: graphics drivers (intel, radeon, or nouveau) instead of the proprietary Catalyst or NVidia binary drivers.
PTB-WARNING: I've disabled high precision timestamping for this screen for the remainder of the session.
PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: GeForce GTX 1650/PCIe/SSE2 :: 4.6.0 NVIDIA 440.100
PTB-INFO: VBL startline = 1080 , VBL Endline = -1
PTB-INFO: Beamposition queries unsupported or defective on this system. Using basic timestamping as fallback: Timestamps returned by Screen('Flip') will be less robust and accurate.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.665435 ms [60.004435 Hz]. (299 valid samples taken, stddev=0.468491 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
WARNING: Couldn't compute a reliable estimate of monitor refresh interval! Trouble with VBL syncing?!?
----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! ----
One or more internal checks (see Warnings above) indicate that synchronization
of Psychtoolbox to the vertical retrace (VBL) is not working on your setup.
This will seriously impair proper stimulus presentation and stimulus presentation timing!
Please read 'help SyncTrouble' for information about how to solve or work-around the problem.
You can force Psychtoolbox to continue, despite the severe problems, by adding the command
Screen('Preference', 'SkipSyncTests', 1); at the top of your script, if you really know what you are doing.
Although the mapping from GPU to PTB seems to be off, it does run the VBLSynchtest without skipping a frame.
Given that the diagnostics of VBLSyncTest relies on precise timestamps and you don’t have these with the broken timestamping, VBLSyncTest may miss problems.
Timing should work out of the box on the standard GNOME or Ubuntu desktop setup if i remember correctly. On KDE with a multi-display setup you may need to disable the compositor, e.g., SHIFT+ALT+F12, or change the setting in the KDE control center.
If it doesn’t work consistently out of the box then either it is some temporary system overload/timing jitter, or some NVidia proprietary graphics driver bug or incompatibility and there isn’t anything we could do about it. Maybe upgrade/downgrade the driver and hope for the best? Maybe upgrade to Ubuntu 20.04-LTS and hope for the best? Seems to work on my 20.04-LTS system with the 445.something driver.
Yes, they are discouraged, exactly because of the kind of problems you see, which are non-issues on gpu’s with open-source driver like AMD for high-performance/functionality needs and Intel for more modest performance/functionality needs.
Discrete graphics cards like yours are easily swappable, and finding a suitable replacement from AMD would likely cost less than 200 Euros. In the end it is a question of how much your time and productivity is worth to you or your employer/lab leader. By using a card with proprietary driver, you are depriving yourself of half the advantage of switching to Linux in the first place. At least you will still get better diagnostics even with NVidia on Linux, so you can’t as easily fool yourself into corrupted data collection as on Windows, or even worse on Apples macOS trainwreck.
best,
-mario
I already went over the recommendations in the “BeampositionQueries”, “DisplayOutputMappings” and consulted several online platforms but I didn’t find the right solution yet, so any suggestions are very much appreciated.
Thanks!
Lilian