{"id":665,"library":"nvidia-curand-cu12","title":"NVIDIA CURAND CUDA 12 Runtime Libraries","description":"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.","status":"active","version":"10.3.10.19","language":"python","source_language":"en","source_url":"https://pypi.org/project/nvidia-curand-cu12/","tags":["cuda","nvidia","runtime","machine learning","deep learning","gpu","random number generation","curand"],"install":[{"cmd":"pip install nvidia-curand-cu12","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"This package provides native runtime libraries for CUDA 12.x. A compatible CUDA Toolkit installation and NVIDIA GPU driver are required for functionality.","package":"NVIDIA CUDA Toolkit (12.x compatible)","optional":false},{"reason":"Requires a CUDA-capable NVIDIA GPU to utilize the accelerated random number generation capabilities.","package":"NVIDIA GPU","optional":false}],"imports":[{"note":"`nvidia-curand-cu12` is a low-level runtime dependency; its functionalities are exposed through higher-level libraries that interface with the CUDA Toolkit.","symbol":"No direct Python imports","correct":"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":{"code":"# The nvidia-curand-cu12 package itself is not directly imported.\n# Instead, its functionalities are used by other libraries.\n# Here's an example using CuPy, which would leverage CURAND under the hood.\nimport cupy as cp\n\n# Ensure a CUDA-capable GPU is available\nif cp.cuda.is_available():\n    print(f\"CUDA is available. Current device: {cp.cuda.Device().name}\")\n\n    # Generate random numbers using CuPy, which utilizes CURAND\n    # on the GPU if nvidia-curand-cu12 is correctly installed and configured.\n    gpu_random_array = cp.random.rand(5)\n    print(\"GPU-generated random array:\", gpu_random_array)\n\n    # Example of generating normally distributed random numbers\n    gpu_normal_array = cp.random.normal(loc=0.0, scale=1.0, size=5)\n    print(\"GPU-generated normal array:\", gpu_normal_array)\n\nelse:\n    print(\"CUDA is not available. Please ensure a compatible GPU and CUDA Toolkit are installed.\")","lang":"python","description":"This quickstart demonstrates how a higher-level library like CuPy would utilize the underlying CURAND runtime provided by `nvidia-curand-cu12`. The `nvidia-curand-cu12` package itself does not expose direct Python APIs for import, but rather provides the necessary native libraries for GPU-accelerated random number generation that CuPy (or similar libraries) wrap. Ensure CuPy is installed (`pip install cupy-cuda12x`) and a CUDA-capable GPU is present."},"warnings":[{"fix":"Install a higher-level wrapper library (e.g., `cupy-cuda12x`) to interact with CURAND from Python.","message":"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.","severity":"gotcha","affected_versions":"All"},{"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.","message":"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.","severity":"breaking","affected_versions":"All"},{"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.","message":"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.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure all CUDA-dependent libraries and the installed CUDA Toolkit version match the `cu12` designation of this package.","message":"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.","severity":"gotcha","affected_versions":"All"},{"fix":"First, install the NVIDIA PyPI index configurator: `pip install nvidia-pyindex`. Then, install this package: `pip install nvidia-curand-cu12`.","message":"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`.","severity":"breaking","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-12T17:36:17.934Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"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).","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.","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."},{"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.","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.","error":"CuRandError: ('CURAND_STATUS_INITIALIZATION_FAILED', 'Initialization of CUDA failed')"},{"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).","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.","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."}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"10.3.10.19","install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.2,"import_time_s":null,"mem_mb":null,"disk_size":"180M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.2,"import_time_s":null,"mem_mb":null,"disk_size":"181M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.2,"import_time_s":null,"mem_mb":null,"disk_size":"173M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":"173M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.5,"import_time_s":null,"mem_mb":null,"disk_size":"179M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}