GroundingDINO
GroundingDINO copied to clipboard
Repository setup issues. Ubuntu 22.04, CUDA-12.0
Information about system
- Ubuntu 22.04
- gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
- g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Steps made:
-
Remove current nvidia drivers and CUDA (source)
sudo apt-get purge nvidia* sudo apt-get autoremove sudo apt-get autoclean sudo rm -rf /usr/local/cuda*
-
Upgrade and update
sudo apt update && sudo apt upgrade
-
Installed Ubuntu drivers (source)
sudo ubuntu-drivers autoinstall
-
Installed nvidia-drivers (version according to version of example notebook)
sudo apt install nvidia-driver-525
-
Rebooted
sudo reboot
-
Checked nvidia drivers installation
nvidia-smi
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+
-
Installed CUDA 12.0 version (again according to notebook CUDA version) (additional install, because /usr/local/ contained no cuda folder) (source)
wget https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_525.60.13_linux.run
sudo sh cuda_12.0.0_525.60.13_linux.run
In install wizard, deselected driver installation -
Checked system paths
echo $PATH
contains: /usr/local/cuda/binecho $LD_LIBRARY_PATH
contains: /usr/local/cuda/lib64 -
Set $CUDA_HOME path (according to GroundingDINO repository)
echo 'export CUDA_HOME=/usr/local/cuda' >> ~/.bashrc
source ~/.bashrc
echo $CUDA_HOME
path is set (echo $CUDA_HOME command output): /usr/local/cuda
Further steps according to repository installation steps. Made some alteration according to other issues of repository
-
Pull GroundingDINO repository
git clone https://github.com/IDEA-Research/GroundingDINO.git
-
Open via PyCharm and create interpreter (python3.9) and virtual env using UI
-
Change working directory
cd GroundingDINO/
-
Upgrade pip (22.3.1 -> 23.2.1)
pip install --upgrade pip
-
Install requirements
pip install -r requirements.txt
-
Package build
pip install -e .
From here getting error:
RuntimeError: The detected CUDA version (12.0) mismatches the version that was used to compile PyTorch (11.7). Please make sure to use the same CUDA versions.
Also, tryied similar setup with CUDA-11.7 (nvidia drivers 515). No CUDA mismatch errors, but got different error
Questions
- Can I run project with CUDA-12.0, as in notebool example?
- Perhaps, there are device setup mistakes in provided steps?
Thanks in advance!
I think maybe your GCC version is too high for Grounding-DINO, you can try GCC 9.4
I think maybe your GCC version is too high for Grounding-DINO, you can try
GCC 9.4
how to install the 9.4 GCC? pip?or sudo apt-get install.whta is the shell code
Information about system
- Ubuntu 22.04
- gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
- g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Steps made:
- Remove current nvidia drivers and CUDA (source)
sudo apt-get purge nvidia* sudo apt-get autoremove sudo apt-get autoclean sudo rm -rf /usr/local/cuda*
- Upgrade and update
sudo apt update && sudo apt upgrade
- Installed Ubuntu drivers (source)
sudo ubuntu-drivers autoinstall
- Installed nvidia-drivers (version according to version of example notebook)
sudo apt install nvidia-driver-525
- Rebooted
sudo reboot
- Checked nvidia drivers installation
nvidia-smi
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+
- Installed CUDA 12.0 version (again according to notebook CUDA version) (additional install, because /usr/local/ contained no cuda folder) (source)
wget https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_525.60.13_linux.run
sudo sh cuda_12.0.0_525.60.13_linux.run
In install wizard, deselected driver installation- Checked system paths
echo $PATH
contains: /usr/local/cuda/binecho $LD_LIBRARY_PATH
contains: /usr/local/cuda/lib64- Set $CUDA_HOME path (according to GroundingDINO repository)
echo 'export CUDA_HOME=/usr/local/cuda' >> ~/.bashrc
source ~/.bashrc
echo $CUDA_HOME
path is set (echo $CUDA_HOME command output): /usr/local/cudaFurther steps according to repository installation steps. Made some alteration according to other issues of repository
- Pull GroundingDINO repository
git clone https://github.com/IDEA-Research/GroundingDINO.git
- Open via PyCharm and create interpreter (python3.9) and virtual env using UI
- Change working directory
cd GroundingDINO/
- Upgrade pip (22.3.1 -> 23.2.1)
pip install --upgrade pip
- Install requirements
pip install -r requirements.txt
- Package build
pip install -e .
From here getting error:
RuntimeError: The detected CUDA version (12.0) mismatches the version that was used to compile PyTorch (11.7). Please make sure to use the same CUDA versions.
Also, tryied similar setup with CUDA-11.7 (nvidia drivers 515). No CUDA mismatch errors, but got different error
Questions
- Can I run project with CUDA-12.0, as in notebool example?
- Perhaps, there are device setup mistakes in provided steps?
Thanks in advance!
do you selvo this problem????
Downgrading to gcc-9
, g++-9
, and cuda-11.3
works for me.
@ygtxr1997 mine is ubuntu 22.04 and gcc , g++ is 9, cuda is cuda-11.3,but not woked. (inpaint) root@vm-14a-28gr8:~/Grounded-Segment-Anything-main# g++ --version g++ (Ubuntu 9.5.0-1ubuntu1~22.04) 9.5.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(inpaint) root@vm-14a-28gr8:~/Grounded-Segment-Anything-main# dpkg -l cuda-11-3 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii cuda-11-3 11.3.1-1 amd64 CUDA 11.3 meta-package (inpaint) root@vm-14a-28gr8:~/Grounded-Segment-Anything-main# gcc --version gcc (Ubuntu 9.5.0-1ubuntu1~22.04) 9.5.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
and error message: The detected CUDA version (11.3) mismatches the version that was used to compile PyTorch (12.1). Please make sure to use the same CUDA versions.
Is there any workaround except changing cuda-12.0 to cuda-12.1?