{"id":4139,"library":"nvidia-curand-cu11","title":"NVIDIA CURAND for CUDA 11","description":"The `nvidia-curand-cu11` package provides the native runtime libraries for NVIDIA's CUDA Random Number Generation (CURAND) library, specifically compiled for CUDA 11 environments. CURAND delivers high-performance GPU-accelerated random number generation, offering various algorithms and distribution options for scientific computing, machine learning, and deep learning applications. This package acts as a low-level dependency for higher-level Python libraries that utilize GPU-accelerated random number generation. The current version is 10.3.0.86, with releases typically having a slow cadence.","status":"active","version":"10.3.0.86","language":"en","source_language":"en","source_url":"https://developer.nvidia.com/curand","tags":["cuda","nvidia","gpu","random number generation","runtime","deep learning","machine learning","scientific computing","cuda11"],"install":[{"cmd":"pip install nvidia-curand-cu11","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides the fundamental CUDA 11 runtime libraries required by all `nvidia-*-cu11` packages for execution on NVIDIA GPUs.","package":"nvidia-cuda-runtime-cu11","optional":false},{"reason":"A common Python library that provides GPU arrays and functions, often used to access CURAND functionality. (Optional, as other libraries like PyTorch also use CURAND).","package":"cupy","optional":true}],"imports":[{"note":"This package provides the native CURAND runtime libraries (shared objects/DLLs) for the CUDA 11 ecosystem. It does not expose a direct Python API with callable functions from `nvidia_curand_cu11` itself. Users typically access CURAND's capabilities through higher-level Python libraries that wrap the underlying CUDA C/C++ functionality.","wrong":"import nvidia_curand_cu11","symbol":"N/A (Runtime Library)","correct":"Functionality accessed via libraries like CuPy, Numba, or PyTorch."}],"quickstart":{"code":"# This package provides runtime libraries; direct import is not applicable.\n# Instead, CURAND's functionality (GPU random numbers) is typically accessed via other Python libraries.\n# Here's an example using CuPy, which implicitly uses CURAND:\n\ntry:\n    import cupy as cp\n    import numpy as np\n\n    # Initialize a GPU random number generator\n    rng = cp.random.default_rng()\n\n    # Generate 5 random floats on the GPU\n    gpu_random_numbers = rng.random(5)\n    print(f\"GPU Random Numbers (CuPy): {gpu_random_numbers}\")\n\n    # Transfer to CPU for verification (optional)\n    cpu_array = gpu_random_numbers.get()\n    print(f\"CPU Array (NumPy from CuPy): {cpu_array}\")\n\nexcept ImportError:\n    print(\"CuPy not installed. Install with: pip install cupy-cuda11x\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure you have a compatible NVIDIA GPU, CUDA 11 toolkit, and appropriate drivers installed.\")","lang":"python","description":"Since `nvidia-curand-cu11` is a runtime library, it doesn't have a direct Python quickstart. Instead, you would use a Python library like CuPy (shown below) or PyTorch, which leverage the underlying CURAND functionalities for GPU-accelerated random number generation. This example demonstrates generating random numbers directly on the GPU using CuPy's random number generator, which is built upon CURAND."},"warnings":[{"fix":"Ensure all `nvidia-*` Python packages in your environment target the same CUDA major version (e.g., all `cu11` or all `cu12`). Match your pip-installed CUDA packages with your system's CUDA Toolkit if applicable.","message":"CUDA Version Mismatch: This package is specifically for CUDA 11. Mixing `nvidia-*-cu11` packages with `nvidia-*-cu12` (or other CUDA versions) in the same Python environment, or using them with a system-installed CUDA Toolkit of a different major version, can lead to runtime errors or undefined behavior.","severity":"breaking","affected_versions":"All versions"},{"fix":"Regularly update your NVIDIA GPU drivers to ensure compatibility with your installed CUDA Toolkit and associated Python packages. Refer to NVIDIA's driver documentation for the recommended driver version for CUDA 11.x.","message":"GPU Driver Compatibility: `pip` installations of NVIDIA CUDA packages do not check or install GPU drivers. The system's NVIDIA GPU driver must be compatible with the CUDA 11 version targeted by `nvidia-curand-cu11` for the package to function correctly. Outdated drivers can lead to GPU detection issues or runtime failures.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To utilize CURAND functionality in Python, use a library designed to interface with CUDA math libraries, such as CuPy (`cupy.random`), Numba (`numba.cuda.random`), or PyTorch (`torch.cuda.random`).","message":"No Direct Python API: This package provides the underlying native CURAND shared libraries/DLLs, not a direct Python API. You cannot `import nvidia_curand_cu11` and call functions directly from it. Functionality is exposed through higher-level Python wrappers (e.g., CuPy, Numba, PyTorch) that dynamically link against these runtime components.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review the NVIDIA Proprietary Software License terms provided with the package or on NVIDIA's developer website to ensure compliance.","message":"Proprietary License: `nvidia-curand-cu11` is distributed under an NVIDIA Proprietary Software License. Users should be aware of the licensing terms for their projects.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For new projects or long-term maintenance, consider migrating to Python packages compatible with newer CUDA Toolkit versions (e.g., `nvidia-curand-cu12`) when feasible and stable, keeping in mind the associated dependency changes.","message":"Future CUDA 11.x Deprecation: Newer CUDA Toolkit releases (e.g., CUDA 13.0) have begun deprecating support for CUDA 11.x. While `nvidia-curand-cu11` is currently active, users should be mindful that future developments will focus on newer CUDA versions (e.g., `cu12`, `cu13`), and `cu11` packages may eventually become unsupported.","severity":"deprecated","affected_versions":"Future CUDA Toolkit releases (e.g., CUDA 13.0 and beyond)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}