- make sure you are not using multiple monitors
- make sure you are not using a Retina monitor (not sure if other high resolution monitors have the same issue)
- it's Microsoft's fault. Use Linux.
Psychtoolbox - InvalidWindowRecord on Windows 7
8 views (last 30 days)
Show older comments
Hello everyone,
I'm currently trying to run a Script written in psychtoolbox (which works perfectly fine on my Mac Computer) on a Windows 7 computer and constantly get the following error message:
PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.14 - Build date: Oct 3 2017).
PTB-INFO: Support status on this operating system release: Windows version 6.1 partially supported, but no longer tested at all.
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: Will disable DWM because a regular fullscreen onscreen window is opened -> We want best timing and performance.
PTB-WARNING: Created onscreen window on screenid 0 will probably not be able to use GPU pageflipping for
PTB-WARNING: Screen('Flip')! May cause tearing artifacts and unreliable or wrong visual stimulus onset timestamping!
PTB-WARNING: Created onscreen window on screenid 0 will probably not be able to use GPU pageflipping for
PTB-WARNING: Screen('Flip')! May cause tearing artifacts and unreliable or wrong visual stimulus onset timestamping!
PTB-WARNING: Couldn't even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug, or a temporary timing problem. Retrying the procedure might help if
PTB-WARNING: the latter is the culprit.
WARNING: VBL Calibration run No. 1 failed. Retrying...
PTB-WARNING: Couldn't even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug, or a temporary timing problem. Retrying the procedure might help if
PTB-WARNING: the latter is the culprit.
WARNING: VBL Calibration run No. 2 failed. Retrying...
WARNING: Will enable VBL busywait-workaround before trying final VBL Calibration run No. 3.
WARNING: This will hopefully work-around graphics driver bugs of the GPU sync-to-retrace mechanism. Cross your fingers!
PTB-INFO: OpenGL-Renderer is S3 Graphics, Incorporated :: S3 Graphics Chrome9 HC :: 1.4 21.05.01h
PTB-INFO: VBL startline = 1050 , VBL Endline = 1051
PTB-INFO: Measured monitor refresh interval from beamposition = 16.702750 ms [59.870381 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.688155 ms [59.922743 Hz]. (50 valid samples taken, stddev=0.086903 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.
PTB-ERROR: Texture creation failed or malfunctioned for a texture of requested size w x h = 375 x 500 texels
PTB-ERROR: and at least 4 bytes VRAM memory consumption per texel.
PTB-ERROR: Currently there are already 1 textures, offscreen windows, movies or proxies open.
PTB-ERROR: All these objects consume system memory and could lead to ressource shortage.
PTB-ERROR: My current (rough and probably way too low) estimate is that at least 0.000000 MB of memory are
PTB-ERROR: consumed for textures, offscreen windows and similar objects.
PTB-ERROR: Another cause of failure could be that your graphics hardware doesn't have sufficient amounts of
PTB-ERROR: free VRAM memory. Try to reduce the precision and/or size of your texture image to the lowest
PTB-ERROR: acceptable setting for your purpose.
PTB-ERROR: Read the online help for Screen MakeTexture? or Screen OpenOffscreenWindow? for information
PTB-ERROR: about how to reduce the number of color channels and/or precision of the texture.
PTB-ERROR: It may also help to reduce general VRAM memory consumption:
PTB-ERROR: Reduce the display resolution to the smallest acceptable resolution or disable the 2nd
PTB-ERROR: display of a dual-display setup if it isn't strictly needed for your study.
PTB-ERROR: Other than that you could upgrade to more powerful graphics hardware (more VRAM) or try to split
PTB-ERROR: your oversized image into multiple separate subimages and draw them sequentially to the screen.
PTB-ERROR: That way you'll be able to draw larger images, albeit at drastically lowered performance and more
PTB-ERROR: coding hazzle.
Error in function MakeTexture: Usage error
Texture creation failed, most likely due to unsupported precision or insufficient free memory.
WARNING: This session of your experiment was run by you with the setting Screen('Preference', 'SkipSyncTests', 1).
WARNING: This means that some internal self-tests and calibrations were skipped. Your stimulus presentation timing
WARNING: may have been wrong. This is fine for development and debugging of your experiment, but for running the real
WARNING: study, please make sure to set Screen('Preference', 'SkipSyncTests', 0) for maximum accuracy and reliability.
INTERNAL PSYCHTOOLBOX ERROR
error: PsychError_InvalidWindowRecord
general description: An Invalid window record was referenced.
module name: Screen
subfunction call: WindowKind
file name: COMMON\SCREEN\WindowHelpers.c
function name: PsychCheckIfWindowRecordIsValid
line number: 61
Error using Screen
See error message printed above.
Error in sca (line 22)
if Screen('WindowKind', win) == 1
Error in Pretest_Letizia (line 417)
sca; % close all screens, i.e. show the desktop/GUI again
I am very new to Matlab so I have a lot of trouble figuring out what the problem behind the error message is. I already tried to reduce the size of the picture that is shown at the beginning of the task but that doesn't seem to be the problem.
These are the parts of my script in which I specify the Screen parameters:
%%1. Prepare computer for PTB usage
% call some default settings for setting up Psychtoolbox
PsychDefaultSetup(2);
% seed the random number generator
rand('seed', sum(100 * clock)); %rng('shuffle')
% skip SyncTests to avoid error messages due to non-optimal timing
sca; % close all open screens (short for Screen('CloseAll'))
Screen('Preference', 'SkipSyncTests', 1);
%%5. PTB Screen Preparation
% Get the screen numbers
screens = Screen('Screens');
% Draw to the external screen if avaliable
screenNumber = max(screens);
% screenNumber = 0; % to show on laptop screen
% Define colors
white = WhiteIndex(screenNumber);
black = BlackIndex(screenNumber);
% Open an on screen window
[window, windowRect] = PsychImaging('OpenWindow', screenNumber, black);
% Get the centre coordinate of the window
[xC, yC] = RectCenter(windowRect);
% Get the size of the on screen window in pixels
[screenXpixels, screenYpixels] = Screen('WindowSize', window);
if screenXpixels > 1500
smallScreen = 0;
elseif screenXpixels <= 1500
smallScreen = 1; % to adjust some layout parameters
end
% Set the blend function for the screen (allows transparency)
Screen('BlendFunction', window, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');
% prevents keys you pressed during the experiment to show up in Matlab
ListenChar(2);
% hide the mouse cursor
HideCursor;
Has anyone experienced a similar problem on Windows 7 and could help me?
Thanks a lot in advance!
2 Comments
Walter Roberson
on 12 Feb 2018
tl;dr :
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!