Skip to content

likwid: Add variant for Nvidia GPU profiling feature#20337

Merged
alalazo merged 7 commits intospack:developfrom
TomTheBear:develop
Dec 14, 2020
Merged

likwid: Add variant for Nvidia GPU profiling feature#20337
alalazo merged 7 commits intospack:developfrom
TomTheBear:develop

Conversation

@TomTheBear
Copy link
Copy Markdown
Contributor

With version 5.0, LIKWID got a profiling interface for Nvidia GPUs (based on CUPTI).
With 5.1, the interface was extended to work with the new CUpti Profiling API.
This PR adds a variant switch to activate that feature.

Single issue left: How to find the subfolder below spec['cuda'].prefix which includes cupti.h? It's not in spec['cuda'].prefix.include. Same for libcupti.so which is not in spec['cuda'].prefix.lib. The hardcoded paths spec['cuda'].prefix + "extras/CUPTI/{include,lib64}" probably work but might break in the future. Is there a spack-way to do it or should the standard library be used for this?

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Dec 11, 2020

Single issue left: How to find the subfolder below spec['cuda'].prefix which includes cupti.h?

Would implementing a:

@property
def headers(self):
    ...

similarly to what is done e.g. in openmpi be of help? Alternatively you can search for any file you need in this package, for instance:

files = find(spec['cuda'].prefix.extras, 'cupti.h', recursive=True)

@TomTheBear
Copy link
Copy Markdown
Contributor Author

Thanks for the hints. A headers property does not seem suitable, it's not the headers of LIKWID but the ones of a dependency (cuda). I used HeaderList(find()) and find_libraries().

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Dec 11, 2020

A headers property does not seem suitable, it's not the headers of LIKWID but the ones of a dependency

Sure, what I meant was either:

  1. Add headers to cuda and use them in likwid, or
  2. Solve it locally in likwid using find or similar functions

As a further hit: do you think this package would benefit from inheriting also from CudaPackage:

class Likwid(Package, CudaPackage):
    ...

? You can check what CudaPackage brings in by inspecting that class via:

$ spack edit -b cuda

@TomTheBear
Copy link
Copy Markdown
Contributor Author

IMHO: Since Cuda is only required when building with Nvidia GPU profiling support (default: off), a general inheritance of the Cuda class is not required. Moreover, spack edit -b cuda doesn't seem to provide any benefit for my case.

But Thanks. Every time I add something to LIKWID's package.py, I learn something new.

What's the problem with the ci/gitlab-ci check? I cannot see any output in the check's details.

@alalazo alalazo merged commit 8fd4719 into spack:develop Dec 14, 2020
@alalazo
Copy link
Copy Markdown
Member

alalazo commented Dec 14, 2020

What's the problem with the ci/gitlab-ci check?

I think it's a spurious failure that will be fixed soon. @zackgalbreath or @scottwittenburg may know more than I do.

@scottwittenburg
Copy link
Copy Markdown
Contributor

While we're still ironing out the kinks in the gitlab ci check, an actual breakage of the stc package slipped through near the end of last week. That's the thing affecting most PRs at the moment. I don't think I'd worry about it for this PR.

bollig pushed a commit to bollig/spack that referenced this pull request Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants