發表文章

目前顯示的是 11月 7, 2021的文章

How to use pip3 without sudo privileges

圖片
In my case, there are several python3.x version installed in my system before, and I had to type python3.x and sudo pip3 for developing the code every time, which disturbed me.  Here are the methods I tried to solve this problem. Now I am able to type only the python3 command for the newest python3.8 use and pip3 for installing modules without root privileges. python3.x ... -> python3 ... sudo pip3.x install ... -> pip3 install / python3 -m pip install ...  1. Install pip3 locally under /home/$USER/.local/bin/. $ wget https://bootstrap.pypa.io/get-pip.py $ python3 get-pip.py --user 2. Edit ~/.bashrc $ export PATH=$PATH:~/.local/bin $ export PYTHONPATH=$PYTHONPATH:/usr/lib/python3.8/dist-packages $ source ~/.bashrc 3. Delete redundant pip path or error: ModuleNotFoundError: No module named 'pip._vendor.retrying' will be reported. $ sudo rm -r /usr/lib/python3/dist-packages/pip Check: $ python3 --version * Difference between /usr/local and /usr/.local /usr/local is a place

Installing TensorRT on Ubuntu20.04

圖片
1. Install CUDA, cuDNN CUDA: (1) Remove old version sudo apt-get purge nvidia* sudo apt-get autoremove sudo apt-get autoclean sudo rm -rf /usr/local/cuda* (2) Download and install CUDA toolkit 11.3 [1] $ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin $ sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 $ wget https://developer.download.nvidia.com/compute/cuda/11.3.0/local_installers/cuda-repo-ubuntu2004-11-3-local_11.3.0-465.19.01-1_amd64.deb $ sudo dpkg -i cuda-repo-ubuntu2004-11-3-local_11.3.0-465.19.01-1_amd64.deb $ sudo apt-key add /var/cuda-repo-ubuntu2004-11-3-local/7fa2af80.pub $ sudo apt-get update $ sudo apt-get -y install cuda (3) Check $ cd /usr/local/cuda-11.3/samples/1_Utilities/deviceQuery $ sudo make $ ./deviceQuery ex: cuDNN: (1) Download cuDNN 8.2.1 [2]  (2) Install extract cudnn-11.3-linux-x64-v8.2.1.32.tgz $ cd cuda $ sudo cp cuda/include/cudnn.h /usr/local/cuda-11.3/include/  $ sudo cp cu