GroundingDINO icon indicating copy to clipboard operation
GroundingDINO copied to clipboard

Repository setup issues. Ubuntu 22.04, CUDA-12.0

Open PelkiuBebras opened this issue 1 year ago • 6 comments

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:

  1. 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*

  2. Upgrade and update sudo apt update && sudo apt upgrade

  3. Installed Ubuntu drivers (source) sudo ubuntu-drivers autoinstall

  4. Installed nvidia-drivers (version according to version of example notebook) sudo apt install nvidia-driver-525

  5. Rebooted sudo reboot

  6. Checked nvidia drivers installation nvidia-smi

+-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+

  1. 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

  2. Checked system paths echo $PATH contains: /usr/local/cuda/bin echo $LD_LIBRARY_PATH contains: /usr/local/cuda/lib64

  3. 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

  1. Pull GroundingDINO repository git clone https://github.com/IDEA-Research/GroundingDINO.git

  2. Open via PyCharm and create interpreter (python3.9) and virtual env using UI

  3. Change working directory cd GroundingDINO/

  4. Upgrade pip (22.3.1 -> 23.2.1) pip install --upgrade pip

  5. Install requirements pip install -r requirements.txt

  6. 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!

PelkiuBebras avatar Aug 11 '23 05:08 PelkiuBebras

I think maybe your GCC version is too high for Grounding-DINO, you can try GCC 9.4

rentainhe avatar Aug 14 '23 02:08 rentainhe

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

sssssshf avatar Sep 11 '23 07:09 sssssshf

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:

  1. 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*
  2. Upgrade and update sudo apt update && sudo apt upgrade
  3. Installed Ubuntu drivers (source) sudo ubuntu-drivers autoinstall
  4. Installed nvidia-drivers (version according to version of example notebook) sudo apt install nvidia-driver-525
  5. Rebooted sudo reboot
  6. Checked nvidia drivers installation nvidia-smi

+-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+

  1. 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
  2. Checked system paths echo $PATH contains: /usr/local/cuda/bin echo $LD_LIBRARY_PATH contains: /usr/local/cuda/lib64
  3. 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

  1. Pull GroundingDINO repository git clone https://github.com/IDEA-Research/GroundingDINO.git
  2. Open via PyCharm and create interpreter (python3.9) and virtual env using UI
  3. Change working directory cd GroundingDINO/
  4. Upgrade pip (22.3.1 -> 23.2.1) pip install --upgrade pip
  5. Install requirements pip install -r requirements.txt
  6. 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????

sssssshf avatar Sep 11 '23 07:09 sssssshf

Downgrading to gcc-9, g++-9, and cuda-11.3 works for me.

ygtxr1997 avatar Oct 17 '23 17:10 ygtxr1997

@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.

flyonok avatar Jan 21 '24 14:01 flyonok

Is there any workaround except changing cuda-12.0 to cuda-12.1?

xiwen1 avatar Feb 23 '24 10:02 xiwen1