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

Updating the order of conditional checks to load library files in the Cuda component #268

Conversation

Treece-Burgess
Copy link
Contributor

@Treece-Burgess Treece-Burgess commented Oct 22, 2024

Pull Request Description

This PR updates the ordering of conditional checks in the Cuda component. Specifically for the functions load_cudart_sym,load_cupti_common_sym, and load_nvpw_sym.

Current master has the following workflow of checks:

  1. Check to see if PAPI_CUDA_RUNTIME/PAPI_CUDA_CUPTI/PAPI_CUDA_PERFWORKS are set, if so we will search this path for the necessary library files.
  2. Use dl_iterate_phdr() to walk through the list of shared objects linked in the executable.
  3. Check to see if PAPI_CUDA_ROOT is set and the previous two steps failed; we then search the path that PAPI_CUDA_ROOT is set to for the necessary library files.
  4. We use dlopen.

This PR updates the workflow of checks to:

  1. Check to see if PAPI_CUDA_RUNTIME/PAPI_CUDA_CUPTI/PAPI_CUDA_PERFWORKS are set, if so we will search this path for the necessary library files.
  2. Check to see if PAPI_CUDA_ROOT is set and the previous step failed; we then search the path that PAPI_CUDA_ROOT is set to for the necessary library files.
  3. Use dl_iterate_phdr() to walk through the list of shared objects linked in the executable.
  4. We use dlopen.

This is being done since we state in the documentation that PAPI_CUDA_ROOT is needed for both runtime and compilation.

Tested on Leconte with eight Tesla V100's with results:

  • If PAPI_CUDA_RUNTIME/PAPI_CUDA_CUPTI/PAPI_CUDA_PERFWORKS are set these do indeed take precedent as expected.
  • If we do not set the above environment variables and a user has set PAPI_CUDA_ROOT then we do have successfully have this as the second option to be searched.
  • If neither of the above mentioned environment variables are set, we do search the linux default directories.

Author Checklist

  • Description
    Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
  • Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • Tests
    The PR needs to pass all the tests

@Treece-Burgess Treece-Burgess merged commit 9574363 into icl-utk-edu:master Oct 25, 2024
26 checks passed
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.

2 participants