Make sure that your compilation CUDA version and runtime CUDA version match. You can check the supported CUDA version for precompiled packages on the [PyTorch website](https://pytorch.org/). If you build PyTorch from source instead of installing the prebuilt package, you can use more CUDA versions such as 9.0.
It is recommended to install MMRazor with [MIM](https://github.com/open-mmlab/mim), which automatically handles the dependencies of OpenMMLab projects, including mmcv and other python packages.
Please replace `{cu_version}` and `{torch_version}` in the url to your desired one. For example, to install the latest `mmcv` with `CUDA 10.2` and `PyTorch 1.10.0`, use the following command:
MMRazor can easily collaborate with other OpenMMLab libraries. MMRazor requires the use of other libraries for different tasks. For example, `MMClassification` is required for image classification tasks, `MMDetection` for object detection, and `MMSegmentation` for semantic segmentation.
We provide the installation of the above three libraries using `MIM`.
```bash
pip install openmim
# mmcv is required for all libraries
mim install 'mmcv>=2.0.0rc1'
# install mmcls
mim install 'mmcls>=1.0.0rc0'
# install mmdet
mim install 'mmdet>=3.0.0rc0'
# install mmseg
mim install 'mmseg>=1.0.0rc0'
```
```{note}
Not all of above libraries are required by MMRazor. Please install according to your requirements.