-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I made an attempt to use cuFile with a userspace file system.
The docs lead me to believe this is possible by initializing a CUfileDescr_t with type CU_FILE_HANDLE_TYPE_USERSPACE_FS. Then I presumably set the handle (void *) to a pointer to my opaque proprietary file handle. Finally I provide the CUfileFSOps_t set of callback functions for read/write and other administrative stuff. My expectation would be a cudaFileRead/Write would ultimately turn into a call to the read/write callback in fs_ops.
However, at runtime cuFileHandleRegister fails and appears to be treating my opaque handle pointer as a file descriptor # and going the traditional linux FD path:
13-04-2025 16:56:55:377 [pid=9 tid=9] ERROR cufio:227 cuFileHandleRegister error, invalid file descriptor: -962282608
Indeed, if I give it a legit FD as the handle, even with type CU_FILE_HANDLE_TYPE_USERSPACE_FS, then the register succeeds but the subsequent write fails.
In either case, no calls are ever made to my provided callbacks.
I have not been able to find any example code that either consumes or provides this USERSPACE_FS API. All the samples in this repo use the CU_FILE_HANDLE_TYPE_OPAQUE_FD handle type. This leads me to wonder if the USERSPACE_FS implementation inside libcufile is incomplete or abandoned? Or perhaps I'm misusing it in some way since I'm kind of guessing from the header at the intent?