Skip to content

Commit

Permalink
Work around a cuFile error when running CSV tests with memcheck (rapi…
Browse files Browse the repository at this point in the history
…dsai#15293)

Closes rapidsai#14140

Added a no-op CUDA call before creating a `kvikio::FileHandle` to avoid the error in `cuFileDriverOpen`.

Authors:
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Yunsong Wang (https://github.com/PointKernel)

URL: rapidsai#15293
  • Loading branch information
vuule authored Mar 16, 2024
1 parent 13f6cd3 commit f697b3e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/src/io/utilities/datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class file_source : public datasource {
explicit file_source(char const* filepath) : _file(filepath, O_RDONLY)
{
if (detail::cufile_integration::is_kvikio_enabled()) {
// Workaround for https://github.com/rapidsai/cudf/issues/14140, where cuFileDriverOpen errors
// out if no CUDA calls have been made before it. This is a no-op if the CUDA context is
// already initialized
cudaFree(0);

_kvikio_file = kvikio::FileHandle(filepath);
CUDF_LOG_INFO("Reading a file using kvikIO, with compatibility mode {}.",
_kvikio_file.is_compat_mode_on() ? "on" : "off");
Expand Down

0 comments on commit f697b3e

Please sign in to comment.