def METHOD_NAME(
    vm: virtual_machine.BaseVirtualMachine) -> List[sample.Sample]:
  """Run CUDA memcpy on the cluster.
  Args:
    vm: The virtual machine to run the benchmark.
  Returns:
    A list of sample.Sample objects.
  """
  if not nvidia_driver.CheckNvidiaSmiExists(vm):
    return []
  global_metadata = _MetadataFromFlags()
  global_metadata.update(cuda_toolkit.GetMetadata(vm))
  global_cmd = [cuda_samples.GetBandwidthTestPath(vm), '--csv',
                f'--memory={_MEMORY.value}', f'--mode={_MODE.value}']
  if _HTOD.value:
    global_cmd.append('--htod')
  if _DTOH.value:
    global_cmd.append('--dtoh')
  if _DTOD.value:
    global_cmd.append('--dtod')
  if _WC.value:
    global_cmd.append('--wc')
  num_gpus = nvidia_driver.QueryNumberOfGpus(vm)
  devices = list(range(num_gpus)) + (['all'] if num_gpus > 1 else [])
  samples = []
  for device in devices:
    cmd = ' '.join(global_cmd + [f'--device={device}'])
    stdout, stderr, exit_code = vm.RemoteCommandWithReturnCode(
        cmd, ignore_failure=True)
    if exit_code:
      logging.warning('Error with getting GPU stats: %s', stderr)
      continue
    results = regex_util.ExtractAllMatches(
        r'bandwidthTest-(\S+), '
        r'Bandwidth = ([\d\.]+) (\S+), '
        r'Time = ([\d\.]+) s, '
        r'Size = (\d+) bytes, '
        r'NumDevsUsed = (\d+)', stdout)
    for metric, bandwidth, unit, time, size, num_devs_used in results:
      metadata = {
          'time': float(time),
          'size': int(size),
          'NumDevsUsed': num_devs_used,
          'device': device,
          'command': cmd,
      }
      metadata.update(global_metadata)
      samples.append(
          sample.Sample(metric, float(bandwidth), unit, metadata))
  return samples