Registry / ai-ml / pycuda

pycuda

JSON →
library2026.1pypypiunverified

PyCUDA is a Python wrapper for Nvidia CUDA. It provides access to Nvidia's CUDA parallel computation API from Python. The latest version is 2026.1 (requires Python ~=3.8). Release cadence is roughly semi-annual.

pip install pycuda
INSTALL
IMPORT
SIG · PYCUDA
P
pycuda
ai-mlpythonv2026.1
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

autoinit
import pycuda.autoinit
import pycuda.autoinit

Kernel that adds 1 to each element of a float array.

import pycuda.autoinit import pycuda.driver as cuda import numpy as np from pycuda.compiler import SourceModule mod = SourceModule(""" __global__ void add_one(float *a) { int idx = threadIdx.x; a[idx] += 1.0f; } """) add_one = mod.get_function("add_one") a = np.float32([1.0, 2.0, 3.0]) add_one(cuda.InOut(a), block=(32,1,1), grid=(1,1)) print(a)
Debug
Known issues
breakingCUDA 13.x compatibility: PyCUDA v2025.1.2 added a fix for cuCtxCreate API change. Earlier versions may crash with CUDA 13.
fix
Upgrade to pycuda>=2025.1.2 or use CUDA 12.x.
affects: <2025.1.2
deprecatedappdirs replaced by platformdirs in v2024.1.1; if you depend on appdirs directly, update your imports.
fix
Use `platformdirs` instead of `appdirs`.
affects: >=2024.1.1
gotchaMemory transfers require explicit use of `cuda.In`, `cuda.Out`, `cuda.InOut`, or `cuda.mem_alloc`/`cuda.memcpy_htod`. Simply passing numpy arrays will not work.
fix
Always wrap arrays with the appropriate flag: `cuda.InOut(a)` for read-write.
affects: all
Upgrade
Version history
2026.1latest on PyPI · released Jan 15, 2026
Audit
Dependencies
numpyrequiredRequired for array operations and data transfer.
pytoolsrequiredUsed for metaprogramming and caching.
cuda-toolkitoptionalCUDA drivers and runtime (system-level).
Agent activity
25 hits · last 30 days
node
20
OpenAI (training)
1
Resources
pycuda — pip install pycuda · libregistry