[Bug]: Failing to build mmcv from source with CUDA 12.8 + PyTorch 2.8 + RTX 5090
Checklist
- [ ] The issue has not been resolved by following the troubleshooting guide
- [ ] The issue exists on a clean installation of Fooocus
- [ ] The issue exists in the current version of Fooocus
- [x] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet
What happened?
I recently purchased an NVIDIA GeForce RTX 5090. Since this GPU requires CUDA 12.8+, I’ve installed CUDA 12.8 manually and set up my environment with the latest PyTorch nightly build (2.8.0+cu128).
However, when attempting to build mmcv from source (since there are no official wheels for this configuration yet), the compilation consistently fails—specifically at the CUDA extension stage. Has anyone successfully compiled mmcv with 5090? I
Enviroment: GPU: NVIDIA GeForce RTX 5090
CUDA: 12.8 (installed manually via .run file)
PyTorch: 2.8.0.dev20250410+cu128 (nightly build)
Python: 3.12(also tried 3.10)
GCC: 11.4
OS: Ubuntu 25.04 (Plucky)
Steps to reproduce the problem
What I did:
git clone https://github.com/open-mmlab/mmcv.git cd mmcv git checkout v2.1.0 pip install -r requirements/build.txt MMCV_WITH_OPS=1 pip install -v -e .
What should have happened?
.
What browsers do you use to access Fooocus?
No response
Where are you running Fooocus?
None
What operating system are you using?
ubuntu25.04
Console logs
...
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 2556, in _run_ninja_build
subprocess.run(
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/subprocess.py", line 573, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '4']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/yang/mmcv/setup.py", line 521, in <module>
setup(
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 186, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
dist.run_commands()
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
self.run_command(cmd)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/command/develop.py", line 35, in run
self.install_for_development()
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/command/develop.py", line 112, in install_for_development
self.run_command('build_ext')
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 99, in run
_build_ext.run(self)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run
self.build_extensions()
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 1052, in build_extensions
build_ext.build_extensions(self)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions
self._build_extensions_serial()
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial
self.build_extension(ext)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 264, in build_extension
_build_ext.build_extension(self, ext)
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 562, in build_extension
objects = self.compiler.compile(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 836, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 2209, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/yang/anaconda3/envs/univ2xCUDA128_py312/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 2573, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Additional information
Is mmcv currently compatible with CUDA 12.8 / PyTorch 2.8?
Has anyone successfully compiled mmcv with 5090? I'd greatly appreciate hearing about any working configurations or suggestions.
Thanks in advance for your help and for maintaining this excellent library!
I have the same problem. RTX 5080.
Same question with cuda 12.8 pytorch 2.7.0 python3.9 rtx 5080
Open the Fooocus\python_embeded folder Open cmd Enter the command to update
python.exe -m pip install --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
Re-execute, this is how I solved it
https://github.com/alibakhtiari2/fooocusrtx508090 use this repository which solved the entire issues ... please like! also you can download entire package from the links. thanks
Followed the instruction on Build MMCV from source, i have installed mmcv successfully.
Here are my envirment: sys.platform: win32 Python: 3.10.18 | packaged by Anaconda, Inc. | (main, Jun 5 2025, 13:08:55) [MSC v.1929 64 bit (AMD64)] CUDA available: True MUSA available: False numpy_random_seed: 2147483648 GPU 0: NVIDIA GeForce RTX 5080 Laptop GPU CUDA_HOME: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8 NVCC: Cuda compilation tools, release 12.8, V12.8.93 MSVC: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.44.35217 版 GCC: n/a PyTorch: 2.8.0+cu128 PyTorch compiling details: PyTorch built with:
- C++ Version: 201703
- MSVC 193833145
- Intel(R) oneAPI Math Kernel Library Version 2025.2-Product Build 20250620 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v3.7.1 (Git Hash 8d263e693366ef8db40acc569cc7d8edf644556d)
- OpenMP 2019
- LAPACK is enabled (usually provided by MKL)
- CPU capability usage: AVX2
- CUDA Runtime 12.8
- NVCC architecture flags: -gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_90,code=sm_90;-gencode;arch=compute_100,code=sm_100;-gencode;arch=compute_120,code=sm_120
- CuDNN 91.0.2 (built against CUDA 12.9)
- Magma 2.5.4
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, COMMIT_SHA=a1cb3cc05d46d198467bebbb6e8fba50a325d4e7, CUDA_VERSION=12.8, CUDNN_VERSION=9.10.2, CXX_COMPILER=C:/actions-runner/_work/pytorch/pytorch/pytorch/.ci/pytorch/windows/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /EHsc /Zc:__cplusplus /bigobj /FS /utf-8 -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DLIBKINETO_NOXPUPTI=ON -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE /wd4624 /wd4068 /wd4067 /wd4267 /wd4661 /wd4717 /wd4244 /wd4804 /wd4273, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, TORCH_VERSION=2.8.0, USE_CUDA=ON, USE_CUDNN=ON, USE_CUSPARSELT=OFF, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, USE_XCCL=OFF, USE_XPU=OFF,
TorchVision: 0.23.0+cu128 OpenCV: 4.12.0 MMEngine: 0.11.0rc0 MMCV: 2.2.0 MMCV Compiler: MSVC 194435217 MMCV CUDA Compiler: 12.8
i followed this video to get it working on my RTX 5080:
https://youtu.be/W0KWJxRRtAo?si=rLkV5os2fTjc0n9g
Instead of installing mmcv-full, I just cloned the MMCV repo locally and added it to sys.path.
import sys
sys.path.insert(0, r"<user path>\mmcv_1.x")
It’s a bit of a hassle, but it works.