The CUDA library provides a direct, general purpose C-like SPMD programming model for NVIDIA graphics cards (G8x series onwards). This is a collection of bindings to allow you to call and control, although not write, such functions from Haskell-land. You will need to install the CUDA driver and developer toolkit.
http://developer.nvidia.com/object/cuda.html
The configure step will look for your CUDA installation in the standard places,
and if the nvcc
compiler is found in your PATH
, relative to that.
For important information on installing on Windows, see:
https://github.com/tmcdonell/cuda/blob/master/WINDOWS.md
This library is currently in maintenance mode. While we plan to release updates to keep the existing interface working with newer CUDA versions (as long as the underlying APIs remain available), no binding of new features is planned at the moment. Get in touch if you want to contribute.
Here is an incomplete historical list of missing bindings. Pull requests welcome!
- cuLaunchCooperativeKernelMultiDevice
- cuDeviceGetLuid (windows only?)
- cuLaunchHostFunc
- cuGraphHostNode[Get/Set]Params
- cuGraphKernelNode[Get/Set]Params
- cuGraphMemcpyNode[Get/Set]Params
- cuGraphMemsetNode[Get/Set]Params
- cuDeviceGetNvSciSyncAttributes
- cuMemAddressFree
- cuMemAddressReserve
- cuMemCreate
- cuMemExportToShareableHandle
- cuMemGetAccess
- cuMemGetAllocationGranularity
- cuMemGetAllocationPrepertiesFromHandle
- cuMemImportFromShareableHandle
- cuMemMap
- cuMemRelease
- cuMemSetAccess
- cuMemUnmap
- cuGraphExecHostNodeSetParams
- cuGraphExecMemcpyNodeSetParams
- cuGraphExecMemsetNodeSetParams
- cuGraphExecUpdate
- cuCtxResetPersistentingL2Cache
- cuMemRetainAllocationHandle
- cuStreamCopyAttributes
- cuStreamGetAttribute
- cuStreamSetAttribute
- cuGraphKernelNodeCopyAttributes
- cuGraphKernelNodeGetAttribute
- cuGraphKernelNodeSetAttribute
- cuOccupancyAvailableDynamicSMemPerBlock
- cuDeviceGetTexture1DLinearMaxWidth
- cuArrayGetSparseProperties
- cuMipmappedArrayGetSparseProperties
- cuMemMapArrayAsync
- cuEventRecordWithFlags
- cuGraphAddEventRecordNode
- cuGraphAddEventWaitNode
- cuGraphEventRecordNodeGetEvent
- cuGraphEventRecordNodeSetEvent
- cuGraphEventWaitNodeGetEvent
- cuGraphEventWaitNodeSetEvent
- cuGraphExecChildGraphNodeSetParams
- cuGraphExecEventRecordNodeSetEvent
- cuGraphExecEventWaitNodeSetEvent
- cuGraphUpload
- cuDeviceGetDefaultMemPool
- cuDeviceGetMemPool
- cuDeviceSetMemPool
- cuArrayGetPlane
- cuMemAllocAsync
- cuMemAllocFromPoolAsync
- cuMemFreeAsync
- cuMemPoolCreate
- cuMemPoolDestroy
- cuMemPoolExportPointer
- cuMemPoolExportToShareableHandle
- cuMemPoolGetAccess
- cuMemPoolGetAttribute
- cuMemPoolImportFromShareableHandle
- cuMemPoolImportPointer
- cuMemPoolSetAccess
- cuMemPoolSetAttribute
- cuMemPoolTrimTo
- cuGraphAddExternalSemaphoresSignalNode
- cuGraphAddExternalSemaphoresWaitNode
- cuGraphExecExternalSemaphoresSignalNodeSetParams
- cuGraphExecExternalSemaphoresWaitNodeSetParams
- cuGraphExternalSemaphoresSignalNodeGetParams
- cuGraphExternalSemaphoresSignalNodeSetParams
- cuGraphExternalSemaphoresWaitNodeGetParams
- cuGraphExternalSemaphoresWaitNodeSetParams
- cuStreamGetCaptureInfo_v2
- cuFuncGetModule
- cuGraphDebugDotPrint
- cuGraphReleaseUserObject
- cuGraphRetainUserObject
- cuUserObjectCreate
- cuUserObjectRelease
- cuUserObjectRetain
- cuGetProcAddress
- cuDeviceGetUuid_v2
- cuCtxCreate_v3
- cuCtxGetExecAffinity
- cuDeviceGetGraphMemAttribute
- cuDeviceGraphMemTrim
- cuDeviceSetGraphMemAttribute
- cuGraphAddMemAllocNode
- cuGraphAddMemFreeNode
- cuGraphInstantiateWithFlags
- cuGraphMemAllocNodeGetParams
- cuGraphMemFreeNodeGetParams
A lot. PRs welcome.
The setup script for this package requires at least Cabal-1.24. If you run into trouble with this:
- Cabal users: ensure you are using a new
cabal
executable and have runcabal update
anywhere in the last few years. If you have previously runcabal install
on libraries and have a broken environment as a result, remove~/.ghc/<platfom>/environments/default
. - Stack users: one may attempt @stack setup --upgrade-cabal@.
Due to an interaction between GHC-8 and unified virtual address spaces in CUDA, this package does not currently work with GHCi on ghc-8.0.1 (compiled programs should work). See the following for more details:
The bug should be fixed in ghc-8.0.2 and beyond.