Commit 2b1238fd authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

More fixes on the AMD Vulkan driver crashes during gpu info collection

A workaround was previously added to avoid a crash during the Vulkan gpu
information collection. This workaround was first applied to the 64-bit AMD
Vulkan driver with version 1.0.39.0, 1.0.51.0 and 1.0.54.0 only. But now more
crashes have been reported with amdvlk32.dll or systems with Intel/nVidea
GPUs. In this case, the AMD GPU could be seconday or doesn't exist at all.

This CL adds the 32-bit dll amdvlk32.dll to the workaround. It also removes
the detection for the AMD device ID. Just detecting amdvlk32.dll and
amdvlk64.dll is enough.

BUG=850881

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: Ief8fe9dbaec8a5fb1417bf6be87aca8845da5967
Reviewed-on: https://chromium-review.googlesource.com/1094262
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570630}
parent 3f738661
...@@ -272,40 +272,34 @@ void GetGpuSupportedD3D12Version(GPUInfo* gpu_info) { ...@@ -272,40 +272,34 @@ void GetGpuSupportedD3D12Version(GPUInfo* gpu_info) {
} }
bool BadAMDVulkanDriverVersion(GPUInfo* gpu_info) { bool BadAMDVulkanDriverVersion(GPUInfo* gpu_info) {
bool secondary_gpu_amd = false; // Both 32-bit and 64-bit dll are broken. If 64-bit doesn't exist,
for (size_t i = 0; i < gpu_info->secondary_gpus.size(); ++i) { // 32-bit dll will be used to detect the AMD Vulkan driver.
if (gpu_info->secondary_gpus[i].vendor_id == 0x1002) { const base::FilePath kAmdDriver64(FILE_PATH_LITERAL("amdvlk64.dll"));
secondary_gpu_amd = true; const base::FilePath kAmdDriver32(FILE_PATH_LITERAL("amdvlk32.dll"));
break; auto file_version_info =
} base::WrapUnique(FileVersionInfoWin::CreateFileVersionInfo(kAmdDriver64));
if (!file_version_info) {
file_version_info.reset(
FileVersionInfoWin::CreateFileVersionInfo(kAmdDriver32));
if (!file_version_info)
return false;
} }
// Check both primary and seconday const VS_FIXEDFILEINFO* fixed_file_info =
if (gpu_info->gpu.vendor_id == 0x1002 || secondary_gpu_amd) { static_cast<FileVersionInfoWin*>(file_version_info.get())
std::unique_ptr<FileVersionInfoWin> file_version_info( ->fixed_file_info();
static_cast<FileVersionInfoWin*>( const int major = HIWORD(fixed_file_info->dwFileVersionMS);
FileVersionInfoWin::CreateFileVersionInfo( const int minor = LOWORD(fixed_file_info->dwFileVersionMS);
base::FilePath(FILE_PATH_LITERAL("amdvlk64.dll"))))); const int minor_1 = HIWORD(fixed_file_info->dwFileVersionLS);
if (file_version_info) { // From the Canary crash logs, the broken amdvlk64.dll versions
const int major = // are 1.0.39.0, 1.0.51.0 and 1.0.54.0. In the manual test, version
HIWORD(file_version_info->fixed_file_info()->dwFileVersionMS); // 9.2.10.1 dated 12/6/2017 works and version 1.0.54.0 dated 11/2/1017
const int minor = // crashes. All version numbers small than 1.0.54.0 will be marked as
LOWORD(file_version_info->fixed_file_info()->dwFileVersionMS); // broken.
const int minor_1 = if (major == 1 && minor == 0 && minor_1 <= 54) {
HIWORD(file_version_info->fixed_file_info()->dwFileVersionLS); return true;
// 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; return false;
} }
......
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