-
Notifications
You must be signed in to change notification settings - Fork 394
Regarding installing Grounded-SAM2 on 5090: ms_deformable_im2col_cuda: no kernel image is available for execution on the device #114
Description
It took me almost two days to figure out that pip install --no-build-isolation -e grounding_dino is not ideal for a 5090 GPU. I kept running into the error:
ms_deformable_im2col_cuda: no kernel image is available for execution on the device
Even though I was using PyTorch >= 2.7.0 in a fresh conda environment and have successfully trained other models on the 5090, so PyTorch or CUDA versions were not the problem.
The solution for me was to avoid --no-build-isolation and simply run:
pip install -e grounding_dino
I don’t fully understand what --no-build-isolation does under the hood, but in my case it caused issues with compiling the CUDA kernels.
Some context for why this happens:
--no-build-isolation disables the PEP 517 build isolation, meaning that the package is built using the environment you are currently in rather than a clean temporary environment. Normally, this is fine, but for very new GPUs like the RTX 5090, the CUDA kernels need to be compiled specifically for your GPU architecture (sm_120). If the build isolation is disabled, the setup may pick up cached compiler flags or prebuilt objects from your environment that don’t include the right compute capability, resulting in errors like “no kernel image is available for execution on the device.”
By letting pip install -e run with build isolation (the default), the setup can correctly detect your CUDA toolkit and GPU architecture, and compile the necessary kernels from scratch. That’s why removing --no-build-isolation fixed the issue for me.