Skip to main content
`Ctrl`+`K`

# PetscLogGpuEnergy

turn on the logging of GPU energy (estimated with power*gtime) for GPU kernels

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscLogGpuEnergy(void)

## Options Database Key

- -log_view_gpu_energy - provide the GPU energy consumption (estimated with power*gtime) for all events in the `-log_view` output

## Note

This option is mutually exclusive to `-log_view_gpu_energy_meter`.

## Developer Note

This option turns on energy monitoring of GPU kernels and requires CUDA version >= 12.2. The energy consumption is estimated as instant_power * gpu_kernel_time. Due to the delay in NVML power sampling, we read the instantaneous power draw at the end of each event using `nvmlDeviceGetFieldValues()` with the field ID `NVML_FI_DEV_POWER_INSTANT`.

## See Also

Profiling, `PetscLogView()`, `PetscLogGpuEnergyMeter()`

## Level

advanced

## Location

src/sys/logging/plog.c

Index of all Log routines
Table of Contents for all manual pages
Index of all manual pages