-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[BUGFIX] Improve compile/use of nvmlDeviceGetComputeRunningProcesses() #20887
Conversation
Hey @guanxingithub , Thanks for submitting the PR
CI supported jobs: [clang, miscellaneous, unix-cpu, windows-gpu, unix-gpu, windows-cpu, edge, website, sanity, centos-gpu, centos-cpu] Note: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving my approval from #20866
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the signature of the nvmlDeviceGetComputeRunningProcesses() function (as dictated by the driver include file and the NVML_NO_UNVERSIONED_FUNC_DEFS cmake flag), we want the local variable infos
vector to have an element type compatible with the 3rd arg of that function. This PR uses template meta-programming to deduce that. LGTM.
Description
This PR is filed to solve the issue reported in #20467 as well as #20863. For fixing this issue, an initial solution was provided in #20499 by @khaotik. This PR, with a fix from @DickJC123, adds more compilation robustness across drivers and both settings of the NVML_NO_UNVERSIONED_FUNC_DEFS cmake flag.
In this PR, we would like to merge these two solutions and find a general solution that avoids compilation errors no matter which signature of the nvmlDeviceGetComputeRunningProcesses() function is enabled in the code.
Checklist
Essentials
Dick Carter finished coding on this PR
All changes are fully tested by Guanxin Li
Code is well-documented
Changes
The change reduce the possibly versioned variant of nvmlProcessInfo_t* expected
as the 3rd arg of nvmlDeviceGetComputeRunningProcesses().
Comments
This change is a backward incompatible change, without this change, mxnet can't be compiled in cuda11 450.x driver