{"id":24130,"library":"nvidia-mathdx","title":"nvidia-mathdx","description":"MathDx is a NVIDIA device library for accelerated math operations on GPUs, providing high-performance implementations for common mathematical functions. Version 25.6.0 is the latest. This package is part of the NVIDIA CUDA ecosystem and is updated frequently with new GPU architectures.","status":"active","version":"25.6.0","language":"python","source_language":"en","source_url":"https://github.com/NVIDIA/MathDx","tags":["gpu","cuda","math","nvidia","array","high-performance"],"install":[{"cmd":"pip install nvidia-mathdx","lang":"bash","label":"Standard PyPI install"}],"dependencies":[{"reason":"MathDx often depends on CuPy for array operations and GPU context.","package":"cupy-cuda12x","optional":true},{"reason":"Required for CUDA runtime if using MathDx kernels directly.","package":"nvidia-cuda-runtime-cu12","optional":true}],"imports":[{"wrong":"import nvidia_mathdx as mathdx","symbol":"nvidia","correct":"import nvidia"}],"quickstart":{"code":"import nvidia_mathdx as mathdx\nimport cupy as cp\n\n# Create a CuPy array\na = cp.array([1.0, 2.0, 3.0, 4.0])\n\n# Use mathdx elementwise math (example: sin)\nb = mathdx.sin(a)\nprint(b)","lang":"python","description":"Basic usage showing import pattern and calling an elementwise math function on a CuPy array."},"warnings":[{"fix":"Update imports to use subpackages: e.g., `from nvidia_mathdx.fft import fft`.","message":"The package was originally distributed as a single module; in recent versions it has been split into subpackages (e.g., nvidia_mathdx.fft, nvidia_mathdx.linalg). Old code importing `nvidia_mathdx` directly may break if relying on functions that moved.","severity":"breaking","affected_versions":">=24.12.0"},{"fix":"Use `cp.cuda.Stream.null.synchronize()` before reading results back to host, or use CuPy's default synchronization.","message":"The function `mathdx.sin` may return a GPU array that is not automatically synchronized with the host. Accessing `.get()` on the result without explicit synchronization can cause segmentation faults.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace calls to `mathdx.matrix_inverse` with `mathdx.linalg.inv`.","message":"The top-level function `mathdx.matrix_inverse` is deprecated in favor of `mathdx.linalg.inv`.","severity":"deprecated","affected_versions":">=25.03.0"}],"env_vars":null,"search_vec":"'25.6.0':26 'acceler':11 'architectur':46 'array':51 'common':22 'cuda':37,48 'devic':8 'ecosystem':38 'frequent':42 'function':24 'gpu':45,47 'gpus':15 'high':18,53 'high-perform':17,52 'implement':20 'latest':29 'librari':9 'math':12,49 'mathdx':3,4 'mathemat':23 'new':44 'nvidia':2,7,36,50 'nvidia-mathdx':1 'oper':13 'packag':31 'part':33 'perform':19,54 'provid':16 'updat':41 'version':25","created_at":"2026-05-01T08:11:27.407173+00:00","updated_at":"2026-05-01T08:11:27.407173+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"25.6.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://developer.nvidia.com/cufftdx-downloads","github":null,"docs":"https://docs.nvidia.com/cuda/cufftdx/index.html","changelog":null,"pypi":"https://pypi.org/project/nvidia-mathdx/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}