360 Secure SkillHub
360 安全技能中心

VMamba Env Doctor

一份 VMamba 环境搭建与排错指南:给出已验证的 Python 3.10、PyTorch 2.1.0、CUDA 11.8、gcc-11 及 OpenMMLab 组件版本组合,并提供创建 conda 环境、安装依赖、编译 selective_scan 的分步命令,覆盖 nvcc/gcc 版本、libc10.so、No module named 'torch'、NumPy/OpenCV 冲突等常…

分类:开发
jiangkaiqi2005
jiangkaiqi2005
热度 24.41
最近更新 2026-05-11 17:42:48

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add jiangkaiqi2005/vmamba-env-doctor
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
vmamba-env-doctor
description
Guide for setting up a stable VMamba environment and resolving common CUDA, PyTorch, MMCV, and compilation errors. Use when users encounter issues like "unsupported GNU version", "libc10.so not found", "No module named 'torch' during pip install", or NumPy/OpenCV version conflicts.

VMamba Environment Doctor

This skill provides a step-by-step guide to set up a stable, verified environment for VMamba, along with solutions to the most common setup errors.

When to Use This Skill

  • User asks for help installing VMamba or its dependencies (mmcv, mmsegmentation, selective_scan).
  • User reports a compilation error with nvcc or gcc.
  • User sees ImportError: libc10.so: cannot open shared object file.
  • User encounters ModuleNotFoundError: No module named 'torch' when running pip install ..
  • User faces conflicts between NumPy 2.x and OpenCV or PyTorch.

Verified Stable Environment

Use the following combination to avoid most compatibility issues:

  • Python: 3.10
  • PyTorch: 2.1.0
  • CUDA: 11.8
  • gcc/g++: 11
  • mmengine: 0.10.1
  • mmcv: 2.1.0
  • mmsegmentation: 1.2.2
  • mmdet: 3.3.0
  • mmpretrain: 1.2.0
  • numpy: 1.26.4
  • opencv-python-headless: 4.10.0.84

Step-by-Step Setup Instructions

Provide these commands to the user to create a clean environment:

# 1. Create and activate conda environment
conda create -n vmamba python=3.10 -y
conda activate vmamba

# 2. Install PyTorch 2.1.0 with CUDA 11.8
conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=11.8 -c pytorch -c nvidia -y

# 3. Fix MKL symbol error (iJIT_NotifyEvent)
conda install "mkl<2024.1" "intel-openmp<2024.1" -c conda-forge -y

# 4. Verify PyTorch installation
python -c "import torch; print(torch.__version__); print(torch.cuda.is_available()); print(torch.version.cuda)"

# 5. Install OpenMMLab packages
python -m pip install --upgrade pip
python -m pip install setuptools==81.0.0 wheel
python -m pip install -U openmim
mim install mmengine==0.10.1
mim install mmcv==2.1.0
python -m pip install mmsegmentation==1.2.2 mmdet==3.3.0 mmpretrain==1.2.0

# 6. Fix NumPy and OpenCV compatibility
python -m pip install numpy==1.26.4
python -m pip uninstall -y opencv-python opencv-python-headless
python -m pip install --no-cache-dir opencv-python-headless==4.10.0.84

# 7. Compile selective_scan with gcc-11
# (Ensure gcc-11 and g++-11 are installed: sudo apt install gcc-11 g++-11)
export CC=gcc-11
export CXX=g++-11
cd kernels/selective_scan
pip install . --no-build-isolation

# 8. Verify selective_scan import
python -c "import torch; import selective_scan_cuda_oflex; print('selective_scan OK')"