diff --git a/install_software.sh b/install_software.sh index 8c03bb8..cd0173f 100755 --- a/install_software.sh +++ b/install_software.sh @@ -1,17 +1,45 @@ #!/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` -# this is needed for pavucontrol working not under sudo only -for group in audio pulse-access pulse +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 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 diff --git a/ollama-stack.yaml b/ollama-stack.yaml new file mode 100644 index 0000000..3a52ed4 --- /dev/null +++ b/ollama-stack.yaml @@ -0,0 +1,22 @@ +version: '3.9' + +services: + ollama: + image: ollama/ollama:latest + ports: + - 11434:11434 + volumes: + - ollama:/root/.ollama + + open-webui: + image: ghcr.io/open-webui/open-webui:main + ports: + - 3000:8080 + volumes: + - open-webui:/app/backend/data + environment: + - 'OLLAMA_BASE_URL=http://ollama:11434' + +volumes: + ollama: {} + open-webui: {} diff --git a/record_screen.sh b/record_screen.sh index ebc1663..b723db3 100755 --- a/record_screen.sh +++ b/record_screen.sh @@ -1,9 +1,9 @@ #!/bin/bash export LD_LIBRARY_PATH=/usr/local/lib -ffmpeg -hwaccel cuda -hwaccel_output_format cuda `# we need nvidia acceleration because of low fps without it` \ --f x11grab -r 30 -video_size 1920x1080 -i :0 `# this is screen` \ --f v4l2 -r 30 -video_size 640x480 -i /dev/video0 `# this is camera` \ --f alsa -i default `# this is audio. Why not pulse? Nvidia?` \ --c:v h264_nvenc `# this is video codec` \ --filter_complex "[0][1]overlay=main_w-overlay_w-2:main_h-overlay_h-2[v]" -map [v] -map 2 `# this is for placing camera in bottom right corner. IDK how it works` \ +ffmpeg -vsync 0 -hwaccel cuda -hwaccel_output_format cuda `# we need nvidia acceleration because of low fps without it` \ +-r 30 -video_size 640x480 -i /dev/video0 `# this is camera` \ +-f alsa -i default -async 1 `# this is audio. Why not pulse? Nvidia?` \ +-c:v h264_nvenc `# this is video codec` \ video.mp4 # output file +#-filter_complex 'overlay=main_w-overlay_w:main_h-overlay_h' `# this is overlay` \ +#-f x11grab -framerate 30 -video_size 1920x1080 -i :0 `# this is screen` \