Commit 2b30b5a2 authored by Daksh Idnani's avatar Daksh Idnani Committed by Commit Bot

Include tags for all GPUs in GPU integration tests' expectations.

Update platform tags for gpu integration tests and webgl conformance integration tests
to include tags for all GPUs.

Bug: 985486, 984780, angleproject:3701
Change-Id: I17c3ad90e42e815b1aff26a1d202a0f63d6a2f81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761193Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688268}
parent 58a251c5
......@@ -47,52 +47,44 @@ def _GetANGLEGpuDeviceId(device_string):
return None
def GetGpuVendorString(gpu_info):
if gpu_info:
primary_gpu = gpu_info.devices[0]
if primary_gpu:
vendor_string = primary_gpu.vendor_string
angle_vendor_string = _ParseANGLEGpuVendorString(
primary_gpu.device_string)
vendor_id = primary_gpu.vendor_id
if vendor_id == 0x10DE:
return 'nvidia'
elif vendor_id == 0x1002:
return 'amd'
elif vendor_id == 0x8086:
return 'intel'
elif angle_vendor_string:
return angle_vendor_string.lower()
elif vendor_string:
return vendor_string.split(' ')[0].lower()
def GetGpuVendorString(gpu_device):
if gpu_device:
vendor_string = gpu_device.vendor_string
angle_vendor_string = _ParseANGLEGpuVendorString(
gpu_device.device_string)
vendor_id = gpu_device.vendor_id
if vendor_id == 0x10DE:
return 'nvidia'
elif vendor_id == 0x1002:
return 'amd'
elif vendor_id == 0x8086:
return 'intel'
elif angle_vendor_string:
return angle_vendor_string.lower()
elif vendor_string:
return vendor_string.split(' ')[0].lower()
return 'unknown_gpu'
def GetGpuDeviceId(gpu_info):
if gpu_info:
primary_gpu = gpu_info.devices[0]
if primary_gpu:
return (
primary_gpu.device_id
or _GetANGLEGpuDeviceId(
primary_gpu.device_string)
or primary_gpu.device_string)
def GetGpuDeviceId(gpu_device):
if gpu_device:
return (
gpu_device.device_id
or _GetANGLEGpuDeviceId(
gpu_device.device_string)
or gpu_device.device_string)
return 0
def GetGpuDriverVendor(gpu_info):
if gpu_info:
primary_gpu = gpu_info.devices[0]
if primary_gpu:
return primary_gpu.driver_vendor
def GetGpuDriverVendor(gpu_device):
if gpu_device:
return gpu_device.driver_vendor
return None
def GetGpuDriverVersion(gpu_info):
if gpu_info:
primary_gpu = gpu_info.devices[0]
if primary_gpu:
return primary_gpu.driver_version
def GetGpuDriverVersion(gpu_device):
if gpu_device:
return gpu_device.driver_version
return None
......
......@@ -298,23 +298,27 @@ class GpuIntegrationTest(
system_info = browser.GetSystemInfo()
if system_info:
gpu_info = system_info.gpu
gpu_vendor = gpu_helper.GetGpuVendorString(gpu_info)
gpu_device_id = gpu_helper.GetGpuDeviceId(gpu_info)
# The gpu device id tag will contain both the vendor and device id
# separated by a '-'.
try:
# If the device id is an integer then it will be added as
# a hexadecimal to the tag
gpu_device_tag = '%s-0x%x' % (gpu_vendor, gpu_device_id)
except TypeError:
# if the device id is not an integer it will be added as
# a string to the tag.
gpu_device_tag = '%s-%s' % (gpu_vendor, gpu_device_id)
# Add tags for each GPU device
for gpu_device in gpu_info.devices:
gpu_vendor = gpu_helper.GetGpuVendorString(gpu_device)
gpu_device_id = gpu_helper.GetGpuDeviceId(gpu_device)
# The gpu device id tag will contain both the vendor and device id
# separated by a '-'.
try:
# If the device id is an integer then it will be added as
# a hexadecimal to the tag
gpu_device_tag = '%s-0x%x' % (gpu_vendor, gpu_device_id)
except TypeError:
# if the device id is not an integer it will be added as
# a string to the tag.
gpu_device_tag = '%s-%s' % (gpu_vendor, gpu_device_id)
tags.extend([re.sub('[ _]', '-', tag) for tag in [gpu_vendor,
gpu_device_tag]])
angle_renderer = gpu_helper.GetANGLERenderer(gpu_info)
cmd_decoder = gpu_helper.GetCommandDecoder(gpu_info)
# all spaces and underscores in the tag will be replaced by dashes
tags.extend([re.sub('[ _]', '-', tag) for tag in [
gpu_vendor, gpu_device_tag, angle_renderer, cmd_decoder]])
tags.extend([re.sub('[ _]', '-', tag) for tag in [angle_renderer,
cmd_decoder]])
# If additional options have been set via '--extra-browser-args' check for
# those which map to expectation tags. The '_browser_backend' attribute may
# not exist in unit tests.
......
......@@ -468,25 +468,27 @@ class WebGLConformanceIntegrationTest(gpu_integration_test.GpuIntegrationTest):
system_info = browser.GetSystemInfo()
if system_info:
gpu_info = system_info.gpu
driver_vendor = gpu_helper.GetGpuDriverVendor(gpu_info)
driver_version = gpu_helper.GetGpuDriverVersion(gpu_info)
if driver_vendor and driver_version:
driver_vendor = driver_vendor.lower()
driver_version = driver_version.lower()
# Extract the substring before first space/dash/underscore
matcher = re.compile(r'^([a-z\d]+)([\s\-_]+[a-z\d]+)+$')
match = matcher.match(driver_vendor)
if match:
driver_vendor = match.group(1)
for tag in gpu_helper.EXPECTATIONS_DRIVER_TAGS:
match = gpu_helper.MatchDriverTag(tag)
assert match
if (driver_vendor == match.group(1) and
gpu_helper.EvaluateVersionComparison(
driver_version, match.group(2), match.group(3))):
tags.append(tag)
# Get tags for all GPUs
for gpu_device in gpu_info.devices:
driver_vendor = gpu_helper.GetGpuDriverVendor(gpu_device)
driver_version = gpu_helper.GetGpuDriverVersion(gpu_device)
if driver_vendor and driver_version:
driver_vendor = driver_vendor.lower()
driver_version = driver_version.lower()
# Extract the substring before first space/dash/underscore
matcher = re.compile(r'^([a-z\d]+)([\s\-_]+[a-z\d]+)+$')
match = matcher.match(driver_vendor)
if match:
driver_vendor = match.group(1)
for tag in gpu_helper.EXPECTATIONS_DRIVER_TAGS:
match = gpu_helper.MatchDriverTag(tag)
assert match
if (driver_vendor == match.group(1) and
gpu_helper.EvaluateVersionComparison(
driver_version, match.group(2), match.group(3))):
tags.append(tag)
return tags
@classmethod
......
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