useful_scripts/install_software.sh

66 lines
2.4 KiB
Bash
Raw Normal View History

2024-03-03 15:34:52 +00:00
#!/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
2024-03-03 15:07:29 +00:00
sudo nala update
sudo nala install -y \
mpv `# for video playing` \
sxiv `# for pictures` \
2024-03-03 15:34:52 +00:00
strace `# for tracing` \
2024-03-03 15:09:35 +00:00
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
2024-03-03 15:07:29 +00:00
# this is needed for pavucontrol/docker working not under sudo only
for group in audio pulse-access pulse docker
2024-03-03 15:07:29 +00:00
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 pack
sudo npm install -g opencommit-3.0.11.tgz
cd -
rm -rf opencommit
oco config set OCO_AI_PROVIDER=ollama
fi
2024-03-03 18:02:53 +00:00
# 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
2024-03-03 15:07:29 +00:00
# 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