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

    Step 1
    Verify your environment

    Let's first verify that you have a working GPU, git, and Docker. Open up Terminal, then copy and paste in the below commands:

    nvidia-smi
    git --version
    docker --version
    
    • nvidia-smi will output information about your GPU. If it doesn't, your GPU is not properly configured.
    • git --version will print something like git version 2.43.0. If you get an error saying that git is not installed, please reinstall it.
    • docker --version will print something like Docker version 28.3.3, build 980b856. If you get an error saying that Docker is not installed, please reinstall it.

    Step 2
    Installation

    Open up Terminal, then copy and paste in the below commands:

    git clone https://github.com/NVIDIA/dgx-spark-playbooks
    cd dgx-spark-playbooks/nvidia/portfolio-optimization/assets
    bash ./setup/start_playbook.sh
    

    start_playbook.sh will:

    1. pull the RAPIDS 25.10 Notebooks Docker container
    2. build all the environments needed for the playbook in the container using setup_playbook.sh
    3. start Jupyterlab

    Please keep the Terminal window open while using the playbook.

    You can access your Jupyterlab server in three ways

    1. at http://127.0.0.1:8888 if running locally on the DGX Spark.
    2. at http://<SPARK_IP>:8888 if using your DGX Spark headless over your network.
    3. by creating an SSH tunnel using ssh -L 8888:localhost:8888 username@spark-IP in Terminal and the going to http://127.0.0.1:8888 in your browser on your host machine

    Once in Jupyterlab, you'll be greeted with a directory containing cvar_basic.ipynb, and the folders cudf, cuml and cugraph.

    • cvar_basic.ipynb is the playbook notebook. You will want to open this by double clicking on the file.
    • cudf, cuml, cugraph folders contain the standard RAPIDS library example notebooks to help you continue exploring.
    • playbook contains the playbook files. The contents of this folder are read-only inside of a rootless Docker Container.

    If you want to install any of the playbook notebooks on your own system, check out the readmes within the folder that accompanies the notebook

    Step 3
    Run the notebook

    Once in jupyterlab, you have to do is run the cvar_basic.ipynb.

    Before your start running the cells in the notebook, please change the kernel to "Portfolio Optimization" as per the instructions in the notebook. Failure to do so will cause errors by the second code cell. If you started already, you will have to set it to the correct kernel, then restart the kernel, and try again.

    You can use Shift + Enter to manually run each cell at your own pace, or Run > Run All to run all the cells.

    Once you're done with exploring the cvar_basic notebook, you can explore other RAPIDS notebooks by going into the folders, selecting other notebooks, and doing the same thing.

    Step 4
    Download your work

    Since the docker container is not priviledged and cannot write back to the host system, you can use Jupyterlab to download any files you may want to keep once the docker container is shut down.

    Simply right click the file you want, in the browser, and click Download in the drop down.

    Step 5
    Cleanup

    Once you have downloaded all your work, Go back to the Terminal window where you started running the playbook.

    In the Terminal window:

    1. Type Ctrl + C
    2. Quickly either enter y and then hit Enter at the prompt or hit Ctrl + C again
    3. The Docker container will proceed to shut down

    WARNING

    This will delete ALL data that wasn't already downloaded from the Docker container. The browser window may still show cached files if it is still open.

    Step 6
    Next Steps

    Once you're comfortable with this foundational workflow, please explore these advanced portfolio optimization topics in any order at the NVIDIA AI Blueprints:

    • efficient_frontier.ipynb - Efficient Frontier Analysis

      This notebook demonstrates how to:

      • Generate the efficient frontier by solving multiple optimization problems
      • Visualize the risk-return tradeoff across different portfolio configurations
      • Compare portfolios along the efficient frontier
      • Leverage GPU acceleration to quickly compute multiple optimal portfolios
    • rebalancing_strategies.ipynb - Dynamic Portfolio Rebalancing

      This notebook introduces dynamic portfolio management techniques:

      • Time-series backtesting framework
      • Testing various rebalancing strategies (periodic, threshold-based, etc.)
      • Evaluating the impact of transaction costs on portfolio performance
      • Analyzing strategy performance over different market conditions
      • Comparing multiple rebalancing approaches
    • If you'd further learn how to formulate portfolio optimization problems using similar risk–return frameworks, check out the DLI course: Accelerating Portfolio Optimization

    Step 7
    Further Support

    For questions or issues, please visit:

    • GitHub Issues

    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