Skip to content

Commit

Permalink
shim: only open the cufile driver when the streaming API isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Oct 25, 2024
1 parent e7bde28 commit 66a113f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cpp/include/kvikio/shim/cufile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ class cuFileAPI {

// cuFile is supposed to open and close the driver automatically but because of a bug in
// CUDA 11.8, it sometimes segfault. See <https://github.com/rapidsai/kvikio/issues/159>.
driver_open();
if (!stream_available) { // The stream API was introduced in CUDA 12.2.
driver_open();
}
}
~cuFileAPI() { driver_close(); }
// Notice, we don't close the driver at program exit since we are not allowed to call
// cuFile after main:
// <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#initialization>
~cuFileAPI() = default;
#else
cuFileAPI() { throw std::runtime_error("KvikIO not compiled with cuFile.h"); }
#endif
Expand Down

0 comments on commit 66a113f

Please sign in to comment.