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