Ejemplo n.º 1
0
def AptInstall(vm):
    """Install the HPCG package on the VM.

  Args:
    vm: vm to target
  """
    vm.Install('wget')
    vm.InstallPackages('libopenmpi-dev numactl')
    vm.Install('cuda_toolkit')

    if FLAGS.cuda_toolkit_version == '8.0':
        hpcg_tar = HPCG_CUDA_8_TAR
        hpcg_binary = HPCG_CUDA_8_BINARY
    elif FLAGS.cuda_toolkit_version == '9.0':
        hpcg_tar = HPCG_CUDA_9_TAR
        hpcg_binary = HPCG_CUDA_9_BINARY
    else:
        raise cuda_toolkit.UnsupportedCudaVersionException(
            'HPCG only supports CUDA 8 and CUDA 9')
    vm.InstallPreprovisionedPackageData(PACKAGE_NAME, [hpcg_tar],
                                        linux_packages.INSTALL_DIR)
    vm.RemoteCommand('rm -rf %s' % HPCG_DIR)
    vm.RemoteCommand('mkdir %s' % HPCG_DIR)
    vm.RemoteCommand(
        'cd %s && tar xvf %s --directory=%s --strip-components=1' %
        (linux_packages.INSTALL_DIR, hpcg_tar, HPCG_DIR))
    # Create a symlink from the hpcg binary to 'hpcg'
    vm.RemoteCommand('cd %s && ln -s %s %s' % (HPCG_DIR, hpcg_binary, 'hpcg'))
Ejemplo n.º 2
0
def AptInstall(vm):
    """Install the HPCG package on the VM.

  Args:
    vm: vm to target
  """
    vm.Install('wget')
    vm.InstallPackages('numactl')
    vm.Install('cuda_toolkit')
    # HPCG CUDA 10 requires Open MPI 3.1 and HPCG CUDA 11 requires Open MPI 4.0
    vm.Install('openmpi')

    if FLAGS.cuda_toolkit_version not in CUDA_FILES:
        raise cuda_toolkit.UnsupportedCudaVersionException(
            f'HPCG only supports CUDA {sorted(CUDA_FILES)}')
    hpcg_tar, hpcg_binary = CUDA_FILES[FLAGS.cuda_toolkit_version]
    vm.InstallPreprovisionedPackageData(PACKAGE_NAME, [hpcg_tar],
                                        linux_packages.INSTALL_DIR)
    vm.RemoteCommand('rm -rf %s' % HPCG_DIR)
    vm.RemoteCommand('mkdir %s' % HPCG_DIR)
    vm.RemoteCommand(
        'cd %s && tar xvf %s --directory=%s --strip-components=1' %
        (linux_packages.INSTALL_DIR, hpcg_tar, HPCG_DIR))
    # Create a symlink from the hpcg binary to 'hpcg'
    if FLAGS.cuda_toolkit_version == '11.0':
        # HPCG only release the binary that supports CUDA 11. Use the data from
        # HPCG CUDA 10 package.
        vm.InstallPreprovisionedPackageData(PACKAGE_NAME, [hpcg_binary],
                                            HPCG_DIR)
        vm.RemoteCommand(f'chmod +x {posixpath.join(HPCG_DIR, hpcg_binary)}')
    vm.RemoteCommand('cd %s && ln -s %s %s' % (HPCG_DIR, hpcg_binary, 'hpcg'))
Ejemplo n.º 3
0
def AptInstall(vm):
    """Install the HPCG package on the VM.

  Args:
    vm: vm to target
  """
    vm.Install('wget')
    vm.InstallPackages('libopenmpi-dev numactl')
    vm.Install('cuda_toolkit')

    if FLAGS.cuda_toolkit_version == '8.0':
        hpcg_version = HPCG_CUDA_8
        hpcg_binary = HPCG_CUDA_8_BINARY
    elif FLAGS.cuda_toolkit_version == '9.0':
        hpcg_version = HPCG_CUDA_9
        hpcg_binary = HPCG_CUDA_9_BINARY
    else:
        raise cuda_toolkit.UnsupportedCudaVersionException(
            'HPCG only supports CUDA 8 and CUDA 9')

    vm.RemoteCommand('cd %s && wget %s' % (INSTALL_DIR, hpcg_version))
    vm.RemoteCommand('rm -rf %s' % HPCG_DIR)
    vm.RemoteCommand('mkdir %s' % HPCG_DIR)
    vm.RemoteCommand(
        'cd %s && tar xvf %s --directory=%s --strip-components=1' %
        (INSTALL_DIR, posixpath.basename(hpcg_version), HPCG_DIR))
    # Create a symlink from the hpcg binary to 'hpcg'
    vm.RemoteCommand('cd %s && ln -s %s %s' % (HPCG_DIR, hpcg_binary, 'hpcg'))