Does cuFile CU_FILE_HANDLE_TYPE_USERSPACE_FS support actually exist?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 122
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cuFileHandleRegister path and the CU_FILE_HANDLE_TYPE_USERSPACE_FS, CUfileDescr_t, and CUfileFSOps_t declarations mentioned in the report, then compare them with the repository's existing handle-registration samples. Reproduce the opaque-handle and file-descriptor cases and trace whether the provided callbacks are reached; done means documenting supported usage or confirming the API limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100