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

Skip the Vulkan info collection for the older AMD drivers to avoid crashes

The older versions of the AMD Vulkan driver are broken. It crashes when
vkCreateInstance gets called. The CL will detect amdvlk64.dll file
version and skip the vulkan info collection if the version number is
1.0.54.0 or older. Those bad versions cause crashes in the other apps like
vulkaninfo.exe and SDK cube.exe as well.

From the crash logs in the bug report, three bad amdvlk64.dll versions are
recorded - 1.0.39.0, 1.0.51.0 and 1.0.54.0.

The Vulkan info collection will continue with the newer AMD drivers since this
bug has been fixed in the newer versions.

BUG=832698
TEST=manual,Chrome://histograms
R=zmo@chromium.org

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: I7f53210c559cd1e2c189fec6ed6fb000b38256fa
Reviewed-on: https://chromium-review.googlesource.com/1022517Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552837}
parent 77d5c4b1
......@@ -18,6 +18,7 @@
#include <stddef.h>
#include <stdint.h>
#include "base/file_version_info_win.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
......@@ -106,6 +107,7 @@ inline VulkanVersion ConvertToHistogramVulkanVersion(uint32_t vulkan_version) {
return VulkanVersion::kVulkanVersionUnknown;
}
}
} // namespace anonymous
#if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
......@@ -313,6 +315,43 @@ void GetGpuSupportedD3D12Version(GPUInfo* gpu_info) {
base::UnloadNativeLibrary(d3d12_library);
}
bool BadAMDVulkanDriverVersion(GPUInfo* gpu_info) {
bool secondary_gpu_amd = false;
for (size_t i = 0; i < gpu_info->secondary_gpus.size(); ++i) {
if (gpu_info->secondary_gpus[i].vendor_id == 0x1002) {
secondary_gpu_amd = true;
break;
}
}
// Check both primary and seconday
if (gpu_info->gpu.vendor_id == 0x1002 || secondary_gpu_amd) {
std::unique_ptr<FileVersionInfoWin> file_version_info(
static_cast<FileVersionInfoWin*>(
FileVersionInfoWin::CreateFileVersionInfo(
base::FilePath(FILE_PATH_LITERAL("amdvlk64.dll")))));
if (file_version_info) {
const int major =
HIWORD(file_version_info->fixed_file_info()->dwFileVersionMS);
const int minor =
LOWORD(file_version_info->fixed_file_info()->dwFileVersionMS);
const int minor_1 =
HIWORD(file_version_info->fixed_file_info()->dwFileVersionLS);
// From the Canary crash logs, the broken amdvlk64.dll versions
// are 1.0.39.0, 1.0.51.0 and 1.0.54.0. In the manual test, version
// 9.2.10.1 dated 12/6/2017 works and version 1.0.54.0 dated 11/2/1017
// crashes. All version numbers small than 1.0.54.0 will be marked as
// broken.
if (major == 1 && minor == 0 && minor_1 <= 54) {
return true;
}
}
}
return false;
}
void GetGpuSupportedVulkanVersion(GPUInfo* gpu_info) {
TRACE_EVENT0("gpu", "GetGpuSupportedVulkanVersion");
......@@ -326,6 +365,13 @@ void GetGpuSupportedVulkanVersion(GPUInfo* gpu_info) {
return;
}
// 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.
if (BadAMDVulkanDriverVersion(gpu_info)) {
return;
}
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
reinterpret_cast<PFN_vkGetInstanceProcAddr>(
GetProcAddress(vulkan_library, "vkGetInstanceProcAddr"));
......
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