def Run(benchmark_spec): """Sets the GPU clock speed and runs the CUDA PCIe benchmark. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ vm = benchmark_spec.vms[0] # Note: The clock speed is set in this function rather than Prepare() # so that the user can perform multiple runs with a specified # clock speed without having to re-prepare the VM. cuda_toolkit_8.SetAndConfirmGpuClocks(vm) num_iterations = FLAGS.gpu_pcie_bandwidth_iterations raw_results = [] metadata = {} metadata.update(cuda_toolkit_8.GetMetadataFromFlags()) metadata['num_iterations'] = num_iterations metadata['num_gpus'] = cuda_toolkit_8.QueryNumberOfGpus(vm) run_command = ('%s/extras/demo_suite/bandwidthTest --device=all' % cuda_toolkit_8.CUDA_TOOLKIT_INSTALL_DIR) for i in range(num_iterations): stdout, _ = vm.RemoteCommand(run_command, should_log=True) raw_results.append(_ParseOutputFromSingleIteration(stdout)) if 'device_info' not in metadata: metadata['device_info'] = _ParseDeviceInfo(stdout) return _CalculateMetricsOverAllIterations(raw_results, metadata)
def _InstallAndAuthenticateVm(vm): """Install SHOC, ensure correct GPU state, and authenticate the VM for ssh. Args: vm: vm to operate on. """ vm.Install('shoc_benchmark_suite') cuda_toolkit_8.SetAndConfirmGpuClocks(vm) vm.AuthenticateVm() # Configure ssh between vms for MPI
def _PrepareHpcg(vm): """Install HPCG on a single vm. Args: vm: vm to operate on """ logging.info('Installing HPCG on %s', vm) vm.Install('hpcg') vm.AuthenticateVm() cuda_toolkit_8.SetAndConfirmGpuClocks(vm)