Errors and Error Handling

Errors and Error Handling#

ROCprofiler-SDK developer API: Errors and Error Handling
ROCprofiler-SDK developer API 1.4.1
ROCm Profiling API and tools
Errors and Error Handling

Data Structures

struct  hipFileError_t
 Error status returned from hipFile API calls. More...
 

Macros

#define HIPFILE_BASE_ERR   5000
 The base value for hipFile error codes.
 
#define IS_HIPFILE_ERR(hip_op_err)
 Determine if an error code is a hipFile error.
 
#define HIPFILE_ERRSTR(hip_op_err)
 Get an error string for a hipFile error.
 
#define IS_HIP_DRV_ERR(hip_err)
 Determine if an error is a hipFile driver error.
 
#define HIP_DRV_ERR(hip_err)
 Get the driver error from a hipFileError_t.
 

Enumerations

enum  hipFileOpError_t {
  hipFileSuccess = 0 ,
  hipFileDriverNotInitialized = 5000 + 1 ,
  hipFileDriverInvalidProps = 5000 + 2 ,
  hipFileDriverUnsupportedLimit = 5000 + 3 ,
  hipFileDriverVersionMismatch = 5000 + 4 ,
  hipFileDriverVersionReadError = 5000 + 5 ,
  hipFileDriverClosing = 5000 + 6 ,
  hipFilePlatformNotSupported = 5000 + 7 ,
  hipFileIONotSupported = 5000 + 8 ,
  hipFileDeviceNotSupported = 5000 + 9 ,
  hipFileDriverError = 5000 + 10 ,
  hipFileHipDriverError = 5000 + 11 ,
  hipFileHipPointerInvalid = 5000 + 12 ,
  hipFileHipMemoryTypeInvalid = 5000 + 13 ,
  hipFileHipPointerRangeError = 5000 + 14 ,
  hipFileHipContextMismatch = 5000 + 15 ,
  hipFileInvalidMappingSize = 5000 + 16 ,
  hipFileInvalidMappingRange = 5000 + 17 ,
  hipFileInvalidFileType = 5000 + 18 ,
  hipFileInvalidFileOpenFlag = 5000 + 19 ,
  hipFileDIONotSet = 5000 + 20 ,
  hipFileInvalidValue = 5000 + 22 ,
  hipFileMemoryAlreadyRegistered = 5000 + 23 ,
  hipFileMemoryNotRegistered = 5000 + 24 ,
  hipFilePermissionDenied = 5000 + 25 ,
  hipFileDriverAlreadyOpen = 5000 + 26 ,
  hipFileHandleNotRegistered = 5000 + 27 ,
  hipFileHandleAlreadyRegistered = 5000 + 28 ,
  hipFileDeviceNotFound = 5000 + 29 ,
  hipFileInternalError = 5000 + 30 ,
  hipFileGetNewFDFailed = 5000 + 31 ,
  hipFileDriverSetupError = 5000 + 33 ,
  hipFileIODisabled = 5000 + 34 ,
  hipFileBatchSubmitFailed = 5000 + 35 ,
  hipFileGPUMemoryPinningFailed = 5000 + 36 ,
  hipFileBatchFull = 5000 + 37 ,
  hipFileAsyncNotSupported = 5000 + 38 ,
  hipFileIOMaxError = 5000 + 39
}
 hipFile function return codes More...
 

Functions

const char * hipFileGetOpErrorString (hipFileOpError_t status)
 Return a descriptive string for a hipFile error.
 

Detailed Description


Data Structure Documentation

◆ hipFileError_t

struct hipFileError_t

Error status returned from hipFile API calls.

Note
This struct has the [[nodiscard]] attribute in C++ >= 17 and C >= 23 so unhandled return values will generate warnings

Definition at line 207 of file hipfile.h.

+ Collaboration diagram for hipFileError_t:
Data Fields
hipFileOpError_t err Errors related to hipFile or the GPU IO driver.
hipError_t hip_drv_err Errors related to the GPU driver.

Macro Definition Documentation

◆ HIP_DRV_ERR

#define HIP_DRV_ERR (   hip_err)

#include <rocprofiler-sdk/hipfile/details/hipfile.h>

Get the driver error from a hipFileError_t.

Signature

hipError_t HIP_DRV_ERR(hipFileError_t err)
#define HIP_DRV_ERR(hip_err)
Get the driver error from a hipFileError_t.
Definition hipfile.h:269
Error status returned from hipFile API calls.
Definition hipfile.h:207
Returns
The hipError_t component of err

Definition at line 269 of file hipfile.h.

◆ HIPFILE_BASE_ERR

#define HIPFILE_BASE_ERR   5000

#include <rocprofiler-sdk/hipfile/details/hipfile.h>

The base value for hipFile error codes.

Definition at line 124 of file hipfile.h.

◆ HIPFILE_ERRSTR

#define HIPFILE_ERRSTR (   hip_op_err)

#include <rocprofiler-sdk/hipfile/details/hipfile.h>

Get an error string for a hipFile error.

Signature

const char *HIPFILE_ERRSTR(hipFileOpError err)
#define HIPFILE_ERRSTR(hip_op_err)
Get an error string for a hipFile error.
Definition hipfile.h:238
Returns
A string description of a hipFile error

Definition at line 238 of file hipfile.h.

◆ IS_HIP_DRV_ERR

#define IS_HIP_DRV_ERR (   hip_err)

#include <rocprofiler-sdk/hipfile/details/hipfile.h>

Determine if an error is a hipFile driver error.

Signature

#define IS_HIP_DRV_ERR(hip_err)
Determine if an error is a hipFile driver error.
Definition hipfile.h:253
Returns
true/false

Definition at line 253 of file hipfile.h.

◆ IS_HIPFILE_ERR

#define IS_HIPFILE_ERR (   hip_op_err)

#include <rocprofiler-sdk/hipfile/details/hipfile.h>

Determine if an error code is a hipFile error.

Signature

bool IS_HIPFILE_ERR(hipFileOpError err)
#define IS_HIPFILE_ERR(hip_op_err)
Determine if an error code is a hipFile error.
Definition hipfile.h:224
Returns
true/false

Definition at line 224 of file hipfile.h.

Enumeration Type Documentation

◆ hipFileOpError_t

#include <rocprofiler-sdk/hipfile/details/hipfile.h>

hipFile function return codes

An error code of -1 indicates a that a C or POSIX error has occurred and errno is likely to have been set.

Note
HIPFILE_BASE_ERR + 21 and 32 are intentionally omitted.
Enumerator
hipFileSuccess 

hipFile operation completed successfully

hipFileDriverNotInitialized 

GPU IO driver is not loaded.

hipFileDriverInvalidProps 

Invalid GPU IO driver property provided.

hipFileDriverUnsupportedLimit 

GPU IO Driver property value is unsupported.

hipFileDriverVersionMismatch 

hipFile version does not match GPU IO driver version

hipFileDriverVersionReadError 

Unable to read the GPU IO driver version.

hipFileDriverClosing 

GPU IO driver is closing and not accepting new requests.

hipFilePlatformNotSupported 

hipFile is not supported on the current platform

hipFileIONotSupported 

hipFile is not supported on the selected file

hipFileDeviceNotSupported 

The selected GPU does not support hipFile.

hipFileDriverError 

GPU IO driver error.

hipFileHipDriverError 

GPU driver error: Inspect the hipError_t value for additional information.

hipFileHipPointerInvalid 

Invalid GPU pointer.

hipFileHipMemoryTypeInvalid 

Memory type backing pointer is incompatible with hipFile.

hipFileHipPointerRangeError 

Pointer range exceeds allocated memory region.

hipFileHipContextMismatch 

GPU driver context mismatch.

hipFileInvalidMappingSize 

Accessing memory beyond pinned memory buffer.

hipFileInvalidMappingRange 

Accessing memory beyond mapped memory region.

hipFileInvalidFileType 

Unsupported file type.

hipFileInvalidFileOpenFlag 

Unsupported file open flags.

hipFileDIONotSet 

O_DIRECT flag not set.

hipFileInvalidValue 

One or more arguments have an invalid value.

hipFileMemoryAlreadyRegistered 

Device pointer is already registered.

hipFileMemoryNotRegistered 

Device pointer is not registered.

hipFilePermissionDenied 

Permission error on device or file access.

hipFileDriverAlreadyOpen 

GPU IO driver is already open.

hipFileHandleNotRegistered 

File handle for GPU IO is not registered.

hipFileHandleAlreadyRegistered 

File handle for GPU IO is already registered.

hipFileDeviceNotFound 

Selected device not found.

hipFileInternalError 

Internal GPU IO library error.

hipFileGetNewFDFailed 

Unable to obtain a new file descriptor.

hipFileDriverSetupError 

GPU IO Driver initialization error.

hipFileIODisabled 

GPU IO config file prohibits GPU IO on specified file.

hipFileBatchSubmitFailed 

Failed to submit request for batch operation.

hipFileGPUMemoryPinningFailed 

Failed to allocated pinned device memory.

hipFileBatchFull 

Batch operation queue is full.

hipFileAsyncNotSupported 

hipFile async IO is not supported

hipFileIOMaxError 

Internal flag to mark largest hipFile error code.

Definition at line 136 of file hipfile.h.

136 {
137 hipFileSuccess = 0, //!< hipFile operation completed successfully
138 hipFileDriverNotInitialized = HIPFILE_BASE_ERR + 1, //!< GPU IO driver is not loaded
139 hipFileDriverInvalidProps = HIPFILE_BASE_ERR + 2, //!< Invalid GPU IO driver property provided
140 hipFileDriverUnsupportedLimit = HIPFILE_BASE_ERR + 3, //!< GPU IO Driver property value is unsupported
141 hipFileDriverVersionMismatch = HIPFILE_BASE_ERR + 4, //!< hipFile version does not match GPU IO driver version
142 hipFileDriverVersionReadError = HIPFILE_BASE_ERR + 5, //!< Unable to read the GPU IO driver version
143 hipFileDriverClosing = HIPFILE_BASE_ERR + 6, //!< GPU IO driver is closing and not accepting new requests
144 hipFilePlatformNotSupported = HIPFILE_BASE_ERR + 7, //!< hipFile is not supported on the current platform
145 hipFileIONotSupported = HIPFILE_BASE_ERR + 8, //!< hipFile is not supported on the selected file
146 hipFileDeviceNotSupported = HIPFILE_BASE_ERR + 9, //!< The selected GPU does not support hipFile
147 hipFileDriverError = HIPFILE_BASE_ERR + 10, //!< GPU IO driver error
148 hipFileHipDriverError = HIPFILE_BASE_ERR + 11, //!< GPU driver error: Inspect the hipError_t value for additional information
149 hipFileHipPointerInvalid = HIPFILE_BASE_ERR + 12, //!< Invalid GPU pointer
150 hipFileHipMemoryTypeInvalid = HIPFILE_BASE_ERR + 13, //!< Memory type backing pointer is incompatible with hipFile
151 hipFileHipPointerRangeError = HIPFILE_BASE_ERR + 14, //!< Pointer range exceeds allocated memory region
152 hipFileHipContextMismatch = HIPFILE_BASE_ERR + 15, //!< GPU driver context mismatch
153 hipFileInvalidMappingSize = HIPFILE_BASE_ERR + 16, //!< Accessing memory beyond pinned memory buffer
154 hipFileInvalidMappingRange = HIPFILE_BASE_ERR + 17, //!< Accessing memory beyond mapped memory region
155 hipFileInvalidFileType = HIPFILE_BASE_ERR + 18, //!< Unsupported file type
156 hipFileInvalidFileOpenFlag = HIPFILE_BASE_ERR + 19, //!< Unsupported file open flags
157 hipFileDIONotSet = HIPFILE_BASE_ERR + 20, //!< O_DIRECT flag not set
158 /* Value 5021 intentionally unused */
159 hipFileInvalidValue = HIPFILE_BASE_ERR + 22, //!< One or more arguments have an invalid value
160 hipFileMemoryAlreadyRegistered = HIPFILE_BASE_ERR + 23, //!< Device pointer is already registered
161 hipFileMemoryNotRegistered = HIPFILE_BASE_ERR + 24, //!< Device pointer is not registered
162 hipFilePermissionDenied = HIPFILE_BASE_ERR + 25, //!< Permission error on device or file access
163 hipFileDriverAlreadyOpen = HIPFILE_BASE_ERR + 26, //!< GPU IO driver is already open
164 hipFileHandleNotRegistered = HIPFILE_BASE_ERR + 27, //!< File handle for GPU IO is not registered
165 hipFileHandleAlreadyRegistered = HIPFILE_BASE_ERR + 28, //!< File handle for GPU IO is already registered
166 hipFileDeviceNotFound = HIPFILE_BASE_ERR + 29, //!< Selected device not found
167 hipFileInternalError = HIPFILE_BASE_ERR + 30, //!< Internal GPU IO library error
168 hipFileGetNewFDFailed = HIPFILE_BASE_ERR + 31, //!< Unable to obtain a new file descriptor
169 /* Value 5032 intentionally unused */
170 hipFileDriverSetupError = HIPFILE_BASE_ERR + 33, //!< GPU IO Driver initialization error
171 hipFileIODisabled = HIPFILE_BASE_ERR + 34, //!< GPU IO config file prohibits GPU IO on specified file
172 hipFileBatchSubmitFailed = HIPFILE_BASE_ERR + 35, //!< Failed to submit request for batch operation
173 hipFileGPUMemoryPinningFailed = HIPFILE_BASE_ERR + 36, //!< Failed to allocated pinned device memory
174 hipFileBatchFull = HIPFILE_BASE_ERR + 37, //!< Batch operation queue is full
175 hipFileAsyncNotSupported = HIPFILE_BASE_ERR + 38, //!< hipFile async IO is not supported
176 hipFileIOMaxError = HIPFILE_BASE_ERR + 39, //!< Internal flag to mark largest hipFile error code
#define HIPFILE_BASE_ERR
The base value for hipFile error codes.
Definition hipfile.h:124
hipFileOpError_t
hipFile function return codes
Definition hipfile.h:136
@ hipFileMemoryAlreadyRegistered
Device pointer is already registered.
Definition hipfile.h:160
@ hipFileDriverInvalidProps
Invalid GPU IO driver property provided.
Definition hipfile.h:139
@ hipFileMemoryNotRegistered
Device pointer is not registered.
Definition hipfile.h:161
@ hipFileIOMaxError
Internal flag to mark largest hipFile error code.
Definition hipfile.h:176
@ hipFilePlatformNotSupported
hipFile is not supported on the current platform
Definition hipfile.h:144
@ hipFileInternalError
Internal GPU IO library error.
Definition hipfile.h:167
@ hipFileInvalidMappingSize
Accessing memory beyond pinned memory buffer.
Definition hipfile.h:153
@ hipFileDriverAlreadyOpen
GPU IO driver is already open.
Definition hipfile.h:163
@ hipFileHandleAlreadyRegistered
File handle for GPU IO is already registered.
Definition hipfile.h:165
@ hipFileDriverVersionMismatch
hipFile version does not match GPU IO driver version
Definition hipfile.h:141
@ hipFileGPUMemoryPinningFailed
Failed to allocated pinned device memory.
Definition hipfile.h:173
@ hipFileInvalidValue
One or more arguments have an invalid value.
Definition hipfile.h:159
@ hipFileDriverSetupError
GPU IO Driver initialization error.
Definition hipfile.h:170
@ hipFileHandleNotRegistered
File handle for GPU IO is not registered.
Definition hipfile.h:164
@ hipFileInvalidFileType
Unsupported file type.
Definition hipfile.h:155
@ hipFileIONotSupported
hipFile is not supported on the selected file
Definition hipfile.h:145
@ hipFileHipPointerRangeError
Pointer range exceeds allocated memory region.
Definition hipfile.h:151
@ hipFileHipDriverError
GPU driver error: Inspect the hipError_t value for additional information.
Definition hipfile.h:148
@ hipFileInvalidFileOpenFlag
Unsupported file open flags.
Definition hipfile.h:156
@ hipFileDriverUnsupportedLimit
GPU IO Driver property value is unsupported.
Definition hipfile.h:140
@ hipFilePermissionDenied
Permission error on device or file access.
Definition hipfile.h:162
@ hipFileDriverClosing
GPU IO driver is closing and not accepting new requests.
Definition hipfile.h:143
@ hipFileDeviceNotSupported
The selected GPU does not support hipFile.
Definition hipfile.h:146
@ hipFileHipPointerInvalid
Invalid GPU pointer.
Definition hipfile.h:149
@ hipFileDIONotSet
O_DIRECT flag not set.
Definition hipfile.h:157
@ hipFileGetNewFDFailed
Unable to obtain a new file descriptor.
Definition hipfile.h:168
@ hipFileInvalidMappingRange
Accessing memory beyond mapped memory region.
Definition hipfile.h:154
@ hipFileDriverNotInitialized
GPU IO driver is not loaded.
Definition hipfile.h:138
@ hipFileDeviceNotFound
Selected device not found.
Definition hipfile.h:166
@ hipFileHipContextMismatch
GPU driver context mismatch.
Definition hipfile.h:152
@ hipFileDriverError
GPU IO driver error.
Definition hipfile.h:147
@ hipFileSuccess
hipFile operation completed successfully
Definition hipfile.h:137
@ hipFileAsyncNotSupported
hipFile async IO is not supported
Definition hipfile.h:175
@ hipFileBatchSubmitFailed
Failed to submit request for batch operation.
Definition hipfile.h:172
@ hipFileHipMemoryTypeInvalid
Memory type backing pointer is incompatible with hipFile.
Definition hipfile.h:150
@ hipFileBatchFull
Batch operation queue is full.
Definition hipfile.h:174
@ hipFileIODisabled
GPU IO config file prohibits GPU IO on specified file.
Definition hipfile.h:171
@ hipFileDriverVersionReadError
Unable to read the GPU IO driver version.
Definition hipfile.h:142

Function Documentation

◆ hipFileGetOpErrorString()

const char * hipFileGetOpErrorString ( hipFileOpError_t  status)

#include <rocprofiler-sdk/hipfile/details/hipfile.h>

Return a descriptive string for a hipFile error.

Parameters
[in]statusReturn code provided by hipFile
Returns
Description of the error encountered