A wrapper around windows-capture that captures the screen directly into PyTorch CUDA tensors, avoiding CPU memory copies and inter-device memory transfers.
To avoid reinstalling torch, it's not listed as a dependency, but a ROCm-enabled PyTorch installation is required. It only works on x64 Windows with an AMD GPU.
Example:
from wc_rocm import WindowsCapture
capture = WindowsCapture(
monitor_index=1,
device_id=0,
reuse_output_buffer=True,
output_buffer_count=4,
)When buffer reuse is enabled, tensors may be overwritten after several frames (ring-buffer behavior), so clone tensors in your callback if you need to keep them long-term.
A wrapper around windows-capture that captures the screen directly into PyTorch CUDA tensors, avoiding CPU memory copies and inter-device memory transfers.
To avoid reinstalling torch, it's not listed as a dependency, but a CUDA-enabled PyTorch installation is required. It only works on x64 Windows with an NVIDIA GPU.
WindowsCapture now accepts:
reuse_output_buffer(default:False)output_buffer_count(default:3)
Example:
from wc_cuda import WindowsCapture
capture = WindowsCapture(
monitor_index=1,
device_id=0,
reuse_output_buffer=True,
output_buffer_count=4,
)When buffer reuse is enabled, tensors may be overwritten after several frames (ring-buffer behavior), so clone tensors in your callback if you need to keep them long-term.
A wrapper around windows-capture that captures the screen directly into PyTorch XPU tensors on Intel GPUs, avoiding CPU memory copies and inter-device memory transfers.
Requires a PyTorch XPU build (pip install torch --extra-index-url https://download.pytorch.org/whl/xpu). Only works on x64 Windows with Intel Arc or Intel Iris Xe graphics.
from wc_xpu import WindowsCapture
capture = WindowsCapture(
monitor_index=1,
reuse_output_buffer=True,
output_buffer_count=4,
)When buffer reuse is enabled, tensors may be overwritten after several frames (ring-buffer behavior), so clone tensors in your callback if you need to keep them long-term.
This branch carries the capture extensions validated by Desktop2Stereo:
- optional source cursor capture (
cursor_capture) - WGC session-level window exclusion with configuration iteration tracking
- HIP/D3D11 adapter LUID selection and GPU-side fence backpressure
- bounded GPU-resident output pools (
output_buffer_count) - optional transfer pacing without changing latest-frame queue semantics
- D3D11/CUDA shared-texture cache keyed by texture pointer
- global
SetWindowDisplayAffinityfallback when session exclusion is unavailable
The vendored windows_capture_exclusion crate supplies the WGC exclusion and
configuration-iteration interfaces used by the GPU wrappers.
This was written by gemini-cli and Claude Code. Originally written by NiiightmareXD windows-capture-python and forked from Nagadomi wc_cuda, then further optimized by Claude Code.