Skip to content

Commit 451a19e

Browse files
committed
Patch 11.8.1
- Resolve issue 27 - Update install instructions to use latest CTK
1 parent d375d22 commit 451a19e

37 files changed

+659
-187
lines changed

README.md

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,63 +11,15 @@ work are as follows:
1111
* CUDA Toolkit 11.0 to 11.8
1212
* Cython - e.g. 0.29.21
1313

14-
### Compilation
14+
### Installing
1515

16-
To compile the extension in-place, run:
17-
18-
```
19-
python setup.py build_ext --inplace
20-
```
21-
22-
To compile for debugging the extension modules with gdb, pass the `--debug`
23-
argument to setup.py.
24-
25-
26-
### Develop installation
27-
28-
You can use
29-
30-
```
31-
pip install -e .
32-
```
33-
34-
to install the module as editible in your current Python environment (e.g. for
35-
testing of porting other libraries to use the binding).
36-
37-
38-
### Build the Docs
39-
40-
```
41-
conda env create -f docs_src/environment-docs.yml
42-
conda activate cuda-python-docs
43-
```
44-
Then compile and install `cuda-python` following the steps above.
45-
46-
```
47-
cd docs_src
48-
make html
49-
open build/html/index.html
50-
```
51-
52-
### Publish the Docs
53-
54-
```
55-
git checkout gh-pages
56-
cd docs_src
57-
make html
58-
cp -a build/html/. ../docs/
59-
```
16+
Refer to documentation for installation options and requirements: [nvidia.github.io/cuda-python/](https://nvidia.github.io/cuda-python/install.html)
6017

6118
## Testing
6219

6320
### Requirements
6421

65-
Dependencies of the test execution and some versions that are known to
66-
work are as follows:
67-
68-
* numpy-1.19.5
69-
* scipy-1.6.3
70-
* pytest-benchmark-3.4.1
22+
Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt).
7123

7224
### Unit-tests
7325

@@ -76,6 +28,7 @@ You can run the included tests with:
7628
```
7729
python -m pytest
7830
```
31+
7932
### Benchmark
8033

8134
You can run benchmark only tests with:

cuda/_lib/utils.pxd.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ cdef class HelperCUjit_option:
8888
cdef vector[char*] _charstarstar # list of names
8989
cdef InputVoidPtrPtrHelper _voidstarstar # list of addresses
9090
{{endif}}
91+
{{if 'CUmemAllocationHandleType_enum' in found_types}}
92+
93+
cdef class HelperCUmemAllocationHandleType:
94+
cdef void* _cptr
95+
cdef ccuda.CUmemAllocationHandleType_enum _type
96+
97+
# Return values
98+
cdef int _int
99+
cdef void* _handle
100+
cdef unsigned int _d3dkmt_handle
101+
{{endif}}
91102

92103
cdef class InputVoidPtrPtrHelper:
93104
cdef void** _cptr

cuda/_lib/utils.pyx.in

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,61 @@ cdef class HelperCUjit_option:
426426
def cptr(self):
427427
return <void_ptr>self._cptr
428428
{{endif}}
429+
{{if 'CUmemAllocationHandleType_enum' in found_types}}
430+
431+
cdef class HelperCUmemAllocationHandleType:
432+
def __cinit__(self, attr):
433+
self._type = attr.value
434+
if False:
435+
pass
436+
{{if 'CU_MEM_HANDLE_TYPE_NONE' in found_values}}
437+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,):
438+
self._cptr = <void*>&self._int
439+
{{endif}}
440+
{{if 'CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR' in found_values}}
441+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,):
442+
self._cptr = <void*>&self._int
443+
{{endif}}
444+
{{if 'CU_MEM_HANDLE_TYPE_WIN32' in found_values}}
445+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,):
446+
self._cptr = <void*>&self._handle
447+
{{endif}}
448+
{{if 'CU_MEM_HANDLE_TYPE_WIN32_KMT' in found_values}}
449+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,):
450+
self._cptr = <void*>&self._d3dkmt_handle
451+
{{endif}}
452+
else:
453+
raise TypeError('Unsupported attribute: {}'.format(attr.name))
454+
455+
def __dealloc__(self):
456+
pass
457+
458+
@property
459+
def cptr(self):
460+
return <void_ptr>self._cptr
461+
462+
def pyObj(self):
463+
if False:
464+
pass
465+
{{if 'CU_MEM_HANDLE_TYPE_NONE' in found_values}}
466+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,):
467+
return self._int
468+
{{endif}}
469+
{{if 'CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR' in found_values}}
470+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,):
471+
return self._int
472+
{{endif}}
473+
{{if 'CU_MEM_HANDLE_TYPE_WIN32' in found_values}}
474+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,):
475+
return <void_ptr>self._handle
476+
{{endif}}
477+
{{if 'CU_MEM_HANDLE_TYPE_WIN32_KMT' in found_values}}
478+
elif self._type in (ccuda.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,):
479+
return self._d3dkmt_handle
480+
{{endif}}
481+
else:
482+
raise TypeError('Unsupported attribute: {}'.format(self._type))
483+
{{endif}}
429484

430485
cdef class InputVoidPtrPtrHelper:
431486
def __cinit__(self, lst):

cuda/cuda.pyx.in

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13365,7 +13365,7 @@ def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev):
1336513365
{{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}
1336613366

1336713367
@cython.embedsignature(True)
13368-
def cuDeviceGetNvSciSyncAttributes(dev, int flags):
13368+
def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags):
1336913369
""" Return NvSciSync attributes that this device can support.
1337013370

1337113371
Returns in `nvSciSyncAttrList`, the properties of NvSciSync that this
@@ -13405,6 +13405,8 @@ def cuDeviceGetNvSciSyncAttributes(dev, int flags):
1340513405

1340613406
Parameters
1340713407
----------
13408+
nvSciSyncAttrList : Any
13409+
Return NvSciSync attributes supported.
1340813410
dev : :py:obj:`~.CUdevice`
1340913411
Valid Cuda Device to get NvSciSync attributes for.
1341013412
flags : int
@@ -13414,8 +13416,6 @@ def cuDeviceGetNvSciSyncAttributes(dev, int flags):
1341413416
-------
1341513417
CUresult
1341613418

13417-
nvSciSyncAttrList : Any
13418-
Return NvSciSync attributes supported.
1341913419

1342013420
See Also
1342113421
--------
@@ -13431,10 +13431,10 @@ def cuDeviceGetNvSciSyncAttributes(dev, int flags):
1343113431
pdev = int(CUdevice(dev))
1343213432
cdev = <ccuda.CUdevice>pdev
1343313433

13434-
cdef void_ptr nvSciSyncAttrList = 0
13435-
cdef void* cnvSciSyncAttrList_ptr = <void*>nvSciSyncAttrList
13434+
cnvSciSyncAttrList = utils.HelperInputVoidPtr(nvSciSyncAttrList)
13435+
cdef void* cnvSciSyncAttrList_ptr = <void*><void_ptr>cnvSciSyncAttrList.cptr
1343613436
err = ccuda.cuDeviceGetNvSciSyncAttributes(cnvSciSyncAttrList_ptr, cdev, flags)
13437-
return (CUresult(err), nvSciSyncAttrList)
13437+
return (CUresult(err),)
1343813438
{{endif}}
1343913439

1344013440
{{if 'cuDeviceSetMemPool' in found_functions}}
@@ -20150,8 +20150,8 @@ def cuMemGetHandleForAddressRange(dptr, size_t size, handleType not None : CUmem
2015020150
pdptr = int(CUdeviceptr(dptr))
2015120151
cdptr = <ccuda.CUdeviceptr><void_ptr>pdptr
2015220152

20153-
cdef void_ptr handle = 0
20154-
cdef void* chandle_ptr = <void*>handle
20153+
cdef int handle = 0
20154+
cdef void* chandle_ptr = <void*>&handle
2015520155
cdef ccuda.CUmemRangeHandleType chandleType = handleType.value
2015620156
err = ccuda.cuMemGetHandleForAddressRange(chandle_ptr, cdptr, size, chandleType, flags)
2015720157
return (CUresult(err), handle)
@@ -20794,11 +20794,11 @@ def cuMemExportToShareableHandle(handle, handleType not None : CUmemAllocationHa
2079420794
phandle = int(CUmemGenericAllocationHandle(handle))
2079520795
chandle = <ccuda.CUmemGenericAllocationHandle><void_ptr>phandle
2079620796

20797-
cdef void_ptr shareableHandle = 0
20798-
cdef void* cshareableHandle_ptr = <void*>shareableHandle
20797+
cdef utils.HelperCUmemAllocationHandleType cshareableHandle = utils.HelperCUmemAllocationHandleType(handleType)
20798+
cdef void* cshareableHandle_ptr = <void*><void_ptr>cshareableHandle.cptr
2079920799
cdef ccuda.CUmemAllocationHandleType chandleType = handleType.value
2080020800
err = ccuda.cuMemExportToShareableHandle(cshareableHandle_ptr, chandle, chandleType, flags)
20801-
return (CUresult(err), shareableHandle)
20801+
return (CUresult(err), cshareableHandle.pyObj())
2080220802
{{endif}}
2080320803

2080420804
{{if 'cuMemImportFromShareableHandle' in found_functions}}
@@ -21560,11 +21560,11 @@ def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocation
2156021560
ppool = int(CUmemoryPool(pool))
2156121561
cpool = <ccuda.CUmemoryPool><void_ptr>ppool
2156221562

21563-
cdef void_ptr handle_out = 0
21564-
cdef void* chandle_out_ptr = <void*>handle_out
21563+
cdef utils.HelperCUmemAllocationHandleType chandle_out = utils.HelperCUmemAllocationHandleType(handleType)
21564+
cdef void* chandle_out_ptr = <void*><void_ptr>chandle_out.cptr
2156521565
cdef ccuda.CUmemAllocationHandleType chandleType = handleType.value
2156621566
err = ccuda.cuMemPoolExportToShareableHandle(chandle_out_ptr, cpool, chandleType, flags)
21567-
return (CUresult(err), handle_out)
21567+
return (CUresult(err), chandle_out.pyObj())
2156821568
{{endif}}
2156921569

2157021570
{{if 'cuMemPoolImportFromShareableHandle' in found_functions}}

cuda/cudart.pyx.in

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12312,7 +12312,7 @@ def cudaDeviceGetMemPool(int device):
1231212312
{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}}
1231312313

1231412314
@cython.embedsignature(True)
12315-
def cudaDeviceGetNvSciSyncAttributes(int device, int flags):
12315+
def cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, int device, int flags):
1231612316
""" Return NvSciSync attributes that this device can support.
1231712317

1231812318
Returns in `nvSciSyncAttrList`, the properties of NvSciSync that this
@@ -12347,6 +12347,8 @@ def cudaDeviceGetNvSciSyncAttributes(int device, int flags):
1234712347

1234812348
Parameters
1234912349
----------
12350+
nvSciSyncAttrList : Any
12351+
Return NvSciSync attributes supported.
1235012352
device : int
1235112353
Valid Cuda Device to get NvSciSync attributes for.
1235212354
flags : int
@@ -12356,17 +12358,15 @@ def cudaDeviceGetNvSciSyncAttributes(int device, int flags):
1235612358
-------
1235712359
cudaError_t
1235812360

12359-
nvSciSyncAttrList : Any
12360-
Return NvSciSync attributes supported.
1236112361

1236212362
See Also
1236312363
--------
1236412364
:py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`
1236512365
"""
12366-
cdef void_ptr nvSciSyncAttrList = 0
12367-
cdef void* cnvSciSyncAttrList_ptr = <void*>nvSciSyncAttrList
12366+
cnvSciSyncAttrList = utils.HelperInputVoidPtr(nvSciSyncAttrList)
12367+
cdef void* cnvSciSyncAttrList_ptr = <void*><void_ptr>cnvSciSyncAttrList.cptr
1236812368
err = ccudart.cudaDeviceGetNvSciSyncAttributes(cnvSciSyncAttrList_ptr, device, flags)
12369-
return (cudaError_t(err), nvSciSyncAttrList)
12369+
return (cudaError_t(err),)
1237012370
{{endif}}
1237112371

1237212372
{{if 'cudaDeviceGetP2PAttribute' in found_functions}}
@@ -19805,11 +19805,11 @@ def cudaMemPoolExportToShareableHandle(memPool, handleType not None : cudaMemAll
1980519805
pmemPool = int(cudaMemPool_t(memPool))
1980619806
cmemPool = <ccudart.cudaMemPool_t><void_ptr>pmemPool
1980719807

19808-
cdef void_ptr shareableHandle = 0
19809-
cdef void* cshareableHandle_ptr = <void*>shareableHandle
19808+
cdef utils.HelperCUmemAllocationHandleType cshareableHandle = utils.HelperCUmemAllocationHandleType(handleType)
19809+
cdef void* cshareableHandle_ptr = <void*><void_ptr>cshareableHandle.cptr
1981019810
cdef ccudart.cudaMemAllocationHandleType chandleType = handleType.value
1981119811
err = ccudart.cudaMemPoolExportToShareableHandle(cshareableHandle_ptr, cmemPool, chandleType, flags)
19812-
return (cudaError_t(err), shareableHandle)
19812+
return (cudaError_t(err), cshareableHandle.pyObj())
1981319813
{{endif}}
1981419814

1981519815
{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}}
@@ -23522,7 +23522,7 @@ def cudaGraphMemFreeNodeGetParams(node):
2352223522
cnode = <ccudart.cudaGraphNode_t><void_ptr>pnode
2352323523

2352423524
cdef void_ptr dptr_out = 0
23525-
cdef void* cdptr_out_ptr = <void*>dptr_out
23525+
cdef void* cdptr_out_ptr = <void*>&dptr_out
2352623526
err = ccudart.cudaGraphMemFreeNodeGetParams(cnode, cdptr_out_ptr)
2352723527
return (cudaError_t(err), dptr_out)
2352823528
{{endif}}

docs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 2173daa5e1d85d4fd21eb27f7801cf13
3+
config: ad24118d52f507b84ce833bbfdacae42
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/_sources/install.md.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ conda install -c nvidia cuda-python
2727

2828
### Requirements
2929

30-
Building dependencies:
31-
* cython>=0.29.24
30+
Installing from source requires the latest CUDA Toolkit (CTK), matching the major.minor of CUDA Python. The installed package will still be compatible with all minor CTK versions.
3231

33-
Unit-test dependencies:
34-
* pytest>=6.2.4
35-
* pytest-benchmark>=3.4.1
36-
* numpy>=1.21.1
32+
Environment variable CUDA_HOME must be set to CTK root directory:
33+
```
34+
export CUDA_HOME=/usr/local/cuda
35+
```
3736

38-
Latest list of dependencies can be found at [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt)
37+
Remaining build and test dependencies are outlined in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt)
3938

4039
### In-place
4140

@@ -56,7 +55,7 @@ You can use
5655
pip install -e .
5756
```
5857

59-
to install the module as editible in your current Python environment (e.g. for
58+
to install the module as editible in your current Python environment (e.g. for
6059
testing of porting other libraries to use the binding).
6160

6261
## Build the Docs

docs/_sources/release.md.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
maxdepth: 3
66
---
77

8+
11.8.1 <release/11.8.1-notes>
89
11.8.0 <release/11.8.0-notes>
910
11.7.1 <release/11.7.1-notes>
1011
11.7.0 <release/11.7.0-notes>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# CUDA Python 11.8.1 Release notes
2+
3+
Released on November 4, 2022
4+
5+
## Hightlights
6+
- Resolves [issue #27](https://github.com/NVIDIA/cuda-python/issues/24)
7+
- Update install instructions to use latest CTK
8+
9+
## Limitations
10+
11+
### CUDA Functions Not Supported in this Release
12+
13+
- Symbol APIs
14+
- cudaGraphExecMemcpyNodeSetParamsFromSymbol
15+
- cudaGraphExecMemcpyNodeSetParamsToSymbol
16+
- cudaGraphAddMemcpyNodeToSymbol
17+
- cudaGraphAddMemcpyNodeFromSymbol
18+
- cudaGraphMemcpyNodeSetParamsToSymbol
19+
- cudaGraphMemcpyNodeSetParamsFromSymbol
20+
- cudaMemcpyToSymbol
21+
- cudaMemcpyFromSymbol
22+
- cudaMemcpyToSymbolAsync
23+
- cudaMemcpyFromSymbolAsync
24+
- cudaGetSymbolAddress
25+
- cudaGetSymbolSize
26+
- cudaGetFuncBySymbol
27+
- Launch Options
28+
- cudaLaunchKernel
29+
- cudaLaunchCooperativeKernel
30+
- cudaLaunchCooperativeKernelMultiDevice
31+
- cudaSetValidDevices
32+
- cudaVDPAUSetVDPAUDevice

docs/_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var DOCUMENTATION_OPTIONS = {
22
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
3-
VERSION: '11.8.0',
3+
VERSION: '11.8.1',
44
LANGUAGE: 'None',
55
COLLAPSE_INDEX: false,
66
BUILDER: 'html',

0 commit comments

Comments
 (0)