useful_scripts/install_software.sh

67 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# for nvidia-container-toolkit
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# for nodejs/opencommit
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
# apt packages
sudo nala update
sudo nala install -y \
mpv `# for video playing` \
sxiv `# for pictures` \
strace `# for tracing` \
docker.io `# containers` \
docker-compose `# containers` \
nvidia-container-toolkit `# containers` \
nodejs `# for opencommit`
sudo nvidia-ctk runtime configure --runtime=docker --set-as-default
sudo service docker restart
sudo docker stack deploy -c ollama-stack.yaml ollama
# this is needed for pavucontrol/docker working not under sudo only
for group in audio pulse-access pulse docker
do
sudo usermod -a -G $group $USER
done
# install opencommit
if ! command -v opencommit &> /dev/null
then
git clone --depth 1 https://git.digitalstudium.com/digitalstudium/opencommit.git
cd opencommit
npm run build
npm pack
sudo npm install -g opencommit-3.0.11.tgz
cd -
rm -rf opencommit
oco config set OCO_AI_PROVIDER=ollama
fi
# install ffmpeg with nvidia
if ! command -v ffmpeg &> /dev/null
then
git clone --depth 1 https://git.ffmpeg.org/ffmpeg.git ffmpeg/
git clone --depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers && sudo make install && cd -
sudo nala install -y build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev libasound2-dev
cd ffmpeg
./configure --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-libxcb --enable-indev=alsa --enable-outdev=alsa --extra-cflags=-I/usr/lib/cuda/include --extra-ldflags=-L/usr/lib/cuda/lib64 --disable-static --enable-shared
make -j 8
sudo make install
cd -
rm -rf ffmpeg nv-codec-headers
fi
# install pet
if ! command -v pet &> /dev/null
then
wget https://github.com/knqyf263/pet/releases/download/v0.3.6/pet_0.3.6_linux_amd64.deb
sudo apt install -y ./pet_0.3.6_linux_amd64.deb
rm -f pet_0.3.6_linux_amd64.deb
fi