Commit a99a420b authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Fix vulkan-1.dll crash in gpu info collection

Due to some bad versions of Vulkan Runtime/Loader, there are crashes when
Vulkan is called for the GPU supported Vulkan versions and extensions.

From the logs, most vulkan-1.dll crashs are from the following versions.
As of 7/23/2018,
0.0.0.0 -  # of crashes: 6556
1.0.26.0 - # of crashes: 5890
1.0.33.0 - # of crashes: 12271
1.0.42.0 - # of crashes: 35749
1.0.42.1 - # of crashes: 68214
1.0.51.0 - # of crashes: 5152

The GPU could be from any vendors, but only some certain models would
crash. For those that don't crash, they usually return failures upon GPU
Vulkan support querying even though the GPU drivers can support it.

The solution of this CL is to skip the Vulkan GPU info collection if bad
Vulkan versions are detected.

Bug:850384,863546

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I80cf1f7a45d6d501db678bdf18d98f5e95930e1d
Reviewed-on: https://chromium-review.googlesource.com/1146984Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577208}
parent 18774afe
......@@ -303,6 +303,45 @@ bool BadAMDVulkanDriverVersion(GPUInfo* gpu_info) {
return false;
}
bool BadVulkanDllVersion(GPUInfo* gpu_info) {
std::unique_ptr<FileVersionInfoWin> file_version_info(
static_cast<FileVersionInfoWin*>(
FileVersionInfoWin::CreateFileVersionInfo(
base::FilePath(FILE_PATH_LITERAL("vulkan-1.dll")))));
if (!file_version_info)
return false;
const VS_FIXEDFILEINFO* fixed_file_info =
static_cast<FileVersionInfoWin*>(file_version_info.get())
->fixed_file_info();
const int major = HIWORD(fixed_file_info->dwFileVersionMS);
const int minor = LOWORD(fixed_file_info->dwFileVersionMS);
const int build_1 = HIWORD(fixed_file_info->dwFileVersionLS);
const int build_2 = LOWORD(fixed_file_info->dwFileVersionLS);
// From the logs, most vulkan-1.dll crashs are from the following versions.
// As of 7/23/2018.
// 0.0.0.0 - # of crashes: 6556
// 1.0.26.0 - # of crashes: 5890
// 1.0.33.0 - # of crashes: 12271
// 1.0.42.0 - # of crashes: 35749
// 1.0.42.1 - # of crashes: 68214
// 1.0.51.0 - # of crashes: 5152
// The GPU could be from any vendors, but only some certain models would
// crash. For those that don't crash, they usually return failures upon GPU
// vulkan support querying even though the GPU drivers can support it.
if ((major == 0 && minor == 0 && build_1 == 0 && build_2 == 0) ||
(major == 1 && minor == 0 && build_1 == 26 && build_2 == 0) ||
(major == 1 && minor == 0 && build_1 == 33 && build_2 == 0) ||
(major == 1 && minor == 0 && build_1 == 42 && build_2 == 0) ||
(major == 1 && minor == 0 && build_1 == 42 && build_2 == 1) ||
(major == 1 && minor == 0 && build_1 == 51 && build_2 == 0)) {
return true;
}
return false;
}
bool InitVulkan(base::NativeLibrary* vulkan_library,
PFN_vkGetInstanceProcAddr* vkGetInstanceProcAddr,
PFN_vkCreateInstance* vkCreateInstance) {
......@@ -370,13 +409,18 @@ void GetGpuSupportedVulkanVersionAndExtensions(
gpu_info->supports_vulkan = false;
gpu_info->vulkan_version = 0;
// Skip if the system has an older AMD Vulkan driver amdvlk64.dll which
// crashes when vkCreateInstance() gets called. This bug is fixed in the
// latest driver.
// Skip if the system has an older AMD Vulkan driver amdvlk64.dll or
// amdvlk32.dll which crashes when vkCreateInstance() id called. This bug has
// been fixed in the latest AMD driver.
if (BadAMDVulkanDriverVersion(gpu_info)) {
return;
}
// Some early versions of vulkan-1.dll might crash
if (BadVulkanDllVersion(gpu_info)) {
return;
}
if (!InitVulkan(&vulkan_library, &vkGetInstanceProcAddr, &vkCreateInstance)) {
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment