You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This came up during the ALCF INCITE Hackathon this year (team that @cms21 was mentoring). This is a corner case in which a user 1) is using PrgEnv-nvhpc compilers 2) is using OpenACC 3) is not using CUDA but wants NVTX.
If you compile CUDA code with the default modules (PrgEnv-nvhpc and nvhpc/21.9 right now), you should be to compile and link agains the NVTX (host-based, header only) library without modifying any environment variables or specifying any paths to the library or header. E.g. for test.c
However, without -cuda for nvc, it will fail to find nvToolsExt.h. This group was trying to build and run an OpenACC code and profile it with NVTX markers.
Just adding -cuda is a hacky workaround that works with nvc and nvc++ to get NVTX working with an OpenACC code, but it also links in a bunch of CUDA libraries you might not need (-lcudadevrt -lcudart -lcudanvhpc). Passing -I and -L paths for NVTX is the correct approach for NVHPC compilers:
nvc -c test.c -I/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/cuda/include
nvc test.o -o test -L/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/cuda/lib64 -lnvToolsExt
But we should document this in the user guide.
No need to modify the existing modulefiles as far as I can see since it works out of the box for CUDA applications, except:
Somewhat related: the nvhpc/21.9 Lmod modulefile supplied by HPE has two more erroneous lines, each missing a forward slash:
This came up during the ALCF INCITE Hackathon this year (team that @cms21 was mentoring). This is a corner case in which a user 1) is using
PrgEnv-nvhpc
compilers 2) is using OpenACC 3) is not using CUDA but wants NVTX.If you compile CUDA code with the default modules (
PrgEnv-nvhpc
andnvhpc/21.9
right now), you should be to compile and link agains the NVTX (host-based, header only) library without modifying any environment variables or specifying any paths to the library or header. E.g. fortest.c
E.g. these compile fine:
However, without
-cuda
fornvc
, it will fail to findnvToolsExt.h
. This group was trying to build and run an OpenACC code and profile it with NVTX markers.Just adding
-cuda
is a hacky workaround that works withnvc
andnvc++
to get NVTX working with an OpenACC code, but it also links in a bunch of CUDA libraries you might not need (-lcudadevrt -lcudart -lcudanvhpc
). Passing-I
and-L
paths for NVTX is the correct approach for NVHPC compilers:But we should document this in the user guide.
No need to modify the existing modulefiles as far as I can see since it works out of the box for CUDA applications, except:
Somewhat related: the
nvhpc/21.9
Lmod modulefile supplied by HPE has two more erroneous lines, each missing a forward slash:So the default
LD_LIBRARY_PATH
is messed up.The text was updated successfully, but these errors were encountered: