NVIDIA CURAND CUDA 12 Runtime Libraries
raw JSON → 10.3.10.19 verified Tue May 12 auth: no python install: stale quickstart: stale
The `nvidia-curand-cu12` package provides the native runtime libraries for NVIDIA's CUDA Random Number Generation (CURAND) library, specifically compiled for CUDA Toolkit 12.x. It acts as a foundational dependency for higher-level Python libraries that wrap CUDA functionalities, enabling GPU-accelerated random number generation. The current version is 10.3.10.19, and it typically follows the CUDA Toolkit's release cadence.
pip install nvidia-curand-cu12 Common errors
error ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. torch X.Y.Z requires nvidia-curand-cu12==A.B.C.D; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-curand-cu12 E.F.G.H which is incompatible. ↓
cause This error occurs when the version of `nvidia-curand-cu12` installed or requested by a dependency (like PyTorch or TensorFlow) does not exactly match the version that another installed package or the system's CUDA environment expects, leading to a dependency conflict.
fix
Identify the specific
nvidia-curand-cu12 version required by the main deep learning framework you are using (e.g., PyTorch or TensorFlow) and explicitly install that precise version. It may also be necessary to create a new virtual environment to avoid conflicts with other existing packages. For example: pip install torch==X.Y.Z+cu12x -f https://download.pytorch.org/whl/torch_stable.html (replacing X.Y.Z with your desired PyTorch version and cu12x with the specific CUDA 12 sub-version, which will pull the correct nvidia-curand-cu12 dependency). error CuRandError: ('CURAND_STATUS_INITIALIZATION_FAILED', 'Initialization of CUDA failed') ↓
cause This runtime error indicates that the CURAND library failed to initialize the CUDA context on the GPU, which can be due to various reasons such as insufficient GPU memory, an incompatible CUDA driver, or a problem establishing the CUDA environment for the application.
fix
Verify that your NVIDIA GPU drivers are correctly installed and up to date, and that your CUDA Toolkit version is compatible with the
nvidia-curand-cu12 package. Ensure sufficient GPU memory is available, potentially by closing other GPU-intensive applications or by setting environment variables like CUPY_GPU_MEMORY_LIMIT if using CuPy. Rebooting the system can sometimes resolve transient CUDA context issues. error No solution found when resolving dependencies: ╰─▶ Because nvidia-curand-cu12==X.Y.Z.W is unusable because no wheels are available with a matching platform and you require nvidia-curand-cu12==X.Y.Z.W, we can conclude that the requirements are unsatisfiable. ↓
cause This installation error means that `pip` or `uv` could not find a pre-compiled wheel package for `nvidia-curand-cu12` that matches your specific operating system, Python version, and system architecture (e.g., `manylinux_2_27_x86_64`, `win_amd64`, `aarch64`). This can happen if you're on an unsupported platform or a very new/old Python version for which wheels haven't been built.
fix
Ensure you are using a supported combination of OS, architecture, and Python version (typically Python 3.x, on Linux x86_64 or Windows x86-64 for most CUDA packages). Check the
nvidia-curand-cu12 PyPI page for available wheels and their compatibility tags. If a wheel is genuinely unavailable for your platform, you might need to try installing a different version of the dependent library (e.g., PyTorch) that provides a compatible nvidia-curand-cu12 wheel, or try to compile it from source if the project supports it (though this is rarely straightforward for native CUDA libraries). Warnings
gotcha This package is a native runtime library for CUDA and does not provide a direct Python API for `curand` functions. You typically use it as a dependency for other Python libraries like CuPy or Numba that wrap CUDA functionalities. ↓
fix Install a higher-level wrapper library (e.g., `cupy-cuda12x`) to interact with CURAND from Python.
breaking Requires a compatible NVIDIA CUDA-capable GPU and an NVIDIA GPU driver. Without these, the package will install but its core functionality will not be usable, potentially leading to runtime errors in dependent libraries. ↓
fix Ensure your system has a supported NVIDIA GPU and the appropriate NVIDIA GPU drivers are installed and up-to-date. Verify CUDA Toolkit is correctly configured.
gotcha Dependency resolution with `pip` can be complex due to the intricate CUDA ecosystem. Installing multiple `nvidia-*cu12` packages or conflicting versions of CUDA-dependent libraries can lead to `pip` backtracking issues, resulting in slow or failed installations. ↓
fix Use stricter version constraints for `nvidia-*cu12` packages and their dependants, or consider using environment managers like Conda which can sometimes handle these dependencies more robustly.
gotcha The `cu12` suffix indicates compatibility with CUDA Toolkit 12.x. Using this package with applications built for different major CUDA versions (e.g., CUDA 11.x) will likely lead to compatibility issues or runtime failures. ↓
fix Ensure all CUDA-dependent libraries and the installed CUDA Toolkit version match the `cu12` designation of this package.
breaking This package is hosted on the NVIDIA Python Package Index. Attempting to install it directly from PyPI.org without configuring the NVIDIA index will result in a `RuntimeError` stating it's a placeholder and suggesting installation via `nvidia-pyindex`. ↓
fix First, install the NVIDIA PyPI index configurator: `pip install nvidia-pyindex`. Then, install this package: `pip install nvidia-curand-cu12`.
Install compatibility stale last tested: 2026-05-12
python os / libc status wheel install import disk
3.10 alpine (musl) build_error - - - -
3.10 alpine (musl) - - - -
3.10 slim (glibc) wheel 3.2s - 180M
3.10 slim (glibc) - - - -
3.11 alpine (musl) build_error - - - -
3.11 alpine (musl) - - - -
3.11 slim (glibc) wheel 3.2s - 181M
3.11 slim (glibc) - - - -
3.12 alpine (musl) build_error - - - -
3.12 alpine (musl) - - - -
3.12 slim (glibc) wheel 3.2s - 173M
3.12 slim (glibc) - - - -
3.13 alpine (musl) build_error - - - -
3.13 alpine (musl) - - - -
3.13 slim (glibc) wheel 2.9s - 173M
3.13 slim (glibc) - - - -
3.9 alpine (musl) build_error - - - -
3.9 alpine (musl) - - - -
3.9 slim (glibc) wheel 3.5s - 179M
3.9 slim (glibc) - - - -
Imports
- No direct Python imports
This package primarily provides native runtime libraries and is typically consumed by other Python wrappers (e.g., CuPy, Numba) rather than being directly imported in Python code.
Quickstart stale last tested: 2026-04-24
# The nvidia-curand-cu12 package itself is not directly imported.
# Instead, its functionalities are used by other libraries.
# Here's an example using CuPy, which would leverage CURAND under the hood.
import cupy as cp
# Ensure a CUDA-capable GPU is available
if cp.cuda.is_available():
print(f"CUDA is available. Current device: {cp.cuda.Device().name}")
# Generate random numbers using CuPy, which utilizes CURAND
# on the GPU if nvidia-curand-cu12 is correctly installed and configured.
gpu_random_array = cp.random.rand(5)
print("GPU-generated random array:", gpu_random_array)
# Example of generating normally distributed random numbers
gpu_normal_array = cp.random.normal(loc=0.0, scale=1.0, size=5)
print("GPU-generated normal array:", gpu_normal_array)
else:
print("CUDA is not available. Please ensure a compatible GPU and CUDA Toolkit are installed.")