{"id":8598,"library":"rmm-cu12","title":"RMM - RAPIDS Memory Manager for CUDA 12","description":"RMM (RAPIDS Memory Manager) is a C++ and Python library for efficient GPU memory management. It provides a highly optimized allocation and deallocation framework tailored for NVIDIA GPUs, often used within the RAPIDS ecosystem to improve performance of data science workloads. The current version is 26.4.0, and it generally follows a monthly release cadence.","status":"active","version":"26.4.0","language":"en","source_language":"en","source_url":"https://github.com/rapidsai/rmm","tags":["GPU","memory management","CUDA","RAPIDS","data science"],"install":[{"cmd":"pip install rmm-cu12","lang":"bash","label":"Install for CUDA 12"}],"dependencies":[{"reason":"Required for Python bindings and direct CUDA interaction.","package":"cuda-python","optional":false},{"reason":"Commonly used alongside RMM for high-performance GPU array operations and integration.","package":"cupy","optional":true}],"imports":[{"symbol":"rmm","correct":"import rmm"},{"symbol":"PoolMemoryResource","correct":"from rmm.mr import PoolMemoryResource"},{"symbol":"CudaMemoryResource","correct":"from rmm.mr import CudaMemoryResource"},{"note":"The internal `rmm._lib` module was removed in v25.02.00. Use public APIs like `rmm.DeviceBuffer` instead.","wrong":"from rmm._lib import ...","symbol":"_lib","correct":"No direct import; use public rmm or rmm.mr APIs."}],"quickstart":{"code":"import rmm\nfrom rmm.mr import PoolMemoryResource, CudaMemoryResource, set_current_device_resource\n\n# Create an upstream resource (e.g., CudaMemoryResource) for the pool\nupstream = CudaMemoryResource()\n\n# Create a PoolMemoryResource with an initial size and an optional maximum size\ninitial_pool_size = 128 * 1024 * 1024  # 128 MiB\nmaximum_pool_size = 1024 * 1024 * 1024  # 1 GiB\n\npool_mr = PoolMemoryResource(\n    upstream=upstream,\n    initial_pool_size=initial_pool_size,\n    maximum_pool_size=maximum_pool_size\n)\n\n# Set the default RMM memory resource for the current device\nset_current_device_resource(pool_mr)\n\nprint(f\"RMM current device resource: {rmm.mr.get_current_device_resource()}\")\n\n# Allocate a DeviceBuffer using the default RMM memory resource\n# This buffer resides on the GPU\nbuffer_size = 64 * 1024 * 1024 # 64 MiB\ndevice_buffer = rmm.DeviceBuffer(size=buffer_size)\n\nprint(f\"Successfully allocated rmm.DeviceBuffer of {device_buffer.size / (1024*1024):.2f} MB on GPU.\")\n\n# Memory is automatically freed when device_buffer goes out of scope or program exits.\n","lang":"python","description":"This quickstart demonstrates how to initialize a `PoolMemoryResource` and set it as the current RMM device memory resource. It then allocates a `DeviceBuffer` using this configured resource."},"warnings":[{"fix":"Ensure your system has CUDA Toolkit version 12.0 or higher installed and that you've installed the appropriate `rmm-cu12` (or `rmm-cuXX`) package matching your CUDA environment.","message":"RMM requires CUDA 12.0+ starting from v25.08.00. Using RMM with older CUDA Toolkits (e.g., 11.x) will lead to runtime errors or compilation failures.","severity":"breaking","affected_versions":">=25.08.00"},{"fix":"Migrate to using public APIs from the `rmm` or `rmm.mr` modules. For example, use `rmm.DeviceBuffer` for GPU memory allocation.","message":"The internal `rmm._lib` module was removed. Direct imports from this module are no longer supported.","severity":"breaking","affected_versions":">=25.02.00"},{"fix":"Review the `rmm.mr` module documentation for updated API usage, especially if you implement or interact with custom memory resources. This includes changes to how some memory resource factory functions are deprecated or removed.","message":"The Python/Cython `memory_resource` interface underwent a significant refactor, affecting how custom or experimental memory resources are defined and used.","severity":"breaking","affected_versions":">=25.12.00"},{"fix":"If you were using `HostMemoryResource`, migrate to using `cuda_async_memory_resource` or other device memory resources for managing GPU-managed memory. Update to use the modern `rmm.mr` interface and CCCL compatible constructs.","message":"Host memory resources (`HostMemoryResource`) and related interfaces were removed, including the legacy memory resource interface in favor of the CCCL interface.","severity":"breaking","affected_versions":">=26.02.00"},{"fix":"If your application relies on specific floating-point behavior for -0.0 with `set_element_async`, be aware of this change and adjust accordingly.","message":"Zero-value special casing was removed in `set_element_async` to preserve IEEE 754 -0.0.","severity":"breaking","affected_versions":">=26.04.00"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Update your code to use the public APIs directly from `rmm` or `rmm.mr`. For example, `rmm.DeviceBuffer` for GPU memory allocation.","cause":"Attempting to import from the internal `rmm._lib` module, which was removed in RMM v25.02.00.","error":"ModuleNotFoundError: No module named 'rmm._lib'"},{"fix":"Verify your CUDA Toolkit version is 12.0 or higher. Ensure you've installed the `rmm-cu12` (or correct `rmm-cuXX` variant) matching your CUDA installation. Check your `LD_LIBRARY_PATH` and `PATH` environment variables.","cause":"This usually indicates a CUDA version mismatch. RMM v25.08.00 and later require CUDA 12.0 or newer, or there's an issue with your system's CUDA setup (e.g., `LD_LIBRARY_PATH` not correctly pointing to CUDA libraries).","error":"RuntimeError: RMM failure: CUDA error at /path/to/rmm/src/.../detail/aligned_allocator.hpp:145: cudaErrorNoDevice"},{"fix":"Migrate your code to use `cuda_async_memory_resource` or other device memory resources for managing GPU-accessible memory, as host memory resources are no longer part of RMM.","cause":"The `HostMemoryResource` and related host memory interfaces were removed in RMM v26.02.00.","error":"AttributeError: module 'rmm.mr' has no attribute 'HostMemoryResource'"}]}