Skip to content

Add PyTorch 2.x compatibility and modern GPU support (CUDA 12.8, RTX 50 series)#101

Open
chansoopark98 wants to merge 2 commits intoprinceton-vl:mainfrom
chansoopark98:main
Open

Add PyTorch 2.x compatibility and modern GPU support (CUDA 12.8, RTX 50 series)#101
chansoopark98 wants to merge 2 commits intoprinceton-vl:mainfrom
chansoopark98:main

Conversation

@chansoopark98
Copy link
Copy Markdown

@chansoopark98 chansoopark98 commented Jan 5, 2026

Summary

This PR adds support for modern NVIDIA GPUs (RTX 40/50 series) with CUDA 12.8 and PyTorch 2.8.0.

Changes

1. PyTorch 2.x API Compatibility

Fixed deprecated .type() calls that cause build failures with PyTorch 2.x:

  • dpvo/altcorr/correlation_kernel.cu - 4 fixes
  • dpvo/lietorch/src/lietorch_gpu.cu - 19 fixes
  • dpvo/lietorch/src/lietorch_cpu.cpp - 19 fixes
  • dpvo/lietorch/include/dispatch.h - Updated macro

Before (PyTorch 1.x):
AT_DISPATCH_FLOATING_TYPES(tensor.type(), "kernel_name", ([&] { ... }));

After (PyTorch 2.x):
AT_DISPATCH_FLOATING_TYPES(tensor.scalar_type(), "kernel_name", ([&] { ... }));

2. DPViewer Build Fixes

DPViewer/CMakeLists.txt:

  • Fixed Python detection for conda environments
  • Added C++11 ABI compatibility flag to match PyTorch 2.8.0

DPViewer/setup.py:

  • Added explicit Python executable paths for CMake

3. Installation Documentation

Added comprehensive INSTALL.md with:

  • Step-by-step installation instructions
  • CUDA architecture reference table (RTX 20/30/40/50 series)
  • Explanation of --no-build-isolation requirement
  • Detailed C++ ABI compatibility guide
  • Troubleshooting for common errors

Motivation

The original DPVO was built for PyTorch 1.x and older NVIDIA GPUs. This PR enables:

  1. PyTorch 2.x support - PyTorch 2.x deprecated the .type() method
  2. Modern GPU support - RTX 40 series (sm_89) and RTX 50 series (sm_120)
  3. CUDA 12.x support - Required for latest GPUs
  4. Python 3.12 support - Latest Python version

Testing

Tested on:

  • GPU: NVIDIA RTX 5090 (Blackwell, compute capability 12.0)
  • CUDA: 12.8
  • PyTorch: 2.8.0
  • Python: 3.12

Verified:

  • DPVO imports successfully
  • CUDA extensions load correctly
  • DPViewer visualization works
  • Demo script runs on sample data

Breaking Changes

None. All changes are backward compatible.

(Installation Guide)

INSTALL.md

Adds a detailed analysis report for DPVO (Deep Patch Visual Odometry), covering its architecture, algorithms, and performance.

Also includes a comprehensive installation guide, addressing dependencies, build processes, and troubleshooting for modern NVIDIA GPUs. The guide emphasizes ABI compatibility for Pangolin and provides solutions for common CUDA and CMake errors.
@Lantianyou
Copy link
Copy Markdown

Modernize this project would be tremendously helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants