You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hook: Add conditional library initialization in cuGetProcAddress()
initialize_libnvshare() is our bootstrapping function, which, among others,
obtains the original CUDA function addresses needed for our hook logic.
We currently only call initialize_libnvshare() when the user application
makes its first call to cuInit(), which we assume is **always** the first
CUDA Driver API function that it makes.
However, CUDA >=11.3 applications that use the Runtime API call
cuGetProcAddress() before cuInit(), which means that in these
cases cuGetProcAddress() is the first function called.
So far we were lucky, as the first call that such apps make is
cuGetProcAddress("cuInit"), which falls into our custom handling cases
and does not invoke the original cuGetProcAddress() to which we don't
have a pointer, as we haven't bootstrapped CUDA yet.
To address the aforementioned case and avoid potential NULL pointer
dereferences, add a one-time call to initialize_libnvshare()
in cuGetProcAddress().
Signed-off-by: Xinyuan Lyu <[email protected]>
0 commit comments