# Code profiling w/ nvhpc

**URL:** <https://ask.cyberinfrastructure.org/t/code-profiling-w-nvhpc/2712>\
**Category:** ACCESS Forums\
**Tags:** programming-for-hpc\
**Created:** [March 20, 2023, 7:57pm UTC](https://ask.cyberinfrastructure.org/t/code-profiling-w-nvhpc/2712 "2023-03-20T19:57:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nucci](https://ask.cyberinfrastructure.org/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@nucci](https://ask.cyberinfrastructure.org/u/nucci)\
**Post date:** [March 20, 2023, 7:57pm UTC](https://ask.cyberinfrastructure.org/t/code-profiling-w-nvhpc/2712/1 "2023-03-20T19:57:12Z")

</div>

I am looking to port a Fortran (yes, Fortran) application to use GPU/CUDA, using the nvhpc compilers.

Prior to any conversion work, I am looking to identify the code hotspots via a profiler. In the past I would use the pgprof profiler, but it looks like nvhpc has removed pgprof and uses nsys instead. I compiled with the -g -pg flags and a run generates a gmon.out file, but I can’t seem to find a way to get the profilers to recognize this.

I am using:

pgf90 (aka nvfortran) 23.1-0 64-bit target on x86-64 Linux -tp skylake-avx512  
PGI Compilers and Tools  
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Are there any tutorials out there on how to use the new nvhpc profilers that someone can point me to?

Thanks.

---

<div class="post-metadata">

**Author:** ![dhoward](https://ask.cyberinfrastructure.org/user_avatar/ask.cyberinfrastructure.org/dhoward/32/935_2.png) [@dhoward](https://ask.cyberinfrastructure.org/u/dhoward)\
**Post date:** [March 20, 2023, 11:00pm UTC](https://ask.cyberinfrastructure.org/t/code-profiling-w-nvhpc/2712/2 "2023-03-20T23:00:37Z")

</div>

Hello Jeff @nucci,

The nsys profilers are called at time of execution of the program, ie `nsys --profile <options> <executable> <args>`.

Various trainings already exist online and a great resource page for GPU programming in general, including using profilers, can be found here: [https://www.openhackathons.org/s/technical-resources](https://www.openhackathons.org/s/technical-resources)

The NVIDIA and OpenACC organization’s maintained tutorial resource here [gpubootcamp/hpc/miniprofiler at master · openhackathons-org/gpubootcamp · GitHub](https://github.com/openhackathons-org/gpubootcamp/tree/master/hpc/miniprofiler) is one of my favorites.

Another resource I worked on at NCAR was a GPU Training workshop. Our sessions on Nsight Systems/Compute can be found here: [GitHub - NCAR/GPU\_workshop](https://github.com/NCAR/GPU_workshop) (See sessions 10 and 11).

If you don’t like any of the above resources, happy to suggest more. Can also provide direct advice too on Nsight and other tools if you have more specific asks or encounter problems.
