{"library":"nvidia-cuda-nvcc","title":"NVIDIA CUDA NVCC Compiler","description":"Provides the nvcc CUDA compiler as a Python package for building CUDA kernels. Version 13.2.78 corresponds to CUDA 12.8. This package bundles the nvcc compiler and dependencies, simplifying CUDA compilation in Python environments without requiring a system CUDA installation.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install nvidia-cuda-nvcc"],"cli":{"name":"nvcc","version":"sh: 1: nvcc: not found"}},"imports":["from nvidia.cuda.nvcc import nvcc_path","from nvidia.cuda.nvcc import get_cc_version"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from nvidia.cuda.nvcc import nvcc_path\nimport subprocess\nimport os\n\n# Get the path to the bundled nvcc\nnvcc = nvcc_path()\nprint(f\"Using nvcc at: {nvcc}\")\n\n# Simple compile and run a CUDA kernel\ncode = '''\n__global__ void add(int *a, int *b, int *c) {\n    *c = *a + *b;\n}\n'''\nwith open('kernel.cu', 'w') as f:\n    f.write(code)\nresult = subprocess.run([nvcc, 'kernel.cu', '-o', 'kernel'], capture_output=True, text=True)\nif result.returncode == 0:\n    print(\"Compilation succeeded\")\nelse:\n    print(\"Compilation failed:\", result.stderr)","lang":"python","description":"Locate the bundled nvcc and compile a minimal CUDA kernel.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}