[bugfix] linux-header only required by 18.04

This commit is contained in:
Klesh Wong 2020-09-27 18:05:12 +08:00
parent 700ab0f41a
commit bd4cc7c5d6

View File

@ -9,11 +9,10 @@ $ROOT/python/install.sh
# install deep learning tools # install deep learning tools
case "$PM" in case "$PM" in
apt) apt)
# cuda dependencies # cuda
sudo apt install linux-headers-$(uname -r)
source /etc/lsb-release source /etc/lsb-release
if [ "$DISTRIB_RELEASE" = "18.04" ] && [ "$(uname -m)" = 'x86_64' ]; then if [ "$DISTRIB_RELEASE" = "18.04" ] && [ "$(uname -m)" = 'x86_64' ]; then
sudo apt install linux-headers-$(uname -r)
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys \ sudo apt-key adv --fetch-keys \
@ -27,6 +26,8 @@ case "$PM" in
echo 'Unsupported release' echo 'Unsupported release'
exit -1 exit -1
fi fi
# nvidia docker
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \