borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | |
| 6 | # Recipe module for Skia Swarming perf. |
| 7 | |
| 8 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 9 | import calendar |
| 10 | |
| 11 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 12 | DEPS = [ |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 13 | 'core', |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 14 | 'env', |
| 15 | 'flavor', |
Robert Iannucci | 8cd5041 | 2017-07-07 14:36:58 -0700 | [diff] [blame] | 16 | 'recipe_engine/file', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 17 | 'recipe_engine/json', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 18 | 'recipe_engine/path', |
| 19 | 'recipe_engine/platform', |
| 20 | 'recipe_engine/properties', |
| 21 | 'recipe_engine/raw_io', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 22 | 'recipe_engine/step', |
| 23 | 'recipe_engine/time', |
| 24 | 'run', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 25 | 'vars', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 26 | ] |
| 27 | |
| 28 | |
Eric Boren | 89cd357 | 2017-06-28 13:50:22 -0400 | [diff] [blame] | 29 | def nanobench_flags(api, bot): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 30 | args = ['--pre_log'] |
| 31 | |
| 32 | if 'GPU' in bot: |
| 33 | args.append('--images') |
| 34 | args.extend(['--gpuStatsDump', 'true']) |
| 35 | |
| 36 | if 'Android' in bot and 'GPU' in bot: |
| 37 | args.extend(['--useThermalManager', '1,1,10,1000']) |
| 38 | |
| 39 | args.extend(['--scales', '1.0', '1.1']) |
| 40 | |
| 41 | if 'iOS' in bot: |
| 42 | args.extend(['--skps', 'ignore_skps']) |
| 43 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 44 | configs = [] |
| 45 | if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU': |
| 46 | args.append('--nogpu') |
| 47 | configs.extend(['8888', 'nonrendering']) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 48 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 49 | if '-arm-' not in bot: |
| 50 | # For Android CPU tests, these take too long and cause the task to time |
| 51 | # out. |
| 52 | configs += [ 'f16', 'srgb' ] |
| 53 | if '-GCE-' in bot: |
| 54 | configs += [ '565' ] |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 55 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 56 | elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU': |
| 57 | args.append('--nocpu') |
| 58 | |
| 59 | gl_prefix = 'gl' |
| 60 | sample_count = '8' |
| 61 | if 'Android' in bot or 'iOS' in bot: |
| 62 | sample_count = '4' |
| 63 | # The NVIDIA_Shield has a regular OpenGL implementation. We bench that |
| 64 | # instead of ES. |
| 65 | if 'NVIDIA_Shield' not in bot: |
| 66 | gl_prefix = 'gles' |
| 67 | # The NP produces a long error stream when we run with MSAA. |
| 68 | # iOS crashes (skia:6399) |
| 69 | # Nexus7 (Tegra3) does not support MSAA. |
| 70 | if ('NexusPlayer' in bot or |
| 71 | 'iOS' in bot or |
| 72 | 'Nexus7' in bot): |
| 73 | sample_count = '' |
| 74 | elif 'Intel' in bot: |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 75 | sample_count = '' |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 76 | elif 'ChromeOS' in bot: |
| 77 | gl_prefix = 'gles' |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 78 | |
Ben Wagner | 769faa2 | 2017-08-11 15:32:50 -0400 | [diff] [blame] | 79 | configs.extend([gl_prefix, gl_prefix + 'srgb']) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 80 | if sample_count is not '': |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 81 | configs.append(gl_prefix + 'msaa' + sample_count) |
| 82 | if ('TegraX1' in bot or |
| 83 | 'Quadro' in bot or |
| 84 | 'GTX' in bot or |
| 85 | ('GT610' in bot and 'Ubuntu17' not in bot)): |
| 86 | configs.extend([gl_prefix + 'nvpr' + sample_count, |
| 87 | gl_prefix + 'nvprdit' + sample_count]) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 88 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 89 | # We want to test both the OpenGL config and the GLES config on Linux Intel: |
| 90 | # GL is used by Chrome, GLES is used by ChromeOS. |
| 91 | if 'Intel' in bot and api.vars.is_linux: |
Ben Wagner | 769faa2 | 2017-08-11 15:32:50 -0400 | [diff] [blame] | 92 | configs.extend(['gles', 'glessrgb']) |
| 93 | |
| 94 | # The following devices do not support glessrgb. |
| 95 | if 'glessrgb' in configs: |
| 96 | if ('IntelHD405' in bot or |
| 97 | 'IntelIris540' in bot or |
| 98 | 'IntelIris640' in bot or |
| 99 | 'IntelBayTrail' in bot or |
| 100 | 'IntelHD2000' in bot or |
| 101 | 'AndroidOne' in bot or |
| 102 | 'Nexus7' in bot or |
| 103 | 'NexusPlayer' in bot): |
| 104 | configs.remove('glessrgb') |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 105 | |
| 106 | # Bench instanced rendering on a limited number of platforms |
| 107 | inst_config = gl_prefix + 'inst' |
Ben Wagner | cc4221b | 2017-08-17 17:29:04 -0400 | [diff] [blame] | 108 | if 'PixelC' in bot or 'NVIDIA_Shield' in bot or 'MacMini7.1' in bot: |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 109 | configs.extend([inst_config, inst_config + sample_count]) |
| 110 | |
| 111 | if 'CommandBuffer' in bot: |
| 112 | configs = ['commandbuffer'] |
| 113 | if 'Vulkan' in bot: |
| 114 | configs = ['vk'] |
| 115 | |
| 116 | if 'ANGLE' in bot: |
| 117 | # Test only ANGLE configs. |
| 118 | configs = ['angle_d3d11_es2'] |
| 119 | if sample_count is not '': |
| 120 | configs.append('angle_d3d11_es2_msaa' + sample_count) |
| 121 | |
| 122 | if 'ChromeOS' in bot: |
| 123 | # Just run GLES for now - maybe add gles_msaa4 in the future |
| 124 | configs = ['gles'] |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 125 | |
| 126 | args.append('--config') |
| 127 | args.extend(configs) |
| 128 | |
| 129 | if 'Valgrind' in bot: |
| 130 | # Don't care about Valgrind performance. |
| 131 | args.extend(['--loops', '1']) |
| 132 | args.extend(['--samples', '1']) |
| 133 | # Ensure that the bot framework does not think we have timed out. |
| 134 | args.extend(['--keepAlive', 'true']) |
| 135 | |
Ben Wagner | 47ac024 | 2017-06-27 13:44:36 -0400 | [diff] [blame] | 136 | # Some people don't like verbose output. |
| 137 | verbose = False |
| 138 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 139 | match = [] |
| 140 | if 'Android' in bot: |
| 141 | # Segfaults when run as GPU bench. Very large texture? |
| 142 | match.append('~blurroundrect') |
| 143 | match.append('~patch_grid') # skia:2847 |
| 144 | match.append('~desk_carsvg') |
| 145 | if 'NexusPlayer' in bot: |
| 146 | match.append('~desk_unicodetable') |
| 147 | if 'Nexus5' in bot: |
| 148 | match.append('~keymobi_shop_mobileweb_ebay_com.skp') # skia:5178 |
| 149 | if 'iOS' in bot: |
| 150 | match.append('~blurroundrect') |
| 151 | match.append('~patch_grid') # skia:2847 |
| 152 | match.append('~desk_carsvg') |
| 153 | match.append('~keymobi') |
| 154 | match.append('~path_hairline') |
| 155 | match.append('~GLInstancedArraysBench') # skia:4714 |
| 156 | if 'IntelIris540' in bot and 'ANGLE' in bot: |
| 157 | match.append('~tile_image_filter_tiled_64') # skia:6082 |
Ben Wagner | 8ab8f61 | 2017-08-17 13:53:09 -0400 | [diff] [blame] | 158 | if 'IntelHD615' in bot and 'ANGLE' in bot and 'Release' in bot: |
| 159 | # skia:6980 |
| 160 | match.append('~hardstop_') |
| 161 | match.append('~GM_radial_gradient3') |
Ben Wagner | 1aa2369 | 2017-06-09 10:24:39 -0400 | [diff] [blame] | 162 | if ('Vulkan' in bot and ('IntelIris540' in bot or 'IntelIris640' in bot) and |
| 163 | 'Win' in bot): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 164 | # skia:6398 |
| 165 | match.append('~GM_varied_text_clipped_lcd') |
| 166 | match.append('~GM_varied_text_ignorable_clip_lcd') |
Mike Reed | 1d2678f | 2017-07-05 13:10:42 -0400 | [diff] [blame] | 167 | match.append('~blendmode_mask_DstATop') |
| 168 | match.append('~blendmode_mask_SrcIn') |
| 169 | match.append('~blendmode_mask_SrcOut') |
| 170 | match.append('~blendmode_mask_Src') |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 171 | match.append('~fontscaler_lcd') |
| 172 | match.append('~rotated_rects_aa_alternating_transparent_and_opaque_src') |
| 173 | match.append('~rotated_rects_aa_changing_transparent_src') |
| 174 | match.append('~rotated_rects_aa_same_transparent_src') |
| 175 | match.append('~shadermask_LCD_FF') |
| 176 | match.append('~srcmode_rects_1') |
| 177 | match.append('~text_16_LCD_88') |
| 178 | match.append('~text_16_LCD_BK') |
| 179 | match.append('~text_16_LCD_FF') |
| 180 | match.append('~text_16_LCD_WT') |
Greg Daniel | 139eb80 | 2017-07-19 10:12:49 -0400 | [diff] [blame] | 181 | # skia:6863 |
| 182 | match.append('~desk_skbug6850overlay2') |
Greg Daniel | e099653 | 2017-08-07 14:56:26 -0400 | [diff] [blame] | 183 | match.append('~desk_googlespreadsheet') |
Eric Boren | 89cd357 | 2017-06-28 13:50:22 -0400 | [diff] [blame] | 184 | if ('Intel' in bot and api.vars.is_linux and not 'Vulkan' in bot): |
Ben Wagner | 47ac024 | 2017-06-27 13:44:36 -0400 | [diff] [blame] | 185 | # TODO(dogben): Track down what's causing bots to die. |
| 186 | verbose = True |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 187 | if 'Vulkan' in bot and 'NexusPlayer' in bot: |
Greg Daniel | 514e9d8 | 2017-07-06 09:25:15 -0400 | [diff] [blame] | 188 | match.append('~blendmode_') # skia:6691 |
Ben Wagner | 9b51d14 | 2017-05-25 12:48:16 -0400 | [diff] [blame] | 189 | if 'ANGLE' in bot and 'Radeon' in bot and 'Release' in bot: |
Brian Osman | 6a1a5f7 | 2017-04-21 15:38:27 -0400 | [diff] [blame] | 190 | # skia:6534 |
| 191 | match.append('~shapes_mixed_10000_32x33') |
Ben Wagner | 9b51d14 | 2017-05-25 12:48:16 -0400 | [diff] [blame] | 192 | match.append('~shapes_oval_10000_32x32') |
Brian Osman | 6a1a5f7 | 2017-04-21 15:38:27 -0400 | [diff] [blame] | 193 | match.append('~shapes_oval_10000_32x33') |
Ben Wagner | 9b51d14 | 2017-05-25 12:48:16 -0400 | [diff] [blame] | 194 | match.append('~shapes_rect_100_500x500') |
| 195 | match.append('~shapes_rrect_10000_32x32') |
Ben Wagner | 38a5601 | 2017-04-28 17:13:32 -0400 | [diff] [blame] | 196 | if 'ANGLE' in bot and 'GTX960' in bot and 'Release' in bot: |
| 197 | # skia:6534 |
| 198 | match.append('~shapes_mixed_10000_32x33') |
Ben Wagner | 9b51d14 | 2017-05-25 12:48:16 -0400 | [diff] [blame] | 199 | match.append('~shapes_rect_100_500x500') |
| 200 | match.append('~shapes_rrect_10000_32x32') |
Ben Wagner | adf17dc | 2017-09-12 23:41:00 -0400 | [diff] [blame^] | 201 | if 'float_cast_overflow' in bot and 'CPU' in bot: |
| 202 | # skia:4632 |
| 203 | match.append('~^floor2int_undef$') |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 204 | |
| 205 | # We do not need or want to benchmark the decodes of incomplete images. |
| 206 | # In fact, in nanobench we assert that the full image decode succeeds. |
| 207 | match.append('~inc0.gif') |
| 208 | match.append('~inc1.gif') |
| 209 | match.append('~incInterlaced.gif') |
| 210 | match.append('~inc0.jpg') |
| 211 | match.append('~incGray.jpg') |
| 212 | match.append('~inc0.wbmp') |
| 213 | match.append('~inc1.wbmp') |
| 214 | match.append('~inc0.webp') |
| 215 | match.append('~inc1.webp') |
| 216 | match.append('~inc0.ico') |
| 217 | match.append('~inc1.ico') |
| 218 | match.append('~inc0.png') |
| 219 | match.append('~inc1.png') |
| 220 | match.append('~inc2.png') |
| 221 | match.append('~inc12.png') |
| 222 | match.append('~inc13.png') |
| 223 | match.append('~inc14.png') |
| 224 | match.append('~inc0.webp') |
| 225 | match.append('~inc1.webp') |
| 226 | |
| 227 | if match: |
| 228 | args.append('--match') |
| 229 | args.extend(match) |
| 230 | |
Ben Wagner | 47ac024 | 2017-06-27 13:44:36 -0400 | [diff] [blame] | 231 | if verbose: |
| 232 | args.append('--verbose') |
| 233 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 234 | return args |
| 235 | |
| 236 | |
| 237 | def perf_steps(api): |
| 238 | """Run Skia benchmarks.""" |
| 239 | if api.vars.upload_perf_results: |
| 240 | api.flavor.create_clean_device_dir( |
| 241 | api.flavor.device_dirs.perf_data_dir) |
| 242 | |
| 243 | # Run nanobench. |
| 244 | properties = [ |
| 245 | '--properties', |
| 246 | 'gitHash', api.vars.got_revision, |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 247 | ] |
| 248 | if api.vars.is_trybot: |
| 249 | properties.extend([ |
| 250 | 'issue', api.vars.issue, |
| 251 | 'patchset', api.vars.patchset, |
| 252 | 'patch_storage', api.vars.patch_storage, |
| 253 | ]) |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 254 | properties.extend(['swarming_bot_id', api.vars.swarming_bot_id]) |
| 255 | properties.extend(['swarming_task_id', api.vars.swarming_task_id]) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 256 | |
| 257 | target = 'nanobench' |
| 258 | args = [ |
| 259 | target, |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 260 | '-i', api.flavor.device_dirs.resource_dir, |
| 261 | '--skps', api.flavor.device_dirs.skp_dir, |
| 262 | '--images', api.flavor.device_path_join( |
| 263 | api.flavor.device_dirs.images_dir, 'nanobench'), |
| 264 | ] |
| 265 | |
| 266 | # Do not run svgs on Valgrind. |
| 267 | if 'Valgrind' not in api.vars.builder_name: |
| 268 | if ('Vulkan' not in api.vars.builder_name or |
| 269 | 'NexusPlayer' not in api.vars.builder_name): |
| 270 | args.extend(['--svgs', api.flavor.device_dirs.svg_dir]) |
| 271 | |
Eric Boren | 89cd357 | 2017-06-28 13:50:22 -0400 | [diff] [blame] | 272 | args.extend(nanobench_flags(api, api.vars.builder_name)) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 273 | |
| 274 | if 'Chromecast' in api.vars.builder_cfg.get('os', ''): |
| 275 | # Due to limited disk space, run a watered down perf run on Chromecast. |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 276 | args = [target] |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 277 | if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU': |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 278 | args.extend(['--nogpu', '--config', '8888']) |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 279 | elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU': |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 280 | args.extend(['--nocpu', '--config', 'gles']) |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 281 | args.extend([ |
Kevin Lubick | ffce079 | 2017-05-24 15:30:35 -0400 | [diff] [blame] | 282 | '-i', api.flavor.device_dirs.resource_dir, |
| 283 | '--images', api.flavor.device_path_join( |
| 284 | api.flavor.device_dirs.resource_dir, 'color_wheel.jpg'), |
Kevin Lubick | c78a2d7 | 2017-06-01 15:51:06 -0400 | [diff] [blame] | 285 | '--skps', api.flavor.device_dirs.skp_dir, |
Kevin Lubick | ffce079 | 2017-05-24 15:30:35 -0400 | [diff] [blame] | 286 | '--pre_log', |
| 287 | '--match', # skia:6581 |
| 288 | '~matrixconvolution', |
| 289 | '~blur_image_filter', |
| 290 | '~blur_0.01', |
| 291 | '~GM_animated-image-blurs', |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 292 | '~blendmode_mask_', |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 293 | ]) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 294 | |
| 295 | if api.vars.upload_perf_results: |
| 296 | now = api.time.utcnow() |
| 297 | ts = int(calendar.timegm(now.utctimetuple())) |
| 298 | json_path = api.flavor.device_path_join( |
| 299 | api.flavor.device_dirs.perf_data_dir, |
| 300 | 'nanobench_%s_%d.json' % (api.vars.got_revision, ts)) |
| 301 | args.extend(['--outResultsFile', json_path]) |
| 302 | args.extend(properties) |
| 303 | |
| 304 | keys_blacklist = ['configuration', 'role', 'is_trybot'] |
| 305 | args.append('--key') |
| 306 | for k in sorted(api.vars.builder_cfg.keys()): |
| 307 | if not k in keys_blacklist: |
| 308 | args.extend([k, api.vars.builder_cfg[k]]) |
| 309 | |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 310 | env = {} |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 311 | if 'Ubuntu16' in api.vars.builder_name: |
| 312 | # The vulkan in this asset name simply means that the graphics driver |
| 313 | # supports Vulkan. It is also the driver used for GL code. |
| 314 | dri_path = api.vars.slave_dir.join('linux_vulkan_intel_driver_release') |
| 315 | if 'Debug' in api.vars.builder_name: |
| 316 | dri_path = api.vars.slave_dir.join('linux_vulkan_intel_driver_debug') |
| 317 | |
| 318 | if 'Vulkan' in api.vars.builder_name: |
| 319 | sdk_path = api.vars.slave_dir.join('linux_vulkan_sdk', 'bin') |
| 320 | lib_path = api.vars.slave_dir.join('linux_vulkan_sdk', 'lib') |
| 321 | env.update({ |
| 322 | 'PATH':'%%(PATH)s:%s' % sdk_path, |
| 323 | 'LD_LIBRARY_PATH': '%s:%s' % (lib_path, dri_path), |
| 324 | 'LIBGL_DRIVERS_PATH': dri_path, |
| 325 | 'VK_ICD_FILENAMES':'%s' % dri_path.join('intel_icd.x86_64.json'), |
| 326 | }) |
| 327 | else: |
| 328 | # Even the non-vulkan NUC jobs could benefit from the newer drivers. |
| 329 | env.update({ |
| 330 | 'LD_LIBRARY_PATH': dri_path, |
| 331 | 'LIBGL_DRIVERS_PATH': dri_path, |
| 332 | }) |
| 333 | |
| 334 | # See skia:2789. |
Ben Wagner | 988d15e | 2017-04-27 13:08:50 -0400 | [diff] [blame] | 335 | extra_config_parts = api.vars.builder_cfg.get('extra_config', '').split('_') |
| 336 | if 'AbandonGpuContext' in extra_config_parts: |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 337 | args.extend(['--abandonGpuContext']) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 338 | |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 339 | with api.env(env): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 340 | api.run(api.flavor.step, target, cmd=args, |
| 341 | abort_on_failure=False) |
| 342 | |
| 343 | # Copy results to swarming out dir. |
| 344 | if api.vars.upload_perf_results: |
Robert Iannucci | 8cd5041 | 2017-07-07 14:36:58 -0700 | [diff] [blame] | 345 | api.file.ensure_directory('makedirs perf_dir', api.vars.perf_data_dir) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 346 | api.flavor.copy_directory_contents_to_host( |
| 347 | api.flavor.device_dirs.perf_data_dir, |
| 348 | api.vars.perf_data_dir) |
| 349 | |
| 350 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 351 | def RunSteps(api): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 352 | api.core.setup() |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 353 | env = {} |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 354 | if 'iOS' in api.vars.builder_name: |
| 355 | env['IOS_BUNDLE_ID'] = 'com.google.nanobench' |
Stephan Altmueller | 63e843d | 2017-04-25 11:38:38 -0400 | [diff] [blame] | 356 | env['IOS_MOUNT_POINT'] = api.vars.slave_dir.join('mnt_iosdevice') |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 357 | with api.env(env): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 358 | try: |
| 359 | if 'Chromecast' in api.vars.builder_name: |
| 360 | api.flavor.install(resources=True, skps=True) |
| 361 | else: |
| 362 | api.flavor.install_everything() |
| 363 | perf_steps(api) |
| 364 | finally: |
| 365 | api.flavor.cleanup_steps() |
| 366 | api.run.check_failure() |
| 367 | |
| 368 | |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 369 | TEST_BUILDERS = [ |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 370 | 'Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_Vulkan', |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 371 | 'Perf-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android', |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 372 | 'Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-Android', |
| 373 | 'Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-Android', |
| 374 | 'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android', |
| 375 | 'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android_Vulkan', |
| 376 | 'Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-Android', |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 377 | 'Perf-ChromeOS-Clang-Chromebook_C100p-GPU-MaliT764-arm-Release', |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 378 | 'Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Debug', |
Kevin Lubick | c78a2d7 | 2017-06-01 15:51:06 -0400 | [diff] [blame] | 379 | 'Perf-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release', |
Ben Wagner | adf17dc | 2017-09-12 23:41:00 -0400 | [diff] [blame^] | 380 | 'Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-UBSAN_float_cast_overflow', |
Ben Wagner | cc4221b | 2017-08-17 17:29:04 -0400 | [diff] [blame] | 381 | 'Perf-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release', |
| 382 | 'Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-CommandBuffer', |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 383 | 'Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release', |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 384 | 'Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', |
| 385 | ('Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind' + |
| 386 | '_AbandonGpuContext'), |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 387 | 'Perf-Ubuntu16-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-Vulkan', |
| 388 | 'Perf-Ubuntu16-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release', |
Brian Osman | 6a1a5f7 | 2017-04-21 15:38:27 -0400 | [diff] [blame] | 389 | 'Perf-Win10-MSVC-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-ANGLE', |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 390 | 'Perf-Win10-MSVC-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-ANGLE', |
| 391 | 'Perf-Win10-MSVC-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-Vulkan', |
Ben Wagner | 38a5601 | 2017-04-28 17:13:32 -0400 | [diff] [blame] | 392 | 'Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release-ANGLE', |
Ben Wagner | 8ab8f61 | 2017-08-17 13:53:09 -0400 | [diff] [blame] | 393 | 'Perf-Win10-MSVC-SurfacePro2017-GPU-IntelHD615-x86_64-Release-ANGLE', |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 394 | 'Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug', |
| 395 | 'Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Release', |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 396 | 'Perf-iOS-Clang-iPadMini4-GPU-GX6450-arm-Release' |
| 397 | ] |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 398 | |
| 399 | |
| 400 | def GenTests(api): |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 401 | for builder in TEST_BUILDERS: |
| 402 | test = ( |
| 403 | api.test(builder) + |
| 404 | api.properties(buildername=builder, |
| 405 | revision='abc123', |
| 406 | path_config='kitchen', |
| 407 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 408 | api.path.exists( |
| 409 | api.path['start_dir'].join('skia'), |
| 410 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 411 | 'skimage', 'VERSION'), |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 412 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 413 | 'skp', 'VERSION'), |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 414 | api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') |
Ben Wagner | f835c22 | 2017-04-30 11:14:51 -0400 | [diff] [blame] | 415 | ) + |
| 416 | api.step_data('get swarming bot id', |
| 417 | stdout=api.raw_io.output('skia-bot-123')) + |
| 418 | api.step_data('get swarming task id', |
| 419 | stdout=api.raw_io.output('123456')) |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 420 | ) |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 421 | if 'Win' in builder: |
| 422 | test += api.platform('win', 64) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 423 | |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 424 | if 'Chromecast' in builder: |
| 425 | test += api.step_data( |
| 426 | 'read chromecast ip', |
| 427 | stdout=api.raw_io.output('192.168.1.2:5555')) |
| 428 | |
| 429 | if 'ChromeOS' in builder: |
| 430 | test += api.step_data( |
| 431 | 'read chromeos ip', |
| 432 | stdout=api.raw_io.output('{"user_ip":"foo@127.0.0.1"}')) |
| 433 | |
| 434 | yield test |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 435 | |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 436 | builder = 'Perf-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Release' |
| 437 | yield ( |
| 438 | api.test('trybot') + |
| 439 | api.properties(buildername=builder, |
| 440 | revision='abc123', |
| 441 | path_config='kitchen', |
| 442 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 443 | api.properties(patch_storage='gerrit') + |
| 444 | api.properties.tryserver( |
| 445 | buildername=builder, |
| 446 | gerrit_project='skia', |
| 447 | gerrit_url='https://skia-review.googlesource.com/', |
| 448 | )+ |
| 449 | api.path.exists( |
| 450 | api.path['start_dir'].join('skia'), |
| 451 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 452 | 'skimage', 'VERSION'), |
| 453 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 454 | 'skp', 'VERSION'), |
| 455 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 456 | 'svg', 'VERSION'), |
| 457 | api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') |
| 458 | ) |
| 459 | ) |
| 460 | |
| 461 | builder = 'Perf-Android-Clang-NexusPlayer-CPU-SSE4-x86-Debug-Android' |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 462 | yield ( |
| 463 | api.test('failed_push') + |
| 464 | api.properties(buildername=builder, |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 465 | revision='abc123', |
| 466 | path_config='kitchen', |
Eric Boren | 5de544b | 2017-01-12 08:46:20 -0500 | [diff] [blame] | 467 | swarm_out_dir='[SWARM_OUT_DIR]') + |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 468 | api.path.exists( |
Ravi Mistry | 9bcca6a | 2016-11-21 16:06:19 -0500 | [diff] [blame] | 469 | api.path['start_dir'].join('skia'), |
| 470 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 471 | 'skimage', 'VERSION'), |
Ravi Mistry | 9bcca6a | 2016-11-21 16:06:19 -0500 | [diff] [blame] | 472 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 473 | 'skp', 'VERSION'), |
| 474 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 475 | 'svg', 'VERSION'), |
Ravi Mistry | 9bcca6a | 2016-11-21 16:06:19 -0500 | [diff] [blame] | 476 | api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 477 | ) + |
| 478 | api.step_data('push [START_DIR]/skia/resources/* '+ |
| 479 | '/sdcard/revenge_of_the_skiabot/resources', retcode=1) |
borenet | bfa5b45 | 2016-10-19 10:13:32 -0700 | [diff] [blame] | 480 | ) |