-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REVIEW] Add GPU and CUDA validations #4692
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5961872
add GPU support, runtime & driver checks
galipremsagar e92c6b5
Update python/cudf/cudf/__init__.py
galipremsagar 91baa1c
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar 9617fb9
change error message to provide driver versions and url to compatibil…
galipremsagar 0709532
modify error text
galipremsagar a61ab8e
Update python/cudf/cudf/__init__.py
galipremsagar d1f1717
add cpp apis and cython/python bridge
galipremsagar 44de100
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar bc55a75
Update CHANGELOG.md
galipremsagar 2be6ea3
Merge branch 'branch-0.14' into init_check
galipremsagar 8d1482b
Update python/cudf/cudf/utils/gpu_utils.py
galipremsagar 2e05d96
create a new module _cuda to keep all cuda related apis
galipremsagar e4c3288
remove cpp file
galipremsagar fe75c23
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar 7272afc
Apply suggestions from code review
galipremsagar 04826a1
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar 0d9c6bb
Merge branch 'branch-0.14' into init_check
galipremsagar e6add1e
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar 7c8cb5b
remove except + for c apis
galipremsagar 6818152
add param types in docs
galipremsagar 6ac3a93
add getDeviceProperties api
galipremsagar 5171b0e
do inline skip of isort
galipremsagar 7d6dcc8
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar 79854f4
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar 0643e71
add error handling
galipremsagar 3a7ab8c
add docs
galipremsagar 012a6de
print the detected cuda runtime version
galipremsagar 6032e64
Apply suggestions from code review
galipremsagar b0bb113
fetching only the properties required instead of queries all props of…
galipremsagar 8f8fd5c
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar 2e23210
Update python/cudf/cudf/_cuda/gpu.pxd
galipremsagar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,315 @@ | ||
# Copyright (c) 2020, NVIDIA CORPORATION. | ||
|
||
cdef extern from "cuda.h" nogil: | ||
cdef enum cudaDeviceAttr: | ||
cudaDevAttrMaxThreadsPerBlock = 1 | ||
cudaDevAttrMaxBlockDimX = 2 | ||
cudaDevAttrMaxBlockDimY = 3 | ||
cudaDevAttrMaxBlockDimZ = 4 | ||
cudaDevAttrMaxGridDimX = 5 | ||
cudaDevAttrMaxGridDimY = 6 | ||
cudaDevAttrMaxGridDimZ = 7 | ||
cudaDevAttrMaxSharedMemoryPerBlock = 8 | ||
cudaDevAttrTotalConstantMemory = 9 | ||
cudaDevAttrWarpSize = 10 | ||
cudaDevAttrMaxPitch = 11 | ||
cudaDevAttrMaxRegistersPerBlock = 12 | ||
cudaDevAttrClockRate = 13 | ||
cudaDevAttrTextureAlignment = 14 | ||
cudaDevAttrGpuOverlap = 15 | ||
cudaDevAttrMultiProcessorCount = 16 | ||
cudaDevAttrKernelExecTimeout = 17 | ||
cudaDevAttrIntegrated = 18 | ||
cudaDevAttrCanMapHostMemory = 19 | ||
cudaDevAttrComputeMode = 20 | ||
cudaDevAttrMaxTexture1DWidth = 21 | ||
cudaDevAttrMaxTexture2DWidth = 22 | ||
cudaDevAttrMaxTexture2DHeight = 23 | ||
cudaDevAttrMaxTexture3DWidth = 24 | ||
cudaDevAttrMaxTexture3DHeight = 25 | ||
cudaDevAttrMaxTexture3DDepth = 26 | ||
cudaDevAttrMaxTexture2DLayeredWidth = 27 | ||
cudaDevAttrMaxTexture2DLayeredHeight = 28 | ||
cudaDevAttrMaxTexture2DLayeredLayers = 29 | ||
cudaDevAttrSurfaceAlignment = 30 | ||
cudaDevAttrConcurrentKernels = 31 | ||
cudaDevAttrEccEnabled = 32 | ||
cudaDevAttrPciBusId = 33 | ||
cudaDevAttrPciDeviceId = 34 | ||
cudaDevAttrTccDriver = 35 | ||
cudaDevAttrMemoryClockRate = 36 | ||
cudaDevAttrGlobalMemoryBusWidth = 37 | ||
cudaDevAttrL2CacheSize = 38 | ||
cudaDevAttrMaxThreadsPerMultiProcessor = 39 | ||
cudaDevAttrAsyncEngineCount = 40 | ||
cudaDevAttrUnifiedAddressing = 41 | ||
cudaDevAttrMaxTexture1DLayeredWidth = 42 | ||
cudaDevAttrMaxTexture1DLayeredLayers = 43 | ||
cudaDevAttrMaxTexture2DGatherWidth = 45 | ||
cudaDevAttrMaxTexture2DGatherHeight = 46 | ||
cudaDevAttrMaxTexture3DWidthAlt = 47 | ||
cudaDevAttrMaxTexture3DHeightAlt = 48 | ||
cudaDevAttrMaxTexture3DDepthAlt = 49 | ||
cudaDevAttrPciDomainId = 50 | ||
cudaDevAttrTexturePitchAlignment = 51 | ||
cudaDevAttrMaxTextureCubemapWidth = 52 | ||
cudaDevAttrMaxTextureCubemapLayeredWidth = 53 | ||
cudaDevAttrMaxTextureCubemapLayeredLayers = 54 | ||
cudaDevAttrMaxSurface1DWidth = 55 | ||
cudaDevAttrMaxSurface2DWidth = 56 | ||
cudaDevAttrMaxSurface2DHeight = 57 | ||
cudaDevAttrMaxSurface3DWidth = 58 | ||
cudaDevAttrMaxSurface3DHeight = 59 | ||
cudaDevAttrMaxSurface3DDepth = 60 | ||
cudaDevAttrMaxSurface1DLayeredWidth = 61 | ||
cudaDevAttrMaxSurface1DLayeredLayers = 62 | ||
cudaDevAttrMaxSurface2DLayeredWidth = 63 | ||
cudaDevAttrMaxSurface2DLayeredHeight = 64 | ||
cudaDevAttrMaxSurface2DLayeredLayers = 65 | ||
cudaDevAttrMaxSurfaceCubemapWidth = 66 | ||
cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67 | ||
cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68 | ||
cudaDevAttrMaxTexture1DLinearWidth = 69 | ||
cudaDevAttrMaxTexture2DLinearWidth = 70 | ||
cudaDevAttrMaxTexture2DLinearHeight = 71 | ||
cudaDevAttrMaxTexture2DLinearPitch = 72 | ||
cudaDevAttrMaxTexture2DMipmappedWidth = 73 | ||
cudaDevAttrMaxTexture2DMipmappedHeight = 74 | ||
cudaDevAttrComputeCapabilityMajor = 75 | ||
cudaDevAttrComputeCapabilityMinor = 76 | ||
cudaDevAttrMaxTexture1DMipmappedWidth = 77 | ||
cudaDevAttrStreamPrioritiesSupported = 78 | ||
cudaDevAttrGlobalL1CacheSupported = 79 | ||
cudaDevAttrLocalL1CacheSupported = 80 | ||
cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81 | ||
cudaDevAttrMaxRegistersPerMultiprocessor = 82 | ||
cudaDevAttrManagedMemory = 83 | ||
cudaDevAttrIsMultiGpuBoard = 84 | ||
cudaDevAttrMultiGpuBoardGroupID = 85 | ||
cudaDevAttrHostNativeAtomicSupported = 86 | ||
cudaDevAttrSingleToDoublePrecisionPerfRatio = 87 | ||
cudaDevAttrPageableMemoryAccess = 88 | ||
cudaDevAttrConcurrentManagedAccess = 89 | ||
cudaDevAttrComputePreemptionSupported = 90 | ||
cudaDevAttrCanUseHostPointerForRegisteredMem = 91 | ||
cudaDevAttrReserved92 = 92 | ||
cudaDevAttrReserved93 = 93 | ||
cudaDevAttrReserved94 = 94 | ||
cudaDevAttrCooperativeLaunch = 95 | ||
cudaDevAttrCooperativeMultiDeviceLaunch = 96 | ||
cudaDevAttrMaxSharedMemoryPerBlockOptin = 97 | ||
cudaDevAttrCanFlushRemoteWrites = 98 | ||
cudaDevAttrHostRegisterSupported = 99 | ||
cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100 | ||
cudaDevAttrDirectManagedMemAccessFromHost = 101 | ||
|
||
ctypedef enum cudaError: | ||
cudaSuccess = 0 | ||
cudaErrorInvalidValue = 1 | ||
cudaErrorMemoryAllocation = 2 | ||
cudaErrorInitializationError = 3 | ||
cudaErrorCudartUnloading = 4 | ||
cudaErrorProfilerDisabled = 5 | ||
cudaErrorProfilerNotInitialized = 6 | ||
cudaErrorProfilerAlreadyStarted = 7 | ||
cudaErrorProfilerAlreadyStopped = 8 | ||
cudaErrorInvalidConfiguration = 9 | ||
cudaErrorInvalidPitchValue = 12 | ||
cudaErrorInvalidSymbol = 13 | ||
cudaErrorInvalidHostPointer = 16 | ||
cudaErrorInvalidDevicePointer = 17 | ||
cudaErrorInvalidTexture = 18 | ||
cudaErrorInvalidTextureBinding = 19 | ||
cudaErrorInvalidChannelDescriptor = 20 | ||
cudaErrorInvalidMemcpyDirection = 21 | ||
cudaErrorAddressOfConstant = 22 | ||
cudaErrorTextureFetchFailed = 23 | ||
cudaErrorTextureNotBound = 24 | ||
cudaErrorSynchronizationError = 25 | ||
cudaErrorInvalidFilterSetting = 26 | ||
cudaErrorInvalidNormSetting = 27 | ||
cudaErrorMixedDeviceExecution = 28 | ||
cudaErrorNotYetImplemented = 31 | ||
cudaErrorMemoryValueTooLarge = 32 | ||
cudaErrorInsufficientDriver = 35 | ||
cudaErrorInvalidSurface = 37 | ||
cudaErrorDuplicateVariableName = 43 | ||
cudaErrorDuplicateTextureName = 44 | ||
cudaErrorDuplicateSurfaceName = 45 | ||
cudaErrorDevicesUnavailable = 46 | ||
cudaErrorIncompatibleDriverContext = 49 | ||
cudaErrorMissingConfiguration = 52 | ||
cudaErrorPriorLaunchFailure = 53 | ||
cudaErrorLaunchMaxDepthExceeded = 65 | ||
cudaErrorLaunchFileScopedTex = 66 | ||
cudaErrorLaunchFileScopedSurf = 67 | ||
cudaErrorSyncDepthExceeded = 68 | ||
cudaErrorLaunchPendingCountExceeded = 69 | ||
cudaErrorInvalidDeviceFunction = 98 | ||
cudaErrorNoDevice = 100 | ||
cudaErrorInvalidDevice = 101 | ||
cudaErrorStartupFailure = 127 | ||
cudaErrorInvalidKernelImage = 200 | ||
cudaErrorDeviceUninitialized = 201 | ||
cudaErrorMapBufferObjectFailed = 205 | ||
cudaErrorUnmapBufferObjectFailed = 206 | ||
cudaErrorArrayIsMapped = 207 | ||
cudaErrorAlreadyMapped = 208 | ||
cudaErrorNoKernelImageForDevice = 209 | ||
cudaErrorAlreadyAcquired = 210 | ||
cudaErrorNotMapped = 211 | ||
cudaErrorNotMappedAsArray = 212 | ||
cudaErrorNotMappedAsPointer = 213 | ||
cudaErrorECCUncorrectable = 214 | ||
cudaErrorUnsupportedLimit = 215 | ||
cudaErrorDeviceAlreadyInUse = 216 | ||
cudaErrorPeerAccessUnsupported = 217 | ||
cudaErrorInvalidPtx = 218 | ||
cudaErrorInvalidGraphicsContext = 219 | ||
cudaErrorNvlinkUncorrectable = 220 | ||
cudaErrorJitCompilerNotFound = 221 | ||
cudaErrorInvalidSource = 300 | ||
cudaErrorFileNotFound = 301 | ||
cudaErrorSharedObjectSymbolNotFound = 302 | ||
cudaErrorSharedObjectInitFailed = 303 | ||
cudaErrorOperatingSystem = 304 | ||
cudaErrorInvalidResourceHandle = 400 | ||
cudaErrorIllegalState = 401 | ||
cudaErrorSymbolNotFound = 500 | ||
cudaErrorNotReady = 600 | ||
cudaErrorIllegalAddress = 700 | ||
cudaErrorLaunchOutOfResources = 701 | ||
cudaErrorLaunchTimeout = 702 | ||
cudaErrorLaunchIncompatibleTexturing = 703 | ||
cudaErrorPeerAccessAlreadyEnabled = 704 | ||
cudaErrorPeerAccessNotEnabled = 705 | ||
cudaErrorSetOnActiveProcess = 708 | ||
cudaErrorContextIsDestroyed = 709 | ||
cudaErrorAssert = 710 | ||
cudaErrorTooManyPeers = 711 | ||
cudaErrorHostMemoryAlreadyRegistered = 712 | ||
cudaErrorHostMemoryNotRegistered = 713 | ||
cudaErrorHardwareStackError = 714 | ||
cudaErrorIllegalInstruction = 715 | ||
cudaErrorMisalignedAddress = 716 | ||
cudaErrorInvalidAddressSpace = 717 | ||
cudaErrorInvalidPc = 718 | ||
cudaErrorLaunchFailure = 719 | ||
cudaErrorCooperativeLaunchTooLarge = 720 | ||
cudaErrorNotPermitted = 800 | ||
cudaErrorNotSupported = 801 | ||
cudaErrorSystemNotReady = 802 | ||
cudaErrorSystemDriverMismatch = 803 | ||
cudaErrorCompatNotSupportedOnDevice = 804 | ||
cudaErrorStreamCaptureUnsupported = 900 | ||
cudaErrorStreamCaptureInvalidated = 901 | ||
cudaErrorStreamCaptureMerge = 902 | ||
cudaErrorStreamCaptureUnmatched = 903 | ||
cudaErrorStreamCaptureUnjoined = 904 | ||
cudaErrorStreamCaptureIsolation = 905 | ||
cudaErrorStreamCaptureImplicit = 906 | ||
cudaErrorCapturedEvent = 907 | ||
cudaErrorStreamCaptureWrongThread = 908 | ||
cudaErrorTimeout = 909 | ||
cudaErrorGraphExecUpdateFailure = 910 | ||
cudaErrorUnknown = 999 | ||
cudaErrorApiFailureBase = 10000 | ||
|
||
ctypedef cudaError cudaError_t | ||
|
||
ctypedef struct CUuuid_st: | ||
char bytes[16] | ||
|
||
ctypedef CUuuid_st cudaUUID_t | ||
|
||
ctypedef struct cudaDeviceProp: | ||
int ECCEnabled | ||
int asyncEngineCount | ||
int canMapHostMemory | ||
int canUseHostPointerForRegisteredMem | ||
int clockRate | ||
int computeMode | ||
int computePreemptionSupported | ||
int concurrentKernels | ||
int concurrentManagedAccess | ||
int cooperativeLaunch | ||
int cooperativeMultiDeviceLaunch | ||
int deviceOverlap | ||
int directManagedMemAccessFromHost | ||
int globalL1CacheSupported | ||
int hostNativeAtomicSupported | ||
int integrated | ||
int isMultiGpuBoard | ||
int kernelExecTimeoutEnabled | ||
int l2CacheSize | ||
int localL1CacheSupported | ||
char luid[8] | ||
unsigned int luidDeviceNodeMask | ||
int major | ||
int managedMemory | ||
int maxGridSize[3] | ||
int maxSurface1D | ||
int maxSurface1DLayered[2] | ||
int maxSurface2D[2] | ||
int maxSurface2DLayered[3] | ||
int maxSurface3D[3] | ||
int maxSurfaceCubemap | ||
int maxSurfaceCubemapLayered[2] | ||
int maxTexture1D | ||
int maxTexture1DLayered[2] | ||
int maxTexture1DLinear | ||
int maxTexture1DMipmap | ||
int maxTexture2D[2] | ||
int maxTexture2DGather[2] | ||
int maxTexture2DLayered[3] | ||
int maxTexture2DLinear[3] | ||
int maxTexture2DMipmap[2] | ||
int maxTexture3D[3] | ||
int maxTexture3DAlt[3] | ||
int maxTextureCubemap | ||
int maxTextureCubemapLayered[2] | ||
int maxThreadsDim[3] | ||
int maxThreadsPerBlock | ||
int maxThreadsPerMultiProcessor | ||
size_t memPitch | ||
int memoryBusWidth | ||
int memoryClockRate | ||
int minor | ||
int multiGpuBoardGroupID | ||
int multiProcessorCount | ||
char name[256] | ||
int pageableMemoryAccess | ||
int pageableMemoryAccessUsesHostPageTables | ||
int pciBusID | ||
int pciDeviceID | ||
int pciDomainID | ||
int regsPerBlock | ||
int regsPerMultiprocessor | ||
size_t sharedMemPerBlock | ||
size_t sharedMemPerBlockOptin | ||
size_t sharedMemPerMultiprocessor | ||
int singleToDoublePrecisionPerfRatio | ||
int streamPrioritiesSupported | ||
size_t surfaceAlignment | ||
int tccDriver | ||
size_t textureAlignment | ||
size_t texturePitchAlignment | ||
size_t totalConstMem | ||
size_t totalGlobalMem | ||
int unifiedAddressing | ||
cudaUUID_t uuid | ||
int warpSize | ||
|
||
cdef extern from "cuda_runtime_api.h" nogil: | ||
|
||
int cudaDriverGetVersion(int* driverVersion) | ||
int cudaRuntimeGetVersion(int* runtimeVersion) | ||
int cudaGetDeviceCount(int* count) | ||
int cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) | ||
int cudaGetDeviceProperties(cudaDeviceProp* prop, int device) | ||
|
||
const char* cudaGetErrorName(cudaError_t error) | ||
const char* cudaGetErrorString(cudaError_t error) | ||
int cuDeviceGetName(char* name, int length, int device) | ||
kkraus14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ctypedef int underlying_type_attribute |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure would be nice if someone were to make a standard set of Python wrappers for the CUDA runtime APIs!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a reason this is in
cudf/_cuda
as opposed tocudf/_libxx
;)