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

Cuda component fixes #209

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Cuda component fixes #209

merged 2 commits into from
Jul 29, 2024

Conversation

wcohen
Copy link
Contributor

@wcohen wcohen commented Jul 26, 2024

Pull Request Description

When working through and trying to build locally build a PAPI RPM with the cuda component enabled, I found a couple minor issues in the cuda component that prevented it from being built:

  1. An sprintf without a format string
  2. Assumption that nvcc would be on the default path

When runing "run_tests.sh" the ctests/all_native_events: took a number of hours to complete, but the tests eventually completed.

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

Using a "%s" format in the sprintf to avoid the following error when
compiling the cuda component with -Werror=format-security :

components/cuda/linux-cuda.c: In function ‘cuda_init_private’:
components/cuda/linux-cuda.c:158:9: error: format not a string literal and no format arguments [-Werror=format-security]
  158 |         sprintf(_cuda_vector.cmp_info.disabled_reason, disabled_reason);
      |         ^~~~~~~
cc1: some warnings being treated as errors
…eing used

A check in the Makefile for the cuda tests assumed the nvcc found on
$PATH and the one referred to by $(NVCC) were the same.  It is
possible to have multiple versions of cuda installed on the system and
the one being used for $(NVCC) may not be the same as the one found on
the default path.  Should always be use $(NVCC) in the Makefile to
ensure getting the same version of nvcc.
@jagode jagode merged commit bd0b206 into icl-utk-edu:master Jul 29, 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