-
Notifications
You must be signed in to change notification settings - Fork 4.6k
CUDAService verbosity #35117
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
Merged
Merged
CUDAService verbosity #35117
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8637116
Do not abort on failed cudaDeviceGetLimit after cudaDeviceSetLimit
fwyzard 22b9df8
Make the CUDAService less verbose by default
fwyzard 80ac72e
Enable the CUDAService in the MessageLogger by default
fwyzard 23dd46b
Add nvmlCheck macro to validate NVIDIA Management Library (NVML) calls
fwyzard 7e86590
Print the NVIDIA and CUDA driver and library versions
fwyzard 1a5a345
Add SM details for the Ampere architecture
fwyzard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #ifndef HeterogeneousCore_CUDAUtilities_nvmlCheck_h | ||
| #define HeterogeneousCore_CUDAUtilities_nvmlCheck_h | ||
|
|
||
| // C++ standard headers | ||
| #include <iostream> | ||
| #include <sstream> | ||
| #include <stdexcept> | ||
| #include <string> | ||
| #include <string_view> | ||
|
|
||
| // CUDA headers | ||
| #include <nvml.h> | ||
|
|
||
| // CMSSW headers | ||
| #include "FWCore/Utilities/interface/Likely.h" | ||
|
|
||
| namespace cms { | ||
| namespace cuda { | ||
|
|
||
| [[noreturn]] inline void abortOnNvmlError(const char* file, | ||
| int line, | ||
| const char* cmd, | ||
| const char* error, | ||
| const char* message, | ||
| std::string_view description = std::string_view()) { | ||
| std::ostringstream out; | ||
| out << "\n"; | ||
| out << file << ", line " << line << ":\n"; | ||
| out << "nvmlCheck(" << cmd << ");\n"; | ||
| out << error << ": " << message << "\n"; | ||
| if (!description.empty()) | ||
| out << description << "\n"; | ||
| throw std::runtime_error(out.str()); | ||
| } | ||
|
|
||
| inline bool nvmlCheck_(const char* file, | ||
| int line, | ||
| const char* cmd, | ||
| nvmlReturn_t result, | ||
| std::string_view description = std::string_view()) { | ||
| if (LIKELY(result == NVML_SUCCESS)) | ||
| return true; | ||
|
|
||
| std::string error = "NVML Error " + std::to_string(result); | ||
| const char* message = nvmlErrorString(result); | ||
| abortOnNvmlError(file, line, cmd, error.c_str(), message, description); | ||
| return false; | ||
| } | ||
| } // namespace cuda | ||
| } // namespace cms | ||
|
|
||
| #define nvmlCheck(ARG, ...) (cms::cuda::nvmlCheck_(__FILE__, __LINE__, #ARG, (ARG), ##__VA_ARGS__)) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An other option is to fold this check into |
||
|
|
||
| #endif // HeterogeneousCore_CUDAUtilities_nvmlCheck_h | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.