Skip to main content
NVIDIA
Explore
Models
Skills
Blueprints
GPUs
Docs
Help Center
Getting Started
  1. Create and verify your account to unlock full access to NVIDIA NIM APIs.
ResourcesDeveloper ForumsContact Support
FAQs
  • View All Playbooks
    View All Playbooks

    onboarding

    • Set Up Local Network Access
    • Open WebUI with Ollama

    data science

    • Single-cell RNA Sequencing
    • Portfolio Optimization
    • CUDA-X Data Science
    • Build Knowledge Graphs with txt2kg
    • Optimized JAX

    tools

    • DGX Dashboard
    • RAG Application in AI Workbench
    • Set up Tailscale on Your Spark
    • VS Code
    • Connect Three DGX Spark in a Ring Topology
    • Connect Multiple DGX Spark through a Switch

    fine tuning

    • FLUX.1 Dreambooth LoRA Fine-tuning
    • LLaMA Factory
    • Fine-tune with NeMo
    • Fine-tune with Pytorch
    • Unsloth on DGX Spark

    use case

    • Run Hermes Agent with a Local LLM
    • cuTile Kernels
    • CLI Coding Agent
    • Run NemoClaw with a Local LLM
    • 🦞 Set Up Example NemoClaw Agents 🦞
    • Live VLM WebUI
    • Install and Use Isaac Sim and Isaac Lab
    • Vibe Coding in VS Code
    • Build and Deploy a Multi-Agent Chatbot
    • Connect Two Sparks
    • NCCL for Multiple Sparks
    • Build a Video Search and Summarization (VSS) Agent
    • Spark & Reachy Photo Booth
    • Secure AI Agents with OpenShell
    • Run OpenClaw with a Local LLM

    inference

    • Generate Images and Videos with ComfyUI
    • Serve LLMs with vLLM
    • Speculative Decoding
    • Run models with llama.cpp on DGX Spark
    • Nemotron Model Family on DGX Spark
    • Serve LLMs with SGLang
    • TRT LLM for Inference
    • Quantize Models to NVFP4 with NVIDIA Model Optimizer
    • Multi-modal Inference
    • NIM on Spark
    • LM Studio on DGX Spark

    Portfolio Optimization

    20 MIN

    GPU-Accelerated portfolio optimization using cuOpt and cuML

    • Data Science
    • Financial Services
    • RAPIDS
    View on GitHub
    OverviewOverviewInstructionsInstructionsTroubleshootingTroubleshooting

    Basic idea

    This playbook demonstrates an end-to-end GPU-accelerated workflow using NVIDIA cuOpt and NVIDIA cuML to solve large-scale portfolio optimization problems, using the Mean-CVaR (Conditional Value-at-Risk) model, in near real-time.

    Portfolio Optimization (PO) involves solving high-dimensional, non-linear numerical optimization problems to balance risk and return. Modern portfolios often contain thousands of assets, making traditional CPU-based solvers too slow for advanced workflows. By moving the computational heavy lifting to the GPU, this solution dramatically reduces computation time.

    What you'll accomplish

    You will implement a pipeline that provides tools for performance evaluation, strategy backtesting, benchmarking, and visualization. The workflow includes:

    • GPU-Accelerated Optimization: Leveraging NVIDIA cuOpt LP/MILP solvers
    • Data-Driven Risk Modeling: Implementing CVaR as a scenario-based risk measure that models tail risks without making assumptions about asset return distributions.
    • Scenario Generation: Using GPU-accelerated Kernel Density Estimation (KDE) via NVIDIA cuML to model return distributions.
    • Real-World Constraint Management: Implementing constraints including concentration limits, leverage constraints, turnover limits, and cardinality constraints.
    • Comprehensive Backtesting: Evaluating portfolio performance with specific tools for testing rebalancing strategies.

    What to know before starting

    • Required Skills (you'll get it):

      • Basic with Terminal and Linux command line
      • Basic understanding of Docker containers
      • Basic knowledge of using Jupyter Notebooks and Jupyter Lab
      • Basic Python knowledge
      • Basic knowledge of data science and machine learning concepts
      • Basic knowledge of what the stock market and stocks are
    • Optional Skills (you'll enjoy it):

      • Background in Financial Services, especially in quantatitve finance and portfolio management
      • Moderate knowledge programming algorithms and strategies, in python, using machine learning concepts
    • Terms to know:

      • CVaR vs. Mean-Variance: Unlike traditional mean-variance models, this workflow uses Conditional Value-at-Risk (CVaR) to capture nuances of risk, specifically tail risk or scenario-specific stresses.
      • Linear Programming: CVaR reformulates the risk-return tradeoff as a scenario-based linear program where the problem size scales with the number of scenarios, which is why GPU acceleration is critical.
      • Benchmarking: The pipeline includes built-in tools to streamline the benchmarking process against standard CPU-based libraries to validate performance gains.

    Prerequisites

    Hardware Requirements:

    • NVIDIA Grace Blackwell GB10 Superchip System (DGX Spark)
    • Minimum 40GB Unified memory free for docker container and GPU accelerated data processing
    • At least 30GB available storage space for docker container and data files
    • High speed internet connection recommended

    Software Requirements:

    • NVIDIA DGX OS with working NVIDIA and CUDA drivers
    • Docker
    • Git

    Ancillary files

    All required assets can be found in the Portfolio Optimization repository. In the running playbook, they will all be found under the playbook folder.

    • cvar_basic.ipynb - Main playbook notebook.
    • /setup/README.md - Quick Start Guide to the Playbook Environment.
    • /setup/start_playbook.sh - Script to start the install of the playbook in a Docker container
    • /setup/setup_playbook.sh - Configures the Docker container before user enters jupyterlab environment
    • /setup/pyproject.toml - used as a lists of libraries that commands in setup_playbook will install into the playbook environment
    • cuDF, cuML, and cuGraph folders - more example notebooks to continue your GPU Accelerated Data Science Journey. These will be part of the Docker Container when you start it.

    Time & risk

    • Estimated Time ~20 minutes for first run
      • Total Notebook Processing Time: Approximately 7 minutes for the full pipeline.
    • Risks:
      • Minimal, as this is run in a Docker container.
    • Rollback: Stop the Docker container and remove the cloned repository to fully remove the installation.

    • Last Updated: 01/21/2026

      • Update git clone command with the correct project path.

    Resources

    • DGX Spark Documentation
    • DGX Spark Forum
    • DGX Spark User Performance Guide
    Terms of Use
    Privacy Policy
    Your Privacy Choices
    Contact

    Copyright © 2026 NVIDIA Corporation