Loading NVHPC

  • modulenvidia/nvhpc/21.5
  • modulenvidia/nvhpc/21.7
  • modulenvidia/nvhpc/23.7
  • modulenvidia/nvhpc/23.11
  • modulenvidia/nvhpc/24.11
  • modulenvidia/nvhpc-nompi
  • modulenvidia/nvhpc-hpcx
  • modulenvidia/nvhpc-openmpi3
  • modulenvidia/nvhpc-byo-compiler
  • modulenvidia/nvhpc-hpcx-cuda11
  • modulenvidia/nvhpc-hpcx-cuda12
  • modulenvtop/3.0.1
  • modulenvtop/3.1.0
Tip: load modules inside your SLURM job script, not just on the login node, so compute nodes see the same environment. Verify with which after loading.

Commands

  • NVIDIA Nsight SystemsSystem-wide performance analysis tool
  • NVIDIA Nsight ComputeInteractive kernel profiler
  • NVIDIA Debugger (cuda-gdb)For debugging GPU applications
  • NVTOPInteractive GPU process monitor

Example usage

Load NVHPC

module load nvidia/nvhpc/24.11

Compile with NVHPC compilers

nvc myprogram.c -o myprogram
nvc++ myprogram.cpp -o myprogram
nvfortran myprogram.f90 -o myprogram

GPU acceleration with OpenACC and CUDA

nvc -acc -Minfo=accel myprogram.c -o myprogram
nvc -cuda -Minfo=accel mycudaprogram.cu -o mycudaprogram

Optimization and GPU options

nvc -O3 myprogram.c -o myprogram
nvc -acc=gpu -gpu=cc80 myprogram.c -o myprogram
nvc -acc=gpu -gpu=managed myprogram.c -o myprogram
nvc -acc=gpu -gpu=lineinfo myprogram.c -o myprogram
nvc -acc=gpu myprogram.c -o myprogram -lcublas -lcufft
nsys profile ./myprogram

SLURM script example (GPU MPI job)

#!/bin/bash
#SBATCH --job-name=nvhpc_test
#SBATCH --output=nvhpc_test.out
#SBATCH -p a100
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --gres=gpu:2
#SBATCH --time=01:00:00

module load nvidia/nvhpc-hpcx-cuda12/23.11

mpicc -acc=gpu -Minfo=accel mpi_gpu_example.c -o mpi_gpu_example
mpirun -np $SLURM_NTASKS ./mpi_gpu_example

Availability

NVHPC is available on: SeaWulf, NVwulf, ClinWulf.