Skip to content

Commit

Permalink
Environment variable setup
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekAlexis committed Oct 26, 2020
1 parent fa0d843 commit 66eb7a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/install_jetson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DIR=$HOME

set -e

# add CUDA paths
# set up environment variables
echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc
source ~/.bashrc
Expand Down
11 changes: 6 additions & 5 deletions scripts/install_opencv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DIR=$HOME

set -e

# install dependencies:
# install dependencies
sudo apt-get -y update
sudo apt-get install -y build-essential \
cmake \
Expand All @@ -33,6 +33,11 @@ sudo apt-get install -y build-essential \
gstreamer1.0-plugins-ugly \
libdc1394-22-dev \
libavresample-dev \

# set up python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo -H python3 get-pip.py
sudo -H pip3 install numpy

cd $DIR
wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip
Expand All @@ -45,10 +50,6 @@ mv opencv_contrib-${OPENCV_VERSION} opencv_contrib
mv opencv_contrib OpenCV

cd OpenCV
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo -H python3 get-pip.py
sudo -H pip3 install numpy

mkdir build && cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \
Expand Down
11 changes: 9 additions & 2 deletions scripts/install_tensorrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@ wget https://developer.download.nvidia.com/compute/machine-learning/repos/${OS}/
sudo dpkg -i nvidia-machine-learning-repo-*.deb
sudo apt-get update

# install cuda, cudnn, and tensorrt
# install CUDA and cuDNN
sudo apt-get install -y cuda=${CUDA_VERSION}-1
sudo apt-get install -y libcudnn7 libcudnn7-dev

# install TensorRT and its Python API
sudo apt-get install libnvinfer7=${TRT_VERSION} libnvonnxparsers7=${TRT_VERSION} libnvparsers7=${TRT_VERSION} \
libnvinfer-plugin7=${TRT_VERSION} libnvinfer-dev=${TRT_VERSION} libnvonnxparsers-dev=${TRT_VERSION} \
libnvparsers-dev=${TRT_VERSION} libnvinfer-plugin-dev=${TRT_VERSION} python-libnvinfer=${TRT_VERSION} \
python3-libnvinfer=${TRT_VERSION} uff-converter-tf=${TRT_VERSION}
sudo apt-mark hold libnvinfer7 libnvonnxparsers7 libnvparsers7 libnvinfer-plugin7 libnvinfer-dev libnvonnxparsers-dev \
libnvparsers-dev libnvinfer-plugin-dev python-libnvinfer python3-libnvinfer uff-converter-tf

echo 'If everything worked fine, reboot now.'

# set up environment variables
echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc
source ~/.bashrc
echo 'If everything worked fine, reboot now'

0 comments on commit 66eb7a3

Please sign in to comment.