cufile.h(3) | Library Functions Manual | cufile.h(3) |
cufile.h - cuFile C APIs
struct CUfileDescr_t
struct CUfileDrvProps
struct CUfileError
cufileop status string struct CUfileFSOps
struct CUfileIOEvents
struct CUfileIOParams
struct cufileRDMAInfo
#define CU_FILE_CUDA_ERR(status) ((status).cu_err)
#define CU_FILE_RDMA_REGISTER 1
#define CU_FILE_RDMA_RELAXED_ORDERING (1<<1)
#define CUFILE_ERRSTR(err)
cufileop_status_error((CUfileOpError)abs((err)))
#define cuFileDriverClose cuFileDriverClose_v2
#define IS_CUDA_ERR(status) ((status).err ==
CU_FILE_CUDA_DRIVER_ERROR)
#define IS_CUFILE_ERR(err) (abs((err)) > CUFILEOP_BASE_ERR)
error macros to inspect error status of type CUfileOpError
typedef void * CUfileBatchHandle_t
typedef enum cufileBatchMode CUfileBatchMode_t
typedef struct CUfileDescr_t CUfileDescr_t
typedef enum CUfileDriverControlFlags CUfileDriverControlFlags_t
typedef enum CUfileDriverStatusFlags CUfileDriverStatusFlags_t
typedef struct CUfileDrvProps CUfileDrvProps_t
typedef struct CUfileError CUfileError_t
cufileop status string typedef enum CUfileFeatureFlags
CUfileFeatureFlags_t
typedef struct CUfileFSOps CUfileFSOps_t
typedef void * CUfileHandle_t
File handle type. typedef struct CUfileIOEvents CUfileIOEvents_t
typedef struct CUfileIOParams CUfileIOParams_t
typedef enum CUfileOpcode CUfileOpcode_t
typedef struct cufileRDMAInfo cufileRDMAInfo_t
typedef enum CUFILEStatus_enum CUfileStatus_t
typedef struct sockaddr sockaddr_t
enum cufileBatchMode { CUFILE_BATCH = 1 }
enum CUfileDriverControlFlags { CU_FILE_USE_POLL_MODE = 0,
CU_FILE_ALLOW_COMPAT_MODE = 1 }
enum CUfileDriverStatusFlags { CU_FILE_LUSTRE_SUPPORTED = 0,
CU_FILE_WEKAFS_SUPPORTED = 1, CU_FILE_NFS_SUPPORTED = 2,
CU_FILE_GPFS_SUPPORTED = 3, CU_FILE_NVME_SUPPORTED = 4,
CU_FILE_NVMEOF_SUPPORTED = 5, CU_FILE_SCSI_SUPPORTED = 6,
CU_FILE_SCALEFLUX_CSD_SUPPORTED = 7, CU_FILE_NVMESH_SUPPORTED
= 8, CU_FILE_BEEGFS_SUPPORTED = 9 }
enum CUfileFeatureFlags { CU_FILE_DYN_ROUTING_SUPPORTED = 0,
CU_FILE_BATCH_IO_SUPPORTED = 1, CU_FILE_STREAMS_SUPPORTED = 2
}
enum CUfileFileHandleType { CU_FILE_HANDLE_TYPE_OPAQUE_FD = 1,
CU_FILE_HANDLE_TYPE_OPAQUE_WIN32 = 2,
CU_FILE_HANDLE_TYPE_USERSPACE_FS = 3 }
enum CUfileOpcode { CUFILE_READ = 0, CUFILE_WRITE }
enum CUFILEStatus_enum { CUFILE_WAITING = 0x000001,
CUFILE_PENDING = 0x000002, CUFILE_INVALID = 0x000004,
CUFILE_CANCELED = 0x000008, CUFILE_COMPLETE = 0x0000010,
CUFILE_TIMEOUT = 0x0000020, CUFILE_FAILED = 0x0000040 }
CUfileError_t cuFileBatchIOCancel
(CUfileBatchHandle_t batch_idp)
void cuFileBatchIODestroy (CUfileBatchHandle_t batch_idp)
CUfileError_t cuFileBatchIOGetStatus (CUfileBatchHandle_t
batch_idp, unsigned min_nr, unsigned *nr, CUfileIOEvents_t *iocbp,
struct timespec *timeout)
CUfileError_t cuFileBatchIOSetUp (CUfileBatchHandle_t
*batch_idp, unsigned nr)
CUfileError_t cuFileBatchIOSubmit (CUfileBatchHandle_t
batch_idp, unsigned nr, CUfileIOParams_t *iocbp, unsigned int flags)
CUfileError_t cuFileBufDeregister (const void *devPtr_base)
deregister an already registered device memory from cuFile
CUfileError_t cuFileBufRegister (const void *devPtr_base,
size_t length, int flags)
register an existing cudaMalloced memory with cuFile to pin for GPUDirect
Storage access. CUfileError_t cuFileDriverClose (void)
CUfileError_t cuFileDriverClose_v2 (void)
reset the cuFile library and release the nvidia-fs driver CUfileError_t
cuFileDriverGetProperties (CUfileDrvProps_t *props)
Gets the Driver session properties. CUfileError_t
cuFileDriverOpen (void)
Initialize the cuFile library and open the nvidia-fs driver.
CUfileError_t cuFileDriverSetMaxCacheSize (size_t
max_cache_size)
Control parameter to set maximum GPU memory reserved per device by the library
for internal buffering. CUfileError_t
cuFileDriverSetMaxDirectIOSize (size_t max_direct_io_size)
Control parameter to set max IO size(KB) used by the library to talk to
nvidia-fs driver. CUfileError_t
cuFileDriverSetMaxPinnedMemSize (size_t max_pinned_size)
Sets maximum buffer space that is pinned in KB for use by
cuFileBufRegister. CUfileError_t
cuFileDriverSetPollMode (bool poll, size_t poll_threshold_size)
Sets whether the Read/Write APIs use polling to do IO operations. void
cuFileHandleDeregister (CUfileHandle_t fh)
releases a registered filehandle from cuFile CUfileError_t
cuFileHandleRegister (CUfileHandle_t *fh, CUfileDescr_t
*descr)
cuFileHandleRegister is required, and performs extra checking that is memoized
to provide increased performance on later cuFile operations. ssize_t
cuFileRead (CUfileHandle_t fh, void *devPtr_base, size_t size,
off_t file_offset, off_t devPtr_offset)
read data from a registered file handle to a specified device memory long
cuFileUseCount (void)
returns use count of cufile drivers at that moment by the process. ssize_t
cuFileWrite (CUfileHandle_t fh, const void *devPtr_base,
size_t size, off_t file_offset, off_t devPtr_offset)
write data from a specified device memory to a registered file handle
CUfileOpError
cuFile C APIs
This file contains all the C APIs to perform GPUDirect Storage supported IO operations
error macros to inspect error status of type CUfileOpError
cufileop status string
File handle type.
Enumerator
Enumerator
Enumerator
Enumerator
Enumerator
Enumerator
Enumerator
deregister an already registered device memory from cuFile
Parameters:
Returns:
CU_FILE_INVALID_VALUE on invalid memory pointer or unregistered memory pointer
See also:
cuFileRead
cuFileWrite
register an existing cudaMalloced memory with cuFile to pin for GPUDirect Storage access.
Parameters:
Returns:
CU_FILE_NVFS_DRIVER_ERROR
CU_FILE_INVALID_VALUE
CU_FILE_CUDA_ERROR for unsupported memory type
CU_FILE_MEMORY_ALREADY_REGISTERED on error
CU_FILE_GPU_MEMORY_PINNING_FAILED if not enough pinned memory is available
Note:
Warning:
See also:
cuFileRead
cuFileWrite
reset the cuFile library and release the nvidia-fs driver
Returns:
CU_FILE_DRIVER_CLOSING if there are any active IO operations using cuFileRead or cuFileWrite
See also:
Gets the Driver session properties.
Returns:
See also:
cuFileDriverSetMaxDirectIOSize
cuFileDriverSetMaxCacheSize
cuFileDriverSetMaxPinnedMemSize
Initialize the cuFile library and open the nvidia-fs driver.
Returns:
CU_FILE_DRIVER_NOT_INITIALIZED
CU_FILE_DRIVER_VERSION_MISMATCH on driver version mismatch error
See also:
Control parameter to set maximum GPU memory reserved per device by the library for internal buffering.
Parameters:
Returns:
CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
Warning:
See also:
Control parameter to set max IO size(KB) used by the library to talk to nvidia-fs driver.
Parameters:
Returns:
CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
Warning:
See also:
Sets maximum buffer space that is pinned in KB for use by cuFileBufRegister.
Parameters:
Returns:
CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
Warning:
See also:
Sets whether the Read/Write APIs use polling to do IO operations.
Parameters:
Returns:
CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
Warning:
See also:
releases a registered filehandle from cuFile
Parameters:
Returns:
See also:
cuFileHandleRegister is required, and performs extra checking that is memoized to provide increased performance on later cuFile operations.
Parameters:
Returns:
CU_FILE_DRIVER_NOT_INITIALIZED on failure to load driver
CU_FILE_IO_NOT_SUPPORTED - if filesystem is not supported
CU_FILE_INVALID_VALUE if null or bad api arguments
CU_FILE_INVALID_FILE_OPEN_FLAG if file is opened with unsupported modes like no O_DIRECT
CU_FILE_INVALID_FILE_TYPE if filepath is not valid or is not a regular file
CU_FILE_HANDLE_ALREADY_REGISTERED if file handle/descriptor is already registered
Description cuFileHandleRegister registers the open file descriptor for use with cuFile IO operations.
This API will ensure that the file’s descriptor is checked for GPUDirect Storage support and returns a valid file handle on CU_FILE_SUCCESS.
Note:
See also:
cuFileWrite
cuFileHandleDeregister
read data from a registered file handle to a specified device memory
Parameters:
Returns:
-1 on error, in which case errno is set to indicate filesystem errors.
all other errors will return a negative integer value of CUfileOpError enum value.
Note:
This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended for cases where the BAR1 memory size is smaller than the size of the allocated memory.
See also:
cuFileHandleRegister
cuFileWrite
returns use count of cufile drivers at that moment by the process.
write data from a specified device memory to a registered file handle
Parameters:
Returns:
-1 on error, in which case errno is set to indicate filesystem errors.
all other errors will return a negative integer value of CUfileOpError enum value.
Note:
This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended for cases where the BAR1 memory size is smaller than the size of the allocated memory.
See also:
cuFileHandleRegister
cuFileRead
Generated automatically by Doxygen for GPUDirect Storage from the source code.
Wed Dec 14 2022 | GPUDirect Storage |