Christopher Anabo
Christopher Anabo
Senior Tech Lead
Christopher Anabo

Notes

Python Setup

Python Setup

Installing NVIDIA Driver

  •     sudo apt-get update
  •     ubuntu-drivers devices
  •     sudo apt install nvidia-driver-535
  • nvidia-smi
  • nvcc --version

Installing CUDA

  •     uname -m
  •  mkdir cuda
  •    cd cuda
  •    wget  https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
  •    sudo sh cuda_11.8.0_520.61.05_linux.run --toolkit  --override
  •    export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
  •    export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • source ~/.bashrc
  •    nvcc -V

Add to bashrc

 

Installing CUDNN ubuntu2004

  • wget https://developer.download.nvidia.com/compute/cudnn/secure/8.6.0/local_installers/11.8/cudnn-local-repo-ubuntu2004-8.6.0.163_1.0-1_amd64.deb?UpSAo3hbWDJfwNH4Xdd_N0GqBiDLjLA5vNcIgaoCtMirzK8KjfbN9FC64fT2Gz-cva0Q3wxPpu5CLH3wDe4p-jCYUSIBByfNh2iTchEIECUDOC85iKRJxCqsSq6YeyNSl8qI_2Iy_xHmJ1oX4HEMxJN45r2MQZ2fV-NfzD1-ftGSol6dysU8EyWA40GVktoSXImITKiGwyB-oU_BsmjbrDqPRRk6&t=eyJscyI6InJlZiIsImxzZCI6IlJFRi13d3cuZW5hYmxlZ2Vlay5jb20vIn0=
  • sudo dpkg -i cudnn-local-repo-ubuntu2004-8.6.0.163_1.0-1_amd64.deb
  • sudo cp /var/cudnn-local-repo-ubuntu2004-8.6.0.163/cudnn-local-B0FE0A41-keyring.gpg /usr/share/keyrings/

 

  •    sudo apt-get update
  •    sudo apt-get install libcudnn8=8.6.0.163-1+cuda11.8
  •    sudo apt-get install libcudnn8-dev=8.6.0.163-1+cuda11.8
  • sudo apt-get install libcudnn8-samples=8.6.0.163-1+cuda11.8

 

Installing AI-Server
   34  mkdir ai-server
   35  cd ai-server/
   36  git
   37  sudo apt install git
   38  git clone https://github.com/codeproject/CodeProject.AI-Server.git
   39  cd src
   40  ls
   41  cd CodeProject.AI-Server/
   42  cd src/

 
   59  sudo apt-get update &&   sudo apt-get install -y dotnet-sdk-8.0
   60  sudo apt-get install -y dotnet-sdk
   61  wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
   62  sudo dpkg -i packages-microsoft-prod.deb
   63  rm packages-microsoft-prod.deb
   64  sudo apt-get update &&   sudo apt-get install -y dotnet-sdk-8.0
   65  sudo bash setup.sh



   78  sudo chown -R $USER:$USER /home/anddegs/ang/ai-server/CodeProject.AI-Server
   79  sudo chmod -R u+rw /home/anddegs/ang/ai-server/CodeProject.AI-Server

   85  nvcc -V

#copy to bashrc

   86  export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
   87  export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
   88  source ~/.bashrc
   89  nvcc -V
   90  vi ~./.bashrc
   91  cd ~/
   92  ls =ltra
   93  ls -ltra
   94  vi .bashrc
   95  vim .bashrc
   96  nano .bashrc



  106  sudo chmod -R u+w /home/anddegs/ang/ai-server/new/CodeProject.AI-Server/src/SDK/NET/obj/Debug/net8.0/
  108  sudo chown -R $USER:$USER /home/anddegs/ang/ai-server/new/CodeProject.AI-Server/src/SDK/NET/obj/Debug/net8.0/
  109  nvcc -V
  110  cd ~/ang/ai-server/CodeProject.AI-Server/src/
  111  sudo bash setup.sh
  112  getCudaVersion
  113  cuda_version_line=$(nvcc --version | grep -i "release")
  114  nvcc --version | grep -i "release"
  115  /usr/local/cuda/bin/nvcc --version | grep -i "release"
  116  nvidia-smi | grep -i -E 'CUDA Version: [0-9]+.[0-9]+'
  117  sudo bash setup.sh
  118  cuda_version_line=$(nvcc --version | grep -i "release")
  119  nvcc --version | grep -i "release"\
  120  sudo bash setup.sh

  123  sudo bash setup.sh
  124  clear
  125  sudo bash setup.sh
  126  \\\\
  127  cd ..
  128  ls
  129  mkdir new
  130  cd new
  131  history | grep clone
  132  git clone https://github.com/codeproject/CodeProject.AI-Server.git
  133  cd CodeProject.AI-Server/
  134  nvcc -V
  135  clear
  136  cd src/
  137  sudo bash setup.sh
  138  export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
  139  export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  140  source ~/.bashrc
  141  sudo bash setup.sh
  142  history
  143  nvcc -v
  144  export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
  145  export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  146  source ~/.bashrc
  147  nvcc -v
  148  nvcc
  149  nvcc -V
  150  pip -v
  151  pip --version
  152  pip install -r requirements.txt
  153  python
  154  pip install opencv-contrib-python
  155  history
  156  python
  157  sudo apt-get install python3.10-tk
  158  sudo apt-get install python3.9-tk
  159  history | grep python
  160  history| grep sudo
  161  /home/anddegs/udemy/yolo-nas/Section_01_R/venv/bin/python -m pip install --upgrade pip
  162  pip install -r requirements.txt
  163  clear
  164  pip install -r requirements.txt
  165  pip install super-gradients==3.1.0 --verbose
  166  python
  167  cd ..
  168  ls
  169  cd anddegs/
  170  cd ang/
  171  ls
  172  cd python-sdk/
  173  ls
  174  cd cocoapi/
  175  ls

  177  cd PythonAPI/


  182  sudo apt install python3.10 python3.10-venv python3.10-dev

  184  pip3 install cython
 202  sudo apt-get install python3.10-tk

  pip3 uninstall opencv-python-headless
  200  python3 setup.py install
 
 
  315  sudo ln -s python3.10 /usr/bin/python3
  316  python3 --version
  317  curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
  318  python3.10 -m pip --version
  319  sudo apt-get install python3-dev python3-setuptools python3-pip
  320  sudo apt-get install build-essential
  321  sudo apt-get install libgl1-mesa-dev
  322  cd ..
  323  cd python-sdk/
 

Installing pycocotools
  sudo apt-get install gcc
  git clone https://github.com/cocodataset/cocoapi.git
 cd cocoapi/PythonAPI
  328  make
 

  333  sudo python3 setup.py install
 
  335  python setup.py install
  336  python
  337  python3
 

Remove PyCharm local config
  365  cd ~/
  366  ls -ltra
  367  cd .local/
  368  ls
  369  cd share/
  370  ls
  371  cd JetBrains/
  372  ls
  373  cd ..
  374  rm -rf JetBrains/

===========================

 

 

============================= GTK ERROR

  277  pip uninstall opencv-contrib-python
  278  pip uninstall opencv-python-headless


  281  pip uninstall opencv-python



  283  pip install opencv-contrib-python
  284  pip install opencv-python

=====================================

========= PaddlOCR-GPU not Working =============

pip uninstall paddlepaddle-gpu

//before is pip install paddlepaddle-gpu==2.3.2
python -m pip install paddlepaddle-gpu==2.3.2.post111 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

========= PaddlOCR-GPU not Working =============

 

======== Terminal and Terminator not Starting ===

set the python version to 3.8 for ubuntu 20