diff --git a/docs/cuopt/source/_static/install-selector.css b/docs/cuopt/source/_static/install-selector.css new file mode 100644 index 0000000000..623a023351 --- /dev/null +++ b/docs/cuopt/source/_static/install-selector.css @@ -0,0 +1,199 @@ +/* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * Install selector – NVIDIA green button and improved look and feel */ +:root { + --cuopt-nvidia-green: #76b900; + --cuopt-nvidia-green-hover: #6aa000; + --cuopt-nvidia-green-active: #5c8f00; + --cuopt-border: #d0d0d0; + --cuopt-bg-subtle: #f5f5f5; + --cuopt-text: #333; + --cuopt-radius: 6px; +} + +.cuopt-install-selector-wrap { + background: var(--cuopt-bg-subtle); + border: 1px solid var(--cuopt-border); + border-radius: var(--cuopt-radius); + padding: 1.25rem 1.5rem; + margin: 1.25em 0; + max-width: 42em; +} + +.cuopt-install-selector-wrap.cuopt-install-error { + border-color: #c00; + background-color: #fff5f5; +} + +.cuopt-install-selector-wrap.cuopt-install-error code { + font-size: 0.9em; + padding: 0.1em 0.3em; + background: #fff; + border-radius: 3px; +} + +.cuopt-install-selector-table { + margin: 0 !important; + border: none !important; + width: 100%; + table-layout: fixed; +} + +.cuopt-install-selector-table tr { + border: none; +} + +.cuopt-install-selector-table td { + border: none; + padding: 0.4em 0.6em 0.4em 0; + vertical-align: middle; +} + +.cuopt-install-selector-table td:first-child { + width: 6em; + white-space: nowrap; + font-weight: 600; + color: var(--cuopt-text); + vertical-align: middle; + padding-right: 1rem; +} + +.cuopt-opt-label { + font-weight: 600; + color: var(--cuopt-text); +} + +.cuopt-opt-group { + display: flex; + flex-wrap: nowrap; + gap: 0; + align-items: stretch; + min-width: 0; + width: 100%; +} + +.cuopt-opt-group .cuopt-opt { + flex: 1 1 0; + min-width: 0; +} + +.cuopt-opt { + display: flex; + align-items: center; + justify-content: center; + padding: 0.5em 0.5em; + font-size: 0.9em; + color: var(--cuopt-text); + background-color: #fff; + border: 1px solid var(--cuopt-border); + border-radius: 0; + cursor: pointer; + transition: border-color 0.15s ease, background-color 0.15s ease; + box-sizing: border-box; + text-align: center; +} + +.cuopt-opt:first-child { + border-radius: 4px 0 0 4px; +} + +.cuopt-opt:not(:first-child) { + margin-left: -1px; +} + +.cuopt-opt:last-child { + border-radius: 0 4px 4px 0; +} + +.cuopt-opt:hover { + border-color: #999; + background-color: #fafafa; + z-index: 1; +} + +/* Hide radio visually; keep for accessibility and click behavior */ +.cuopt-opt input { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip-path: inset(50%); + -webkit-clip-path: inset(50%); + white-space: nowrap; + border: 0; +} + +.cuopt-opt:has(input:focus) { + outline: 2px solid var(--cuopt-nvidia-green); + outline-offset: 2px; + z-index: 2; +} + +.cuopt-opt:has(input:checked) { + border-color: var(--cuopt-nvidia-green); + background-color: rgba(118, 185, 0, 0.08); + z-index: 1; +} + +.cuopt-install-output { + margin-top: 1.25rem; + padding-top: 1rem; + border-top: 1px solid var(--cuopt-border); +} + +.cuopt-install-copy-wrap { + text-align: center; + margin-top: 0.75em; +} + +#cuopt-copy-btn.cuopt-install-copy-btn { + display: inline-flex; + align-items: center; + gap: 0.35em; + padding: 0.5em 1em; + font-size: 0.9em; + font-weight: 600; + color: #fff !important; + background-color: var(--cuopt-nvidia-green); + border: none; + border-radius: 4px; + cursor: pointer; + transition: background-color 0.15s ease; +} + +#cuopt-copy-btn.cuopt-install-copy-btn:hover { + background-color: var(--cuopt-nvidia-green-hover); +} + +#cuopt-copy-btn.cuopt-install-copy-btn:active { + background-color: var(--cuopt-nvidia-green-active); +} + +#cuopt-copy-btn.cuopt-install-copy-btn:focus { + outline: 2px solid var(--cuopt-nvidia-green); + outline-offset: 2px; +} + +#cuopt-cmd-out.cuopt-install-cmd-out { + width: 100%; + min-height: 6.5em; + padding: 0.75em 1em; + font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace; + font-size: 0.85em; + line-height: 1.45; + color: var(--cuopt-text); + background-color: #fff; + border: 1px solid var(--cuopt-border); + border-radius: 4px; + resize: vertical; + box-sizing: border-box; +} + +#cuopt-cmd-out.cuopt-install-cmd-out:focus { + outline: 2px solid var(--cuopt-nvidia-green); + outline-offset: 0; + border-color: var(--cuopt-nvidia-green); +} diff --git a/docs/cuopt/source/_static/install-selector.js b/docs/cuopt/source/_static/install-selector.js new file mode 100644 index 0000000000..d0d309b897 --- /dev/null +++ b/docs/cuopt/source/_static/install-selector.js @@ -0,0 +1,385 @@ +/** + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * cuOpt install selector - generates install commands from user choices. + * Stable version comes from window.CUOPT_INSTALL_VERSION (injected at build from cuopt.__version__). + * Next = stable + 2 on minor with year rollover (YY.MM format). Update COMMANDS structure when commands change. + */ +(function () { + "use strict"; + + var ver = typeof window !== "undefined" && window.CUOPT_INSTALL_VERSION; + if (!ver || !ver.conda || !ver.pip) { + var root = document.getElementById("cuopt-install-selector"); + if (root) { + root.innerHTML = + '
' + + '

Install selector error: Version was not injected. ' + + 'Build the documentation (e.g. make html) so that cuopt-install-version.js is generated from the package version.

' + + "
"; + } + return; + } + + var V_CONDA = ver.conda; + var V = ver.pip; + var parts = V_CONDA.split("."); + var major = parseInt(parts[0], 10); + var minor = parseInt(parts[1], 10) || 0; + var nextMinor = minor + 2; + var nextMajor = major; + if (nextMinor > 12) { + nextMajor = major + 1; + nextMinor = nextMinor - 12; + } + var V_CONDA_NEXT = nextMajor + "." + (nextMinor < 10 ? "0" : "") + nextMinor; + var V_NEXT = nextMajor + "." + nextMinor; + + var COMMANDS = { + python: { + pip: { + stable: { + cu12: + "pip install --extra-index-url=https://pypi.nvidia.com 'cuopt-cu12==" + + V + + ".*'", + cu13: + "pip install --extra-index-url=https://pypi.nvidia.com 'cuopt-cu13==" + + V + + ".*'", + }, + nightly: { + cu12: + "pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ 'cuopt-cu12==" + + V_NEXT + + ".*'", + cu13: + "pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ 'cuopt-cu13==" + + V_NEXT + + ".*'", + }, + }, + conda: { + stable: { + cu12: + "conda install -c rapidsai -c conda-forge -c nvidia cuopt=" + + V_CONDA + + ".* cuda-version=12.9", + cu13: + "conda install -c rapidsai -c conda-forge -c nvidia cuopt=" + + V_CONDA + + ".* cuda-version=13.0", + }, + nightly: { + cu12: + "conda install -c rapidsai-nightly -c conda-forge -c nvidia cuopt=" + + V_CONDA_NEXT + + ".* cuda-version=12.9", + cu13: + "conda install -c rapidsai-nightly -c conda-forge -c nvidia cuopt=" + + V_CONDA_NEXT + + ".* cuda-version=13.0", + }, + }, + container: { + stable: { + cu12: { + default: "docker pull nvidia/cuopt:latest-cuda12.9-py3.13", + run: "docker run --gpus all -it --rm nvidia/cuopt:latest-cuda12.9-py3.13 /bin/bash", + }, + cu13: { + default: "docker pull nvidia/cuopt:latest-cuda13.0-py3.13", + run: "docker run --gpus all -it --rm nvidia/cuopt:latest-cuda13.0-py3.13 /bin/bash", + }, + }, + nightly: { + cu12: { + default: "docker pull nvidia/cuopt:" + V_NEXT + ".0a-cuda12.9-py3.13", + run: "docker run --gpus all -it --rm nvidia/cuopt:" + V_NEXT + ".0a-cuda12.9-py3.13 /bin/bash", + }, + cu13: { + default: "docker pull nvidia/cuopt:" + V_NEXT + ".0a-cuda13.0-py3.13", + run: "docker run --gpus all -it --rm nvidia/cuopt:" + V_NEXT + ".0a-cuda13.0-py3.13 /bin/bash", + }, + }, + }, + }, + c: { + pip: { + stable: { + cu12: + "pip uninstall -y cuopt-thin-client 2>/dev/null; pip install --extra-index-url=https://pypi.nvidia.com 'libcuopt-cu12==" + + V + + ".*'", + cu13: + "pip uninstall -y cuopt-thin-client 2>/dev/null; pip install --extra-index-url=https://pypi.nvidia.com 'libcuopt-cu13==" + + V + + ".*'", + }, + nightly: { + cu12: + "pip uninstall -y cuopt-thin-client 2>/dev/null; pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ 'libcuopt-cu12==" + + V_NEXT + + ".*'", + cu13: + "pip uninstall -y cuopt-thin-client 2>/dev/null; pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ 'libcuopt-cu13==" + + V_NEXT + + ".*'", + }, + }, + conda: { + stable: { + cu12: + "conda remove cuopt-thin-client --yes 2>/dev/null; conda install -c rapidsai -c conda-forge -c nvidia libcuopt=" + + V_CONDA + + ".* cuda-version=12.9", + cu13: + "conda remove cuopt-thin-client --yes 2>/dev/null; conda install -c rapidsai -c conda-forge -c nvidia libcuopt=" + + V_CONDA + + ".* cuda-version=13.0", + }, + nightly: { + cu12: + "conda install -c rapidsai-nightly -c conda-forge -c nvidia libcuopt=" + + V_CONDA_NEXT + + ".* cuda-version=12.9", + cu13: + "conda install -c rapidsai-nightly -c conda-forge -c nvidia libcuopt=" + + V_CONDA_NEXT + + ".* cuda-version=13.0", + }, + }, + container: null, + }, + server: { + pip: { + stable: { + cu12: + "pip install --extra-index-url=https://pypi.nvidia.com 'nvidia-cuda-runtime-cu12==12.9.*' 'cuopt-server-cu12==" + + V + + ".*' 'cuopt-sh-client==" + + V_CONDA + + ".*'", + cu13: + "pip install --extra-index-url=https://pypi.nvidia.com 'nvidia-cuda-runtime==13.0.*' 'cuopt-server-cu13==" + + V + + ".*' 'cuopt-sh-client==" + + V_CONDA + + ".*'", + }, + nightly: { + cu12: + "pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ 'cuopt-server-cu12==" + + V_NEXT + + ".*' 'cuopt-sh-client==" + + V_CONDA_NEXT + + ".*'", + cu13: + "pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ 'cuopt-server-cu13==" + + V_NEXT + + ".*' 'cuopt-sh-client==" + + V_CONDA_NEXT + + ".*'", + }, + }, + conda: { + stable: { + default: + "conda install -c rapidsai -c conda-forge -c nvidia cuopt-server=" + + V_CONDA + + ".* cuopt-sh-client=" + + V_CONDA + + ".*", + }, + nightly: { + default: + "conda install -c rapidsai-nightly -c conda-forge -c nvidia cuopt-server=" + + V_CONDA_NEXT + + ".* cuopt-sh-client=" + + V_CONDA_NEXT + + ".*", + }, + }, + container: { + stable: { + cu12: { + default: "docker pull nvidia/cuopt:latest-cuda12.9-py3.13", + run: "docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 nvidia/cuopt:latest-cuda12.9-py3.13", + }, + cu13: { + default: "docker pull nvidia/cuopt:latest-cuda13.0-py3.13", + run: "docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 nvidia/cuopt:latest-cuda13.0-py3.13", + }, + }, + nightly: { + cu12: { + default: "docker pull nvidia/cuopt:" + V_NEXT + ".0a-cuda12.9-py3.13", + run: "docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 nvidia/cuopt:" + V_NEXT + ".0a-cuda12.9-py3.13", + }, + cu13: { + default: "docker pull nvidia/cuopt:" + V_NEXT + ".0a-cuda13.0-py3.13", + run: "docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 nvidia/cuopt:" + V_NEXT + ".0a-cuda13.0-py3.13", + }, + }, + }, + }, + }; + + var SUPPORTED_METHODS = { + python: ["pip", "conda", "container"], + c: ["pip", "conda"], + server: ["pip", "conda", "container"], + cli: ["pip", "conda"], + }; + + function getSelectedValue(name) { + var el = document.querySelector('input[name="' + name + '"]:checked'); + return el ? el.value : ""; + } + + function hasCudaVariants(iface, method) { + var d = COMMANDS[iface] && COMMANDS[iface][method]; + if (!d || !d.stable) return false; + return !!(d.stable.cu12 && d.stable.cu13); + } + + function getCommand() { + var iface = getSelectedValue("cuopt-iface"); + var method = getSelectedValue("cuopt-method"); + var release = getSelectedValue("cuopt-release"); + var cuda = getSelectedValue("cuopt-cuda"); + + /* CLI uses libcuopt (c) install; cuopt_cli is shipped with libcuopt. */ + if (iface === "cli") { + iface = "c"; + release = "stable"; + cuda = "cu12"; + } + + var data = COMMANDS[iface] && COMMANDS[iface][method]; + if (!data || !data[release]) return ""; + + var cmd = ""; + if (method === "container") { + var cudaKey = cuda || "cu12"; + var c = data[release][cudaKey] || data[release].cu12; + cmd = c.default + "\n\n# Run the container:\n" + c.run; + } else { + var key = data[release].cu12 && data[release].cu13 ? cuda : "default"; + cmd = data[release][key] || data[release].cu12 || data[release].cu13 || data[release].default || ""; + } + return cmd; + } + + function updateOutput() { + var out = document.getElementById("cuopt-cmd-out"); + var copyBtn = document.getElementById("cuopt-copy-btn"); + var cmd = getCommand(); + out.value = cmd; + out.style.display = cmd ? "block" : "none"; + copyBtn.style.display = cmd ? "inline-flex" : "none"; + } + + function updateVisibility() { + var method = getSelectedValue("cuopt-method"); + var iface = getSelectedValue("cuopt-iface"); + var allowed = SUPPORTED_METHODS[iface] || []; + var methodInputs = document.querySelectorAll('input[name="cuopt-method"]'); + methodInputs.forEach(function (input) { + var enabled = allowed.indexOf(input.value) !== -1; + input.disabled = !enabled; + var label = input.closest("label"); + if (label) label.style.display = enabled ? "" : "none"; + }); + if (allowed.indexOf(method) === -1 && allowed.length) { + var fallback = document.querySelector('input[name="cuopt-method"][value="' + allowed[0] + '"]'); + if (fallback) { + fallback.checked = true; + method = allowed[0]; + } + } + var cudaRow = document.getElementById("cuopt-cuda-row"); + var releaseRow = document.getElementById("cuopt-release-row"); + var releaseVisible = iface !== "cli"; + var showCuda = releaseVisible && (method === "pip" || method === "conda" || method === "container") && hasCudaVariants(iface, method); + cudaRow.style.display = showCuda ? "table-row" : "none"; + releaseRow.style.display = releaseVisible ? "table-row" : "none"; + updateOutput(); + } + + function copyToClipboard() { + var out = document.getElementById("cuopt-cmd-out"); + if (!out.value) return; + out.select(); + out.setSelectionRange(0, 99999); + try { + document.execCommand("copy"); + var btn = document.getElementById("cuopt-copy-btn"); + var orig = btn.textContent; + btn.textContent = "Copied!"; + setTimeout(function () { + btn.textContent = orig; + }, 1500); + } catch (e) {} + } + + function render() { + var root = document.getElementById("cuopt-install-selector"); + if (!root) return; + + root.innerHTML = + '
' + + '' + + '' + + '' + + '' + + '' + + "
Interface' + + '' + + '' + + '' + + '' + + '
Method' + + '' + + '' + + '' + + '
Release' + + '' + + '' + + '
CUDA' + + '' + + '' + + '
" + + '
' + + '' + + '
' + + "
"; + + ["cuopt-iface", "cuopt-method", "cuopt-release", "cuopt-cuda"].forEach( + function (name) { + var inputs = document.querySelectorAll('input[name="' + name + '"]'); + inputs.forEach(function (input) { + input.addEventListener("change", updateVisibility); + }); + } + ); + document.getElementById("cuopt-copy-btn").addEventListener("click", copyToClipboard); + updateVisibility(); + + var defaultIface = root.getAttribute("data-default-iface"); + if (defaultIface && ["python", "c", "server", "cli"].indexOf(defaultIface) !== -1) { + var radio = document.querySelector('input[name="cuopt-iface"][value="' + defaultIface + '"]'); + if (radio) { + radio.checked = true; + updateVisibility(); + } + } + } + + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", render); + } else { + render(); + } +})(); diff --git a/docs/cuopt/source/conf.py b/docs/cuopt/source/conf.py index 919567fb88..6f1516840c 100644 --- a/docs/cuopt/source/conf.py +++ b/docs/cuopt/source/conf.py @@ -15,6 +15,8 @@ import json from sphinx.util.fileutil import copy_asset_file from pathlib import Path +from docutils import nodes +from docutils.parsers.rst import Directive, directives # Run cuopt server help command and save output subprocess.run( @@ -169,7 +171,8 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] -html_css_files = ["swagger-nvidia.css"] +html_css_files = ["swagger-nvidia.css", "install-selector.css"] +html_js_files = ["cuopt-install-version.js", "install-selector.js"] html_extra_path = ["versions1.json"] @@ -378,7 +381,50 @@ def write_project_json(app, _builder): ] +class InstallSelector(Directive): + """Embed the install selector widget. Optional :default-iface: (python, c, server, cli).""" + + optional_arguments = 0 + option_spec = {"default-iface": directives.unchanged} + has_content = False + + def run(self): + default_iface = ( + (self.options.get("default-iface") or "").strip().lower() + ) + if default_iface not in ("python", "c", "server", "cli"): + default_iface = "" + data_attr = ( + ' data-default-iface="' + default_iface + '"' + if default_iface + else "" + ) + html = '
" + return [nodes.raw("", html, format="html")] + + +def write_install_version_js(app): + """Write install selector version from cuopt.__version__ to output _static.""" + outdir = getattr(app.builder, "outdir", None) or getattr( + app.config, "outdir", None + ) + if not outdir: + return + static_dir = os.path.join(outdir, "_static") + os.makedirs(static_dir, exist_ok=True) + conda_ver = f"{CUOPT_VERSION.major:02}.{CUOPT_VERSION.minor:02}" + pip_ver = f"{CUOPT_VERSION.major}.{CUOPT_VERSION.minor}" + path = os.path.join(static_dir, "cuopt-install-version.js") + with open(path, "w") as f: + f.write( + 'window.CUOPT_INSTALL_VERSION = { "conda": "%s", "pip": "%s" };\n' + % (conda_ver, pip_ver) + ) + + def setup(app): + app.add_directive("install-selector", InstallSelector) app.setup_extension("sphinx.ext.autodoc") app.connect("autodoc-skip-member", skip_unwanted_inherited_members) app.connect("write-started", write_project_json) + app.connect("builder-inited", write_install_version_js) diff --git a/docs/cuopt/source/cuopt-c/quick-start.rst b/docs/cuopt/source/cuopt-c/quick-start.rst index 68e6180492..73921c049f 100644 --- a/docs/cuopt/source/cuopt-c/quick-start.rst +++ b/docs/cuopt/source/cuopt-c/quick-start.rst @@ -8,53 +8,9 @@ NVIDIA cuOpt provides C API for LP, QP and MILP. This section will show you how Installation ============ -pip ---- +Choose your install method below; the selector is pre-set for the C API (libcuopt), which also provides ``cuopt_cli``. Copy the command and run it in your environment. See :doc:`../install` for all interfaces and options. -This wheel is a Python wrapper around the C++ library and eases installation and access to libcuopt. This also helps in the pip environment to load libraries dynamically while using the Python SDK. - -.. code-block:: bash - - # This is a deprecated module and no longer used, but it shares the same name for the CLI, so we need to uninstall it first if it exists. - pip uninstall cuopt-thin-client - - # CUDA 13 - pip install --extra-index-url=https://pypi.nvidia.com 'libcuopt-cu13==26.4.*' - - # CUDA 12 - pip install --extra-index-url=https://pypi.nvidia.com 'libcuopt-cu12==26.4.*' - - -.. note:: - For development wheels which are available as nightlies, please update `--extra-index-url` to `https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/`. - -.. code-block:: bash - - # CUDA 13 - pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ \ - 'libcuopt-cu13==26.4.*' - - # CUDA 12 - pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ \ - 'libcuopt-cu12==26.4.*' - -Conda ------ - -NVIDIA cuOpt can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: - -.. code-block:: bash - - # This is a deprecated module and no longer used, but it shares the same name for the CLI, so we need to uninstall it first if it exists. - conda remove cuopt-thin-client - - # CUDA 13 - conda install -c rapidsai -c conda-forge -c nvidia libcuopt=26.04.* cuda-version=26.04.* - - # CUDA 12 - conda install -c rapidsai -c conda-forge -c nvidia libcuopt=26.04.* cuda-version=26.04.* +.. install-selector:: + :default-iface: c Please visit examples under each section to learn how to use the cuOpt C API. - -.. note:: - For development conda packages which are available as nightlies, please update `-c rapidsai` to `-c rapidsai-nightly`. diff --git a/docs/cuopt/source/cuopt-cli/quick-start.rst b/docs/cuopt/source/cuopt-cli/quick-start.rst index 527c01223b..5fdd20a3d3 100644 --- a/docs/cuopt/source/cuopt-cli/quick-start.rst +++ b/docs/cuopt/source/cuopt-cli/quick-start.rst @@ -2,7 +2,13 @@ Quickstart Guide ================= -cuopt_cli is built as part of the libcuopt package and you can follow these :doc:`../cuopt-c/quick-start` to install it. +cuopt_cli is built as part of the libcuopt package. Choose your install method below; the selector is pre-set for the CLI (it uses the same libcuopt install). Copy the command and run it in your environment. See :doc:`../install` for all interfaces and options. + +Installation +============ + +.. install-selector:: + :default-iface: cli To see all available options and their descriptions: diff --git a/docs/cuopt/source/cuopt-python/quick-start.rst b/docs/cuopt/source/cuopt-python/quick-start.rst index b9d788373d..5921e60b36 100644 --- a/docs/cuopt/source/cuopt-python/quick-start.rst +++ b/docs/cuopt/source/cuopt-python/quick-start.rst @@ -7,75 +7,10 @@ NVIDIA cuOpt provides a Python API for routing optimization and LP/QP/MILP that Installation ============ -pip ---- - -.. code-block:: bash - - # CUDA 13 - pip install --extra-index-url=https://pypi.nvidia.com 'cuopt-cu13==26.4.*' - - # CUDA 12 - pip install --extra-index-url=https://pypi.nvidia.com 'cuopt-cu12==26.4.*' - - -.. note:: - For development wheels which are available as nightlies, please update `--extra-index-url` to `https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/`. - -.. code-block:: bash - - # CUDA 13 - pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ \ - 'cuopt-cu13==26.4.*' - - # CUDA 12 - pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ \ - 'cuopt-cu12==26.4.*' - - -Conda ------ - -NVIDIA cuOpt can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: - -.. code-block:: bash - - # CUDA 13 - conda install -c rapidsai -c conda-forge -c nvidia cuopt=26.04.* cuda-version=26.04.* - - # CUDA 12 - conda install -c rapidsai -c conda-forge -c nvidia cuopt=26.04.* cuda-version=26.04.* - -.. note:: - For development conda packages which are available as nightlies, please update `-c rapidsai` to `-c rapidsai-nightly`. - - -Container ---------- - -NVIDIA cuOpt is also available as a container from Docker Hub: - -.. code-block:: bash - - docker pull nvidia/cuopt:latest-cuda12.9-py3.13 - -.. note:: - The ``latest`` tag is the latest stable release of cuOpt. If you want to use a specific version, you can use the ``-cuda12.9-py3.13`` tag. For example, to use cuOpt 25.10.0, you can use the ``25.10.0-cuda12.9-py3.13`` tag. Please refer to `cuOpt dockerhub page `_ for the list of available tags. - -.. note:: - The nightly version of cuOpt is available as ``[VERSION]a-cuda12.9-py3.13`` tag. For example, to use cuOpt 25.10.0a, you can use the ``25.10.0a-cuda12.9-py3.13`` tag. Also the cuda version and python version might change in the future. Please refer to `cuOpt dockerhub page `_ for the list of available tags. - -The container includes both the Python API and self-hosted server components. To run the container: - -.. code-block:: bash - - docker run --gpus all -it --rm nvidia/cuopt:latest-cuda12.9-py3.13 /bin/bash - -This will start an interactive session with cuOpt pre-installed and ready to use. - -.. note:: - Make sure you have the NVIDIA Container Toolkit installed on your system to enable GPU support in containers. See the `installation guide `_ for details. +Choose your install method below; the selector is pre-set for the Python API. Copy the command and run it in your environment. See :doc:`../install` for all interfaces and options. +.. install-selector:: + :default-iface: python NVIDIA Launchable ------------------- diff --git a/docs/cuopt/source/cuopt-server/quick-start.rst b/docs/cuopt/source/cuopt-server/quick-start.rst index 73288b4163..33f802fca5 100644 --- a/docs/cuopt/source/cuopt-server/quick-start.rst +++ b/docs/cuopt/source/cuopt-server/quick-start.rst @@ -5,74 +5,10 @@ Quickstart Guide Installation ============ -pip ---- +Choose your install method below; the selector is pre-set for the Server. Copy the command and run it in your environment. See :doc:`../install` for all interfaces and options. -.. code-block:: bash - - # CUDA 13 - pip install --extra-index-url=https://pypi.nvidia.com \ - 'nvidia-cuda-runtime==13.0.*' \ - 'cuopt-server-cu13==26.4.*' \ - 'cuopt-sh-client==26.04.* - - # CUDA 12 - pip install --extra-index-url=https://pypi.nvidia.com \ - 'nvidia-cuda-runtime-cu12==12.9.*' \ - 'cuopt-server-cu12==26.4.*' \ - 'cuopt-sh-client==26.04.* - -.. note:: - For development wheels which are available as nightlies, please update `--extra-index-url` to `https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/`. - -.. code-block:: bash - - # CUDA 13 - pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ \ - 'cuopt-server-cu13==26.4.*' \ - 'cuopt-sh-client==26.04.* - - # CUDA 12 - pip install --pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ \ - 'cuopt-server-cu12==26.4.*' \ - 'cuopt-sh-client==26.04.* - -Conda ------ - -cuOpt Server can be installed with Conda (via `miniforge `_ from the ``nvidia`` channel: - -.. code-block:: bash - - conda install -c rapidsai -c conda-forge -c nvidia cuopt-server=26.04.* cuopt-sh-client=26.04.* - -.. note:: - For development conda packages which are available as nightlies, please update `-c rapidsai` to `-c rapidsai-nightly`. - - -Container from Docker Hub -------------------------- - -NVIDIA cuOpt is also available as a container from Docker Hub: - -.. code-block:: bash - - docker pull nvidia/cuopt:latest-cuda12.9-py3.13 - -.. note:: - The ``latest`` tag is the latest stable release of cuOpt. If you want to use a specific version, you can use the ``-cuda12.9-py3.13`` tag. For example, to use cuOpt 25.10.0, you can use the ``25.10.0-cuda12.9-py3.13`` tag. Please refer to `cuOpt dockerhub page `_ for the list of available tags. - -The container includes both the Python API and self-hosted server components. To run the container: - -.. code-block:: bash - - docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 nvidia/cuopt:latest-cuda12.9-py3.13 - -.. note:: - The nightly version of cuOpt is available as ``[VERSION]a-cuda12.9-py3.13`` tag. For example, to use cuOpt 25.10.0a, you can use the ``25.10.0a-cuda12.9-py3.13`` tag. Also the cuda version and python version might change in the future. Please refer to `cuOpt dockerhub page `_ for the list of available tags. - -.. note:: - Make sure you have the NVIDIA Container Toolkit installed on your system to enable GPU support in containers. See the `installation guide `_ for details. +.. install-selector:: + :default-iface: server .. _container-from-nvidia-ngc: diff --git a/docs/cuopt/source/index.rst b/docs/cuopt/source/index.rst index fc51649b22..e310c974ce 100644 --- a/docs/cuopt/source/index.rst +++ b/docs/cuopt/source/index.rst @@ -8,6 +8,7 @@ NVIDIA cuOpt :name: NVIDIA cuOpt introduction.rst + install.rst release-notes system-requirements.rst diff --git a/docs/cuopt/source/install.rst b/docs/cuopt/source/install.rst new file mode 100644 index 0000000000..0b16bf606c --- /dev/null +++ b/docs/cuopt/source/install.rst @@ -0,0 +1,22 @@ +============ +Installation +============ + +Choose your interface, install method, and options below to get the exact install command. Ensure your system meets the :doc:`system-requirements` before installing. + +Install Selector +================ + +.. install-selector:: + +Quick Start Guides +================== + +If the selector does not load or you prefer step-by-step guides, use the quick-start pages for each interface: + +* **Python (cuopt)** — :doc:`cuopt-python/quick-start` +* **C (libcuopt)** — :doc:`cuopt-c/quick-start` (includes ``cuopt_cli``) +* **Server (cuopt-server)** — :doc:`cuopt-server/quick-start` +* **CLI (cuopt_cli)** — Install via the C API; see :doc:`cuopt-cli/quick-start` + +See :doc:`system-requirements` for GPU, CUDA, driver, and OS requirements.