Added install_nvidia
This commit is contained in:
parent
a25611a813
commit
0fc1f2f4e6
1 changed files with 22 additions and 22 deletions
|
|
@ -114,15 +114,15 @@ incus config device add ollama-container gpu gpu
|
|||
|
||||
# Install nvidia
|
||||
|
||||
incus exec ollama-container --console -- bash -c 'echo "deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware" > /etc/apt/sources.list.d/backports.list'
|
||||
incus exec ollama-container -- bash -c 'echo "deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware" > /etc/apt/sources.list.d/backports.list'
|
||||
|
||||
incus exec ollama-container --console -- curl -fsSL https://pkgs.zabbly.com/key.asc | gpg --show-keys --fingerprint
|
||||
incus exec ollama-container -- curl -fsSL https://pkgs.zabbly.com/key.asc | gpg --show-keys --fingerprint
|
||||
|
||||
incus exec ollama-container --console -- mkdir -p /etc/apt/keyrings/
|
||||
incus exec ollama-container -- mkdir -p /etc/apt/keyrings/
|
||||
|
||||
incus exec ollama-container --console -- curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
|
||||
incus exec ollama-container -- curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
|
||||
|
||||
incus exec ollama-container --console -- sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources
|
||||
incus exec ollama-container -- sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources
|
||||
Enabled: yes
|
||||
Types: deb
|
||||
URIs: https://pkgs.zabbly.com/incus/stable
|
||||
|
|
@ -133,44 +133,44 @@ Signed-By: /etc/apt/keyrings/zabbly.asc
|
|||
|
||||
EOF'
|
||||
|
||||
incus exec ollama-container --console -- apt install -y software-properties-common
|
||||
incus exec ollama-container -- apt install -y software-properties-common
|
||||
|
||||
incus exec ollama-container --console -- apt-add-repository -y contrib
|
||||
incus exec ollama-container -- apt-add-repository -y contrib
|
||||
|
||||
incus exec ollama-container --console -- apt-add-repository -y non-free
|
||||
incus exec ollama-container -- apt-add-repository -y non-free
|
||||
|
||||
incus exec ollama-container --console -- apt-add-repository -y non-free-firmware
|
||||
incus exec ollama-container -- apt-add-repository -y non-free-firmware
|
||||
|
||||
incus exec ollama-container --console -- apt-get update && sudo apt-get upgrade
|
||||
incus exec ollama-container -- apt-get update && sudo apt-get upgrade
|
||||
|
||||
# Install new kernel.
|
||||
|
||||
incus exec ollama-container --console -- apt-get -y install linux-image-6.11.10+bpo-amd64 linux-headers-6.11.10+bpo-amd64
|
||||
incus exec ollama-container -- apt-get -y install linux-image-6.11.10+bpo-amd64 linux-headers-6.11.10+bpo-amd64
|
||||
|
||||
# Install cuda nvidia drivers
|
||||
|
||||
echo "Install nvidia drivers in container"
|
||||
|
||||
incus exec ollama-container --console -- apt -y purge "*nvidia*"
|
||||
incus exec ollama-container -- apt -y purge "*nvidia*"
|
||||
|
||||
incus exec ollama-container --console -- wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb
|
||||
incus exec ollama-container --console -- dpkg -i cuda-keyring_1.1-1_all.deb
|
||||
incus exec ollama-container --console -- apt-get -y -f install
|
||||
incus exec ollama-container --console -- apt update
|
||||
incus exec ollama-container -- wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb
|
||||
incus exec ollama-container -- dpkg -i cuda-keyring_1.1-1_all.deb
|
||||
incus exec ollama-container -- apt-get -y -f install
|
||||
incus exec ollama-container -- apt update
|
||||
|
||||
incus exec ollama-container --console -- bash -c 'echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/ /" \
|
||||
incus exec ollama-container -- bash -c 'echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/ /" \
|
||||
| tee /etc/apt/sources.list.d/cuda-debian12-x86_64.list'
|
||||
|
||||
incus exec ollama-container --console -- apt -y update
|
||||
incus exec ollama-container -- apt -y update
|
||||
|
||||
incus exec ollama-container --console -- apt -y install cuda-drivers
|
||||
incus exec ollama-container -- apt -y install cuda-drivers
|
||||
|
||||
echo "Install Ollama in container ollama-container"
|
||||
|
||||
incus exec ollama-container --console -- apt -y install curl
|
||||
incus exec ollama-container --console -- curl -fsSL https://ollama.com/install.sh | sh
|
||||
incus exec ollama-container -- apt -y install curl
|
||||
incus exec ollama-container -- curl -fsSL https://ollama.com/install.sh | sh
|
||||
|
||||
incus exec ollama-container --console -- ollama run gemma3:4b
|
||||
incus exec ollama-container -- ollama run gemma3:4b
|
||||
|
||||
echo "Done!!!"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue