-
Notifications
You must be signed in to change notification settings - Fork 916
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
Test that cuInit is not called when RAPIDS_NO_INITIALIZE is set #12545
Test that cuInit is not called when RAPIDS_NO_INITIALIZE is set #12545
Conversation
c37b961
to
de5bfce
Compare
This is an alternate approach to checking that we don't call
versus:
|
de5bfce
to
ff4f5f5
Compare
An alternate approach to that tried in rapidsai#12361, here we just script GDB and check if we hit a breakpoint in cuInit. When RAPIDS_NO_INITIALIZE is set in the environment, merely importing cudf should not call into the CUDA runtime/driver (i.e. no cuInit should be called). Conversely, to check that we are scripting GDB properly, when we create a cudf object, we definitely _should_ hit cuInit.
ff4f5f5
to
9da854e
Compare
Codecov ReportBase: 86.58% // Head: 85.70% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## branch-23.02 #12545 +/- ##
================================================
- Coverage 86.58% 85.70% -0.88%
================================================
Files 155 155
Lines 24368 24865 +497
================================================
+ Hits 21098 21311 +213
- Misses 3270 3554 +284
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
I'm +1 to this approach
I like this approach too. |
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.
This is much better!
Minor nit: would it be simpler to write out the gdb command into a bash script (could even write to a tempfile within the Python script itself if we really wanted to be fancy, but I'm mostly just thinking of saving a bash script in the repo to be executed by the test)? It could accept a single argument, the Python command to execute, and then return an appropriate exit code. The subprocess lines aren't terribly readable.
We'll just use cuda-gdb which already exists instead.
…re/test-no-cuInit-via-gdb
Thanks, done! |
|
Skipping test on arm64 for now, since cuda-gdb is non-functional. |
Removing |
Originally I modified the dependencies.yaml but it turned out not to be necessary. |
…re/test-no-cuInit-via-gdb
/merge |
…/test-no-cuInit-via-gdb
Since rapidsai#12545, we use cuda-gdb for scripting (since that is already installed in the nvidia/cuda:-devel docker images) to check that RAPIDS_NO_INITIALIZE ensured that cuInit is not called on import. Unfortunately, the official cuda-gdb-11-2 package for Debian-based systems does not correctly advertise all its dependencies (we need to manually install libtinfo5 and libncursesw5). Consequently cuda-gdb does not work if the base image rapids builds against is for CUDA 11.2. To workaround this, just ask conda to install gdb for us, since we don't actually need any cuda-gdb features.
Since rapidsai#12545, we use cuda-gdb for scripting (since that is already installed in the nvidia/cuda:-devel docker images) to check that RAPIDS_NO_INITIALIZE ensured that cuInit is not called on import. Unfortunately, the official cuda-gdb-11-2 package for Debian-based systems does not correctly advertise all its dependencies (we need to manually install libtinfo5 and libncursesw5). Consequently cuda-gdb does not work if the base image rapids builds against is for CUDA 11.2. To workaround this, build the cuda-gdb command as a fixture that is appropriately marked in the cases where it is either not installed, or else not working due to broken dependencies.
) Since #12545, we use cuda-gdb for scripting (since that is already installed in the nvidia/cuda:-devel docker images) to check that RAPIDS_NO_INITIALIZE ensured that cuInit is not called on import. Unfortunately, the official cuda-gdb-11-2 package for Debian-based systems does not correctly advertise all its dependencies (we need to manually install libtinfo5 and libncursesw5). Consequently cuda-gdb does not work if the base image rapids builds against is for CUDA 11.2. To workaround this, build the cuda-gdb command as a fixture that is appropriately marked in the cases where it is either not installed, or else not working due to broken dependencies. Authors: - Lawrence Mitchell (https://github.com/wence-) - Ashwin Srinath (https://github.com/shwina) Approvers: - Ashwin Srinath (https://github.com/shwina) URL: #12644
Description
An alternate approach to that tried in #12361, here we just script GDB and check if we hit a breakpoint in cuInit. When RAPIDS_NO_INITIALIZE is set in the environment, merely importing cudf should not call into the CUDA runtime/driver (i.e. no cuInit should be called). Conversely, to check that we are scripting GDB properly, when we create a cudf object, we definitely should hit cuInit.
Checklist