#3335·mmcv

[Docs] How I Built MMCV 2.1.0 on Windows 11 for RTX 5060 Ti (CUDA 12.8)

Author: semihhdemirelCreated Jul 30, 2026Updated Jul 30, 2026

The doc issue

Build MMCV 2.1.0 from Source on Windows (RTX 50 Series / CUDA 12.8)

This guide documents how I successfully built MMCV from source on Windows for an RTX 5060 Ti.

Environment

Component Version
OS Windows 11
Python 3.10.20
CUDA Toolkit 12.8
PyTorch 2.7.1+cu128
GPU NVIDIA RTX 5060 Ti 16GB
Visual Studio Build Tools 2022
MSVC v142 (14.29)
Ninja latest

1. Install Visual Studio Build Tools

Make sure these are installed:

  • MSVC v142 - VS 2019 C++ x64/x86 build tools
  • Windows 10/11 SDK
  • C++ CMake tools
  • Ninja

2. Clone MMCV

bash
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv

git checkout v2.1.0

# 3. Install Python dependencies

```bash
pip install -r requirements/runtime.txt
pip install -r requirements/build.txt

pip install "setuptools<81" wheel

4. Open the correct Developer Command Prompt

Use the x64 Native Tools Command Prompt or run:

cmd
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.29

Verify:

cmd
cl

Expected:

Microsoft (R) C/C++ Optimizing Compiler Version 19.29.xxxxx

5. Activate your conda environment

cmd
conda activate mmdetection

6. Set environment variables

Command Prompt:

cmd
set CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8
set MMCV_WITH_OPS=1
set MAX_JOBS=4
set DISTUTILS_USE_SDK=1
set TORCH_CUDA_ARCH_LIST=12.0

PowerShell equivalent:

powershell
$env:CUDA_HOME="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8"
$env:MMCV_WITH_OPS="1"
$env:MAX_JOBS="4"
$env:DISTUTILS_USE_SDK="1"
$env:TORCH_CUDA_ARCH_LIST="12.0"

7. Build MMCV

bash
pip install . -v --no-build-isolation

The build takes several minutes.


8. Verify installation

python
import mmcv
import mmcv._ext

print(mmcv.__version__)

Suggest a potential alternative/fix

No response