Nvidia lab2 solution not working using pgi compiler 18.4

The solution in C99 of lab #2 of the NVIDIA OpenACC course have a compilation error when using pgc++ 18.4. The error is:

/bin/ld: error in /tmp/pgc++Gz4GCd0guTL.o(.eh_frame); no .eh_frame_hdr table will be created.

And this is the NVIDIA-OpenACC-Course link:


Thanks in advance for any help!

Hi jcastro9999,

Thanks for the report! I added TPR#26338 to track this issue.

Luckily there are several work arounds.

First, the issue does not occur in our LLVM back-end compilers, so you can add “-Mllvm” to you compiler flags, or point your PATH to use the llvm compilers instead of the default native x86 compilers.

Alternatively you can add “-Mframe” and/or “–no_exceptions” to the compilation. The error appears that when “-Mnoframe” is applied, we’re missing one of the exception handler frames. Hence using “-Mframe” will keep the frame pointers, or “–no_exceptions” will remove exception handling.

Hope this helps,

Thanks Mat, that solved the problem.

I have a new problem with this lab. When I profile the initial sequential code of OpenACC lab2 using pgprof 18.1 or nvprof 9.0.176, following the same instrucctions of the lab:

nvprof --cpu-profiling on --cpu-profiling-mode top-down ./cg

I get the following output:

======== CPU profiling result (top down):
Time(%)      Time  Name
 99.67%  21.1572s  ???
 99.67%  21.1572s  | main
  0.14%  30.225ms  |   munmap
  0.19%  40.299ms  __c_mcopy8
  0.14%  30.225ms  __c_mset8

where the most time-consuming functions are not even recognized…

Any help is appreciated,


The routines are getting inlined. Try adding “-Mnoautoinline”.

Note that the PGI 2015 C++ compiler didn’t auto-inline by default, so at the time this lab was made, disabling inlining wasn’t needed.

% make                                             
pgc++ -fast -Mnoautoinline -Mframe  main.cpp -o cg
"vector.h", line 15: warning: variable "vcoefs" was declared but never
    double *vcoefs=v.coefs;

% nvprof --cpu-profiling on --cpu-profiling-mode top-down cg
======== Warning: This version of nvprof doesn't support the underlying device, GPU profiling skipped
Rows: 8120601, nnz: 218535025
Iteration: 0, Tolerance: 4.0067e+08
Iteration: 10, Tolerance: 1.8772e+07
Iteration: 20, Tolerance: 6.4359e+05
Iteration: 30, Tolerance: 2.3202e+04
Iteration: 40, Tolerance: 8.3565e+02
Iteration: 50, Tolerance: 3.0039e+01
Iteration: 60, Tolerance: 1.0764e+00
Iteration: 70, Tolerance: 3.8360e-02
Iteration: 80, Tolerance: 1.3515e-03
Iteration: 90, Tolerance: 4.6209e-05
Total Iterations: 100 Total Time: 22.856718s

======== CPU profiling result (top down):
Time(%)      Time  Name
 100.00%  23.6916s  ???
 100.00%  23.6916s    main
 75.26%  17.8312s      matvec(matrix const &, vector const &, vector const &)
 17.77%  4.21029s      waxpby(double, vector const &, double, vector const &, vector const &)
  4.47%  1.06007s      dot(vector const &, vector const &)
  2.36%  560.04ms      allocate_3d_poisson_matrix(matrix&, int)
  0.08%  20.001ms      __c_mset8
  0.04%  10.001ms      free_matrix(matrix&)
  0.04%  10.001ms        munmap

======== Data collected at 100Hz frequency

Thanks Mat, that solved the problem.


The dwarf generation (eh_frame) problem is resolved with 18.10.