Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PsychVulkanCore/Linux: Work around AMDVLK crash-bug for displays with…
… > 64 modes. AMDVLK drivers for Linux, at least as of v-2024.Q3.3, will crash when trying to enumerate or select video modes if the connected display device exposes more than 64 video modes. See following bug report by myself + proposed bug fix: GPUOpen-Drivers/xgl#179 Until this bug is fixed in an official AMDVLK release, or an inofficial release by myself for older Polaris gpu's, we add a workaround to our driver. We limit the number of queried video modes to the first 64 modes. This prevents an instant crash during session startup. Review of the broken amdvlk code suggests that it should also prevent crashes in general as long as AMDVLK is only used on a single display output, or on exactly one display device connected to exactly one AMD gpu in a multi-AMD-gpu configuration. If amdvlk would be simultaneously used on multiple displays connected to an AMD gpu, it will be a matter of dumb luck if it works, or if the driver will crash due to memory corruption, depending on which displays exactly are selected for simultaneous operation, and how their associated data structures are ordered/arranged inside PAL/XGL. Much to my surprise a dual-display test did work on my machine, probably due to dumb luck. Anyhow, preventing the immediate crash on query for single display setups, and outputting a warning to the user against multi-display hazards is the best we can do on our side. A proper fix will need to be made in the amdvlk driver, and testing by a user with a prototype fix confirms that that solves the problem. Cfe.: https://psychtoolbox.discourse.group/t/vulkan-breaks-with-stack-smashing-detected-terminated/5501
- Loading branch information