Closed hubutui closed 3 years ago
what's your PyTorch version? Is it a cpu version of pytorch or a gpu one?
@ycxioooong I maintain python-mmcv
and python-mmcv-full
in ArchLinuxCN repo for ArchLinux. I build both cpu and gpu version of mmcv for ArchLinux. The pytorch for ArchLinux is always the latest release, for now, it's 1.7.1.
From other related issues, I feel that it may be caused by a mismatched PyTorch version (GPU/CPU, cuda version, etc)
or a mismatched torchvision
.
So I think you may first check your PyTorch version and see if cuda is available:
import torch
print(torch.__version__, torch.cuda.is_available())
It's building in a chroot env without a GPU. I have set FORCE_CUDA=1
and TORCH_CUDA_ARCH_LIST
, check the build script here, build()
function for compiling, package_python-mmcv()
for creating python-mmcv
, and package_python-mmcv-full()
for creating python-mmcv-full
.
I figure out something. It seems that when I run
FORCE_CUDA=1 \
TORCH_CUDA_ARCH_LIST="5.2;5.3;6.0;6.1;6.2;7.0;7.0+PTX;7.2;7.2+PTX;7.5;7.5+PTX;8.0;8.0+PTX;8.6;8.6+PTX" \
python setup.py build
it only runs build_ext
, not build_py
, so the pure python module is missing, then I install the package with
python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
we usually use --skip-build
because we don't wanna compile the source again. add python setup.py build_py
to build stage or remove --skip-build
might fix it.
Cool, thanks for sharing the information.
I fail to build mmcv from version 1.2.2 with cuda support. compile step:
most related log output:
Then my finnal site-packages tree looks:
nothing is installed.
check the complete build log for 1.2.2 here, and 1.2.3 here, and 1.2.4 here
Questions:
python setup.py install
not working anymore for install mmcv-full?python setup.py bdist_wheel
to build the wheel file and install it?BTW, I could create mmcv pkg without cuda using the above compile steps with no errors.