Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the CUDA Profiling Tools Interface (CUPTI) #5512

Merged
merged 2 commits into from
Feb 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cuda-toolfile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ cat << \EOF_TOOLFILE >%{i}/etc/scram.d/cuda-nvrtc.xml
</tool>
EOF_TOOLFILE

cat << \EOF_TOOLFILE >%{i}/etc/scram.d/cupti.xml
<tool name="cupti" version="@TOOL_VERSION@">
<info url="https://docs.nvidia.com/cupti/Cupti/index.html"/>
<lib name="cupti"/>
</tool>
EOF_TOOLFILE

cat << \EOF_TOOLFILE >%{i}/etc/scram.d/nvperf.xml
<tool name="nvperf" version="@TOOL_VERSION@">
<info url="https://docs.nvidia.com/cupti/Cupti/index.html"/>
<lib name="nvperf_host"/>
<lib name="nvperf_target"/>
</tool>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fwyzard do we need these new tools? A tool with out INCLUDE and LIBDIR directory is of no use. If someone adds a dependency in BuildFile then scram does not know what should be -L/path for these libs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the include and libdir should be the same as cuda; should I add them explicitly ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you check if these libs are linked against libcuda.so? if then then just add dependency on cuda otherwise I would suggest to add a new cuda_interface tool file e.g. something like [a] and depend on it

[a]

cat << \EOF_TOOLFILE >%{i}/etc/scram.d/cuda_intrface.xml
<tool name="cuda_interface" version="@TOOL_VERSION@">
  <info url="https://docs.nvidia.com/cuda/index.html"/>
  <client>
    <environment name="CUDA_INTERFACE_BASE" default="@TOOL_ROOT@"/>
    <environment name="LIBDIR"          default="$CUDA_INTERFACE_BASE/lib64/stubs"/>
    <environment name="INCLUDE"         default="$CUDA_INTERFACE_BASE/include"/>
  </client>
  <flags SKIP_TOOL_SYMLINKS="1"/>
</tool>
EOF_TOOLFILE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, according to the output of ldd the new libraries do not depend on other cuda libraries.

For the moment I'll just add the include and lib64 explicitly, we can revise it once we understand a bit better the dependencies.

EOF_TOOLFILE

cat << \EOF_TOOLFILE >%{i}/etc/scram.d/nvidia-drivers.xml
<tool name="nvidia-drivers" version="@TOOL_VERSION@">
<info url="https://docs.nvidia.com/cuda/index.html"/>
Expand Down
10 changes: 10 additions & 0 deletions cuda.spec
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ mv %_builddir/build/cuda-toolkit/lib64/* %{i}/lib64/
# package the includes
mv %_builddir/build/cuda-toolkit/include/* %{i}/include/

# package the CUDA Profiling Tools Interface includea and libraries
%ifarch x86_64 ppc64le
chmod a+x %_builddir/build/cuda-toolkit/extras/CUPTI/lib64/*.so*
mv %_builddir/build/cuda-toolkit/extras/CUPTI/lib64/*.so* %{i}/lib64/
mv %_builddir/build/cuda-toolkit/extras/CUPTI/include/*.h %{i}/include/
%endif
%ifarch aarch64
# the RPMs already have the CUPTI files under lib64/ and include/
%endif

# leave out the Nsight and NVVP graphical tools
rm -f %_builddir/build/cuda-toolkit/bin/computeprof
rm -f %_builddir/build/cuda-toolkit/bin/nsight
Expand Down