Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

NameError: name '_C' is not defined

Open g558800 opened this issue 1 year ago • 8 comments

May I ask if this repo requires the installation of VC++buildtools?

g558800 avatar Apr 19 '23 12:04 g558800

This is because it need CUDA Runtime to compile GroundingDINO, You can set CUDA_HOME before you install this project as:

export CUDA_HOME=/path/to/cuda-11.3/

an example

rentainhe avatar Apr 19 '23 13:04 rentainhe

May I use the torch-2.0.0+cu118 as the CUDA_HOME?It is include cuda toolkit 118?

g558800 avatar Apr 19 '23 13:04 g558800

Having the same issue. Did anyone resolve it?

souvik0306 avatar Apr 19 '23 15:04 souvik0306

May I use the torch-2.0.0+cu118 as the CUDA_HOME?It is include cuda toolkit 118?

When you build custom cuda extension that is _C file , it uses local cuda toolkit, hence you need to install cuda_toolkit 11.8 in your system , and then set CUDA_HOME to the location where it's installed , along with that also set up the the LD_LIBRARY https://forums.developer.nvidia.com/t/path-ld-library-path/48080

TestPrab avatar Apr 20 '23 04:04 TestPrab

Can I install the latest cudatoolkit 12.1 directly, even if I'm using cu118?

g558800 avatar Apr 20 '23 07:04 g558800

No, when building custom cuda extension local cuda toolkit should match to the pytorch's cuda support version , hence you need to install cuda 11.8 version
https://developer.nvidia.com/cuda-11-8-0-download-archive

TestPrab avatar Apr 20 '23 07:04 TestPrab

By the way,I have other repo using cu117 etc, do I need to install more than one cudatoolkit 11.7 in addition?can I install several versions of cudatoolkit at the same time?

g558800 avatar Apr 20 '23 07:04 g558800

Not sure if you can several cuda versions or not, but yess the cuda version in local must match your pytorch version only for the cases where you build custom cuda extension , else no need.

TestPrab avatar Apr 20 '23 07:04 TestPrab