Skip to content

Instantly share code, notes, and snippets.

@secemp9
Last active February 13, 2025 13:22
Show Gist options
  • Save secemp9/a42f98e4497d56291353f16076b0c9da to your computer and use it in GitHub Desktop.
Save secemp9/a42f98e4497d56291353f16076b0c9da to your computer and use it in GitHub Desktop.
step to install darknet on 22.04
sudo apt-get update
sudo apt-get install -y build-essential git cuda-libraries-dev-12-8 libopencv-dev gpg wget
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null

echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ <distro> main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null

sudo apt-get update
sudo apt-get install gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
pip install cmake

Visit the NVIDIA CUDA Toolkit Download page.

https://developer.nvidia.com/cuda-downloads

Select your operating system (Linux), architecture (x86_64), distribution (Ubuntu), and version (22.04).

Follow the provided instructions to download and install the latest CUDA toolkit.

Set Up Environment Variables: After installation, ensure that your environment variables are correctly configured:

echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/hank-ai/darknet.git
cd darknet
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc) package
sudo dpkg -i darknet-*.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment