You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to set up the UniAD environment using PyTorch 2.0.1 and CUDA 11.8 just as installation document. I have encountered a circular dependency issue regarding mmcv-full and mmdet3d.
Current Environment:
Python: 3.9
PyTorch: 2.0.1
CUDA: 11.8
The Problem:
There is a conflict between the requirements for PyTorch 2.0 and the requirements for mmdet3d==1.0.0rc6 (which is required by UniAD).
Scenario A (Follow UniAD requirements):
I try to install mmcv-full==1.6.1 (as required by mmdet3d). Result: Since there are no pre-compiled wheels for mmcv-full 1.6.1 on PyTorch 2.0 + CUDA 11.8, the installation fails to build CUDA extensions. Error: ModuleNotFoundError: No module named 'mmcv._ext'
Scenario B (Support PyTorch 2.0):
I install mmcv-full==1.7.2 (compatible with PyTorch 2.0). Result: mmcv._ext loads correctly, but mmdet3d crashes because it strictly asserts mmcv_full < 1.7.0. Error: Version incompatibility assertion in mmdet3d.
Is there a recommended workaround to run UniAD with PyTorch 2.0? Or is strict downgrade to PyTorch 1.12.x the only supported path currently?
Key cause: pip uses an isolated build environment by default, so the build process cannot see the torch and cuda installed in your environment. Use --no-build-isolation to force building in the current env and set MMCV_WITH_OPS=1 to force ops compilation.
Prerequisites
PyTorch installed and matched to CUDA (e.g., torch 2.0.1+cu118).
System CUDA toolkit with nvcc installed (e.g., CUDA 11.8).
Use python -m pip to ensure pip runs in the active environment.
Install steps
# Set CUDA (adjust path if needed)
export CUDA_HOME=/usr/local/cuda-11.8
export PATH=$CUDA_HOME/bin:$PATH
# Uninstall existing mmcv packages
python -m pip uninstall -y mmcv mmcv-full
# Build in current env with ops enabled (disable build isolation)
MMCV_WITH_OPS=1 python -m pip install --no-build-isolation --no-cache-dir mmcv-full==1.6.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0.0/index.html -v
Activity
kmsngh commentedon Nov 25, 2025
I built mmcv-full==1.6.0 from source with pytorch 2. It worked
OuchDanny commentedon Nov 25, 2025
Key cause: pip uses an isolated build environment by default, so the build process cannot see the
torchandcudainstalled in your environment. Use--no-build-isolationto force building in the current env and setMMCV_WITH_OPS=1to force ops compilation.Prerequisites
python -m pipto ensure pip runs in the active environment.Install steps
Verify
原因:pip 默认使用隔离构建环境,导致构建时看不到你环境里的 torch和cuda。用
--no-build-isolation强制在当前 env 构建,且设置MMCV_WITH_OPS=1强制编译 ops。