Skip to content

Commit

Permalink
Merge pull request #768 from kleinerm/master
Browse files Browse the repository at this point in the history
Psychtoolbox 3.0.18.10 pull.

A minor update for macOS Octave compatibility, help/status text updates and to mention our new user survey.

## General:

- Reword text for our new commercial support.
- Add a mention of our ongoing user survey 2022, ask for participation.

## macOS:

- Rebuild 64-Bit Octave mex files so that they should work on both Octave-6.3/6.4 and the new Octave-7.1 from HomeBrew.
- Minor improvements to ``Screen()`` status messages.

## Linux:

- Update some help texts wrt. hybrid graphics support. Some more configurations are verified to work with proper timing, e.g., AMD iGPU + NVidia dGPU Optimus style.
- Update ``help PsychLinuxConfiguration``.
  • Loading branch information
kleinerm committed May 22, 2022
2 parents 7547ada + 1901ff3 commit 9449b84
Show file tree
Hide file tree
Showing 36 changed files with 163 additions and 61 deletions.
12 changes: 6 additions & 6 deletions PsychSourceGL/Source/Common/PsychVulkanCore/PsychVulkan.c
Expand Up @@ -246,7 +246,7 @@ PFN_vkAcquireNextImageKHR fpAcquireNextImageKHR;
PFN_vkQueuePresentKHR fpQueuePresentKHR;
PFN_vkGetRefreshCycleDurationGOOGLE fpGetRefreshCycleDurationGOOGLE = NULL;
PFN_vkGetPastPresentationTimingGOOGLE fpGetPastPresentationTimingGOOGLE = NULL;
#ifdef VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR
#ifdef VK_KHR_present_id
PFN_vkWaitForPresentKHR fpWaitForPresentKHR = NULL;
#else
#warning VK_KHR_PRESENT_ID extension not supported by ancient build system. Update the Vulkan SDK headers to at least SDK 1.2.189
Expand Down Expand Up @@ -494,7 +494,7 @@ psych_bool checkAndRequestDeviceExtensions(VkPhysicalDevice* gpus, int gpuIndex,
}

if (hasWait) {
#ifdef VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR
#ifdef VK_KHR_present_id
*hasWait = addDeviceExtension(deviceExtensions, deviceExtensionsCount, VK_KHR_PRESENT_WAIT_EXTENSION_NAME);
*hasWait &= addDeviceExtension(deviceExtensions, deviceExtensionsCount, VK_KHR_PRESENT_ID_EXTENSION_NAME);
#else
Expand Down Expand Up @@ -899,7 +899,7 @@ void PsychVulkanCheckInit(psych_bool dontfail)
GET_INSTANCE_PROC_ADDR(vulkanInstance, GetPastPresentationTimingGOOGLE);
}

#ifdef VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR
#ifdef VK_KHR_present_id
// Ability to wait for present completion via VK_KHR_present_wait extension:
if (hasWait && !fpWaitForPresentKHR)
GET_INSTANCE_PROC_ADDR(vulkanInstance, WaitForPresentKHR);
Expand Down Expand Up @@ -930,7 +930,7 @@ void PsychVulkanCheckInit(psych_bool dontfail)
.flags = 0,
};

#ifdef VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR
#ifdef VK_KHR_present_id
VkPhysicalDevicePresentIdFeaturesKHR presentIdFeatureEnable = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR,
.pNext = NULL,
Expand Down Expand Up @@ -2561,7 +2561,7 @@ psych_bool PsychPresent(PsychVulkanWindow* window, double tWhen, unsigned int ti
};

// VK_KHR_PRESENT_ID supported?
#ifdef VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR
#ifdef VK_KHR_present_id
if (vulkan->hasWait && (timestampMode > 0)) {
// Assign present id - the current frameIndex:
VkPresentIdKHR presentIdInfo = {
Expand Down Expand Up @@ -2666,7 +2666,7 @@ psych_bool PsychPresent(PsychVulkanWindow* window, double tWhen, unsigned int ti
// Should we timestamp (imminent) stimulus onset?
if (timestampMode > 0) {
// Wait for present completion supported?
#ifdef VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR
#ifdef VK_KHR_present_id
if (vulkan->hasWait) {
// Blocking wait with timeout of 1 second for present completion of the just-queued present:
result = fpWaitForPresentKHR(vulkan->device, window->swapChain, targetPresentId, 1e9);
Expand Down
4 changes: 2 additions & 2 deletions PsychSourceGL/Source/Common/Screen/PsychWindowSupport.c
Expand Up @@ -164,7 +164,7 @@ double PsychGetVblankTimestamps(PsychWindowRecordType *windowRecord, double *vbl
if (vbl_endline == -1 || currentrefreshestimate <= 0.0)
return(-1);

beamPosAtFlip = PsychGetDisplayBeamPosition((CGDirectDisplayID) NULL, windowRecord->screenNumber);
beamPosAtFlip = PsychGetDisplayBeamPosition((CGDirectDisplayID) 0, windowRecord->screenNumber);
PsychGetAdjustedPrecisionTimerSeconds(&time_at_vbl);

// Failed / Unsupported?
Expand Down Expand Up @@ -372,7 +372,7 @@ psych_bool PsychOpenOnscreenWindow(PsychScreenSettingsType *screenSettings, Psyc
printf("PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.\n");
printf("PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with\n");
printf("PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.\n\n");
printf("PTB-INFO: For information about paid support, community membership and commercial services, please type\n");
printf("PTB-INFO: For information about paid support, support memberships and other commercial services, please type\n");
printf("PTB-INFO: 'PsychPaidSupportAndServices'.\n\n");
}

Expand Down
4 changes: 2 additions & 2 deletions PsychSourceGL/Source/Linux/Screen/PsychWindowGlue.c
Expand Up @@ -1961,8 +1961,8 @@ psych_bool PsychOSEnableX11ClientCompositorSync(PsychWindowRecordType *windowRec
// Compositor supports extended sync. Announce our opt-in to the protocol:
if (PsychPrefStateGet_Verbosity() > 2) {
printf("PTB-INFO: X11-Compositor supports extended client-compositor sync for better timing. Enabling *highly experimental, only lightly tested, limited* support.\n");
printf("PTB-INFO: Things that will malfunction or hang: Use of multiple simultaneous windows, async flips, frame sequential stereo, VRR, flip events, maybe NVidia\n");
printf("PTB-INFO: cards with proprietary driver. Correct presentation timing and timestamping is somewhat likely, but not stringently verified yet! Tread carefully!\n");
printf("PTB-INFO: Things that will malfunction or hang: Use of multiple simultaneous windows, async flips, frame sequential stereo, VRR, flip events.\n");
printf("PTB-INFO: Correct presentation timing and timestamping is somewhat, but not stringently, verified.\n");
}

// Create two X-Sync counters for client-compositor sync, init to counter value 0:
Expand Down
10 changes: 5 additions & 5 deletions PsychSourceGL/Source/OSX/Screen/PsychWindowGlue.c
Expand Up @@ -519,7 +519,7 @@ psych_bool PsychOSOpenOnscreenWindow(PsychScreenSettingsType *screenSettings, Ps
}

// Finalize attribute array with NULL.
attribs[attribcount++]=(CGLPixelFormatAttribute)NULL;
attribs[attribcount++]=(CGLPixelFormatAttribute) 0;

// Init to zero:
windowRecord->targetSpecific.pixelFormatObject = NULL;
Expand Down Expand Up @@ -768,8 +768,8 @@ psych_bool PsychOSOpenOnscreenWindow(PsychScreenSettingsType *screenSettings, Ps
// Use of CoreVideo is needed on 10.7 and later due to brokeness of the old method (thanks Apple!):
if (PsychPrefStateGet_Verbosity() > 2) {
printf("PTB-INFO: Will use fragile CoreVideo timestamping as fallback if beamposition timestamping doesn't work.\n");
// Recommend use of kernel driver if it isn't installed already for all but Intel GPU's:
if (!PsychOSIsKernelDriverAvailable(screenSettings->screenNumber) && !strstr((char*) glGetString(GL_VENDOR), "Intel")) {
// Recommend use of kernel driver if it isn't installed already:
if (!PsychOSIsKernelDriverAvailable(screenSettings->screenNumber) /* && !strstr((char*) glGetString(GL_VENDOR), "Intel") */) {
printf("PTB-INFO: Installation of the PsychtoolboxKernelDriver is strongly recommended if you care about precise visual\n");
printf("PTB-INFO: onset timestamping or timing. See 'help PsychtoolboxKernelDriver' for installation instructions.\n");
}
Expand Down Expand Up @@ -818,8 +818,8 @@ psych_bool PsychOSOpenOnscreenWindow(PsychScreenSettingsType *screenSettings, Ps
// VBLtimestampingmode 0 or -1 -- No CoreVideo fallback for timestamping if beamposition timestamping is unavailable:
// This is the new default as of Psychtoolbox 3.0.12 to avoid the buggy, crashy, unreliably CoreVideo fallback.

// Recommend use of kernel driver if it isn't installed already for all but Intel GPU's:
if (!PsychOSIsKernelDriverAvailable(screenSettings->screenNumber) && !strstr((char*) glGetString(GL_VENDOR), "Intel")) {
// Recommend use of kernel driver if it isn't installed already:
if (!PsychOSIsKernelDriverAvailable(screenSettings->screenNumber) && (PsychPrefStateGet_Verbosity() > 2) /* && !strstr((char*) glGetString(GL_VENDOR), "Intel") */) {
printf("PTB-INFO: Installation of the PsychtoolboxKernelDriver is strongly recommended if you care about precise visual\n");
printf("PTB-INFO: onset timestamping or timing. See 'help PsychtoolboxKernelDriver' for installation instructions.\n");
}
Expand Down
16 changes: 8 additions & 8 deletions PsychSourceGL/Source/osxsetoctaverpath.m
Expand Up @@ -50,20 +50,20 @@ function osxsetoctaverpath(mexfname, mexpath)

% This is how the libdir should be defined automatically:
libdir = __octave_config_info__.octlibdir;
% This is sadly how we have to do it with Octave-6.4 on OSX 10.15 due to
% the latest OSX linker crap - Hardcoding the path for a Octave-6.4 install

% This is sadly how we have to do it with Octave on OSX 10.15 due to
% the latest OSX linker crap - Hardcoding the path for a Octave install
% from HomeBrew. Yes, this is sad...
libdir = '/usr/local/opt/octave/lib/octave/6.3.0';
libdir = '/usr/local/opt/octave/lib/octave/6.4.0';

% Replace absolute path to liboctinterp.9.dylib with @rpath:
system(['install_name_tool -change ' libdir '/liboctinterp.9.dylib @rpath/liboctinterp.9.dylib ' mexfname]);
system(['install_name_tool -change ' libdir '/liboctinterp.9.dylib @rpath/liboctinterp.dylib ' mexfname]);

% Replace absolute path to liboctave.8.dylib with @rpath:
system(['install_name_tool -change ' libdir '/liboctave.8.dylib @rpath/liboctave.8.dylib ' mexfname]);
system(['install_name_tool -change ' libdir '/liboctave.8.dylib @rpath/liboctave.dylib ' mexfname]);

% Add one single rpath: @loader_path. This is the path to our folder where our
% mex file is stored. If we place copies of liboctave.8.dylib and liboctinterp.8.dylib
% mex file is stored. If we place symlinks to liboctave.dylib and liboctinterp.dylib
% there, then the linker will find them. In absence, the linker will also search the
% users $HOME/lib/ directory as a possible fallback:
lpaths = { '@loader_path' };
Expand All @@ -72,7 +72,7 @@ function osxsetoctaverpath(mexfname, mexpath)
% library directories, ie., as settings for @rpath:
for i = 1:length(lpaths)
system(['install_name_tool -add_rpath ' lpaths{i} ' ' mexfname]);
fprintf('Added Octave-6 @rpath %s to mex file %s ...\n', lpaths{i}, mexfname);
fprintf('Added Octave @rpath %s to mex file %s ...\n', lpaths{i}, mexfname);
end

return;
17 changes: 17 additions & 0 deletions Psychtoolbox/Contents.m
Expand Up @@ -103,6 +103,23 @@
%
% Please type 'PsychPaidSupportAndServices' to learn more.
%
%
% ADDITIONAL NEWS: The Psychtoolbox user survey 2022 is underway!
%
% In recent years the Psychtoolbox Team has worked hard to improve Psychtoolbox itself and its services.
% We kindly ask you to fill out this survey, so that we can better understand the needs and wishes of our
% community. Your answers will greatly help us to shape the future of Psychtoolbox.
%
% The survey is conducted by our host for all commercial services and matters, the
% “Medical Innovations Incubator GmbH, Tuebingen, Germany”.
%
% As a thank you for participation, you will receive a discount code for your next
% Psychtoolbox Support Membership purchase after completing the survey.
%
% Use the following link to the survey form if you want to participate:
%
% https://t.co/NOiTOWW0v4
%

% The OS 9 version was this:
% PsychBasic - Basic support routines for psychophysics.
Expand Down
Binary file modified Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/Screen.mexw64
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave5LinuxFiles64/Screen.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/Datapixx.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/Eyelink.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/FontInfo.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/Gestalt.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/GetSecs.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/IOPort.mex
Binary file not shown.
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/MachGetPriorityMex.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/MachSetPriorityMex.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/PsychHID.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/PsychKinectCore.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/PsychOculusVRCore.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/PsychPortAudio.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/PsychVulkanCore.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/Screen.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/WaitSecs.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/moalcore.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/moglcore.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6OSXFiles64/pnet.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Octave6WindowsFiles64/Screen.mex
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/PsychHID.mexmaci64
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Screen.mexa64
Binary file not shown.
Binary file modified Psychtoolbox/PsychBasic/Screen.mexmaci64
Binary file not shown.
12 changes: 6 additions & 6 deletions Psychtoolbox/PsychDocumentation/HybridGraphics.m
Expand Up @@ -239,10 +239,10 @@
% If you use the Gnome or Ubuntu desktop GUI (or any GUI which uses the Gnome
% "Mutter" X11 compositor and window manager), you can try the following
% command setenv('PSYCH_EXPERIMENTAL_NETWMTS', '1') to opt-in into some highly
% experimental mode which may make timing more reliable and trustworthy, while
% potentially achieving higher framerates again. The downside is that only
% single-window use with Screen('Flip') will work, no more fancy things like
% flip events, async flips, frame-sequential stereo - This is a construction site!
% experimental mode which makes timing reliable and trustworthy, however while
% potentially reducing framerate. Additional downsides are that currently only
% single-window use with Screen('Flip') will work, also no more fancy things like
% flip events, async flips, frame-sequential stereo or VRR. This is a construction site!
%
% I also have developed experimental patches to the Linux amdgpu driver to
% lift all these limitations on AMD to get the same excellent performance and
Expand All @@ -258,8 +258,8 @@
% For those combinations that should work (Intel iGPU + NVidia/AMD dGPU
% "Optimus/Enduro", and AMD iGPU + AMD dGPU), after you've upgraded to all
% the required software, the following setup steps are needed for muxless
% PRIME mode. Note that these *do not apply* to Optimus with the
% proprietary graphics driver from NVidia for which setup was explained above:
% PRIME mode. Note that these *do not apply* to Optimus with the proprietary
% graphics driver from NVidia, for which setup was explained above:
%
% 1. Run the "XOrgConfCreator" script to create a proper XOrg configuration file,
% and then "XOrgConfSelector" to switch to that configuration file, logout and
Expand Down
20 changes: 20 additions & 0 deletions Psychtoolbox/PsychDocumentation/PsychPaidSupportAndServices.m
Expand Up @@ -112,6 +112,26 @@ function PsychPaidSupportAndServices(mininag)
fprintf('Please type ''PsychPaidSupportAndServices'' to learn more.\n');
fprintf('\n\n');

if mininag == 1
% Advertise our user survey 2022:
fprintf('ADDITIONAL NEWS: The Psychtoolbox user survey 2022 is underway!\n');
fprintf('\n');
fprintf('In recent years the Psychtoolbox Team has worked hard to improve Psychtoolbox itself and its services.\n');
fprintf('We kindly ask you to fill out this survey, so that we can better understand the needs and wishes of our\n');
fprintf('community. Your answers will greatly help us to shape the future of Psychtoolbox.\n');
fprintf('\n');
fprintf('The survey is conducted by our host for all commercial services and matters, the\n');
fprintf('“Medical Innovations Incubator GmbH, Tuebingen, Germany”.\n');
fprintf('\n');
fprintf('As a thank you for participation, you will receive a discount code for your next\n');
fprintf('Psychtoolbox Support Membership purchase after completing the survey.\n');
fprintf('\n');
fprintf('Use the following link to the survey form if you want to participate:\n');
fprintf('\n');
fprintf('https://t.co/NOiTOWW0v4\n');
fprintf('\n\n');
end

return;
end

Expand Down
9 changes: 6 additions & 3 deletions Psychtoolbox/PsychLinuxConfiguration.m
Expand Up @@ -38,12 +38,15 @@
% of the 'psychtoolbox' group to allow easy reconfiguration of
% the X11 display system for running experiment sessions.
%
% Additionally it configures the gpu's to allow for display color
% depths of more than 8 bpc. Furthermore, it configures a potentially
% installed gamemoded daemon to further optimize cpu and graphics
% performance for use with Psychtoolbox.
%
% The script calls into the shell via "sudo" to achieve this
% setup task, which itself needs admin privileges to modify
% system files etc. "sudo" will prompt the user for his admin
% password to complete the tasks. This does not work on Octave
% with GUI though. You will need octave --no-gui to execute this
% script once if you use octave.
% password to complete the tasks.
%
% The script also checks if any special configuration is required
% to work around Linux specific OpenGL quirks of Matlab R2014b or
Expand Down

0 comments on commit 9449b84

Please sign in to comment.