Add stuff from askiiart/pc-configs

This commit is contained in:
askiiart 2023-10-20 11:27:00 -05:00
parent 5d03b0a1ec
commit c7c9080553
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67
18 changed files with 405 additions and 10 deletions

View file

@ -0,0 +1,125 @@
# Nvidia 470 datacenter drivers
**Note:** Desktop drivers and datacenter drivers are different.
## Debian
This hasn't yet been tested. If you have tested it, please open a PR to update this section.
### Add apt repos
**You can skip this if you already have the repositories enabled**
To add the non-free and contrib repos, edit `/etc/apt/sources.list` and add `non-free contrib` to the end of each line, like this:
```txt
deb http://deb.debian.org/debian/ bullseye main non-free contrib
deb-src http://deb.debian.org/debian/ bullseye main non-free contrib
```
Then, run `apt update`
### Installation
To install the driver:
```sh
apt install nvidia-tesla-470-driver
```
And to install CUDA:
```bash
apt install nvidia-cuda-dev nvidia-cuda-toolkit
```
### Links
- [Driver Install Guide](https://wiki.debian.org/NvidiaGraphicsDrivers) ([Internet Archive Link](https://web.archive.org/web/20221123184836/https://wiki.debian.org/NvidiaGraphicsDrivers))
## Fedora
This guide uses the RPM Fusion repositories, and if you install CUDA, it uses Nvidia repositories as well. Note that this guide is only compatible with Fedora 35+, I'm not sure about RHEL versions.
### Add RPM Fusion repository
**You can skip this if you already have the repository installed.**
To add the RPM Fusion repository:
```bash
# Add gpg key
sudo dnf install distribution-gpg-keys
sudo rpmkeys --import /usr/share/distribution-gpg-keys/rpmfusion/RPM-GPG-KEY-rpmfusion-free-fedora-$(rpm -E %fedora)
# Add repo with gpg check
sudo dnf --setopt=localpkg_gpgcheck=1 install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
```
### Install Driver
First, update everything, and reboot if you're not on the latest kernel.
```bash
dnf update -y
```
Then, install the driver:
```bash
dnf install akmod-nvidia-470xx
```
_**Do not reboot yet.**_
Before rebooting, use `top` or `ps` to make sure there is no `akmods`, `cc*`, `kthreadd`, or `gcc*` process running (`*` is either nothing or a number)—or anything using tons of CPU that you don't expect.
*Note:* `nvidia-smi` and other tools are not included with the driver. For that, you need to install CUDA.
### Install CUDA
Install packages needed for CUDA with:
```bash
export FEDORA_VERSION=$(rpm -E %fedora) # Nvidia's repo doesn't support Fedora 38 yet, so change this to 37 if you're on Fedora 38
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora35/x86_64/cuda-fedora${FEDORA_VERSION}.repo
dnf clean all
dnf module disable nvidia-driver
dnf -y install cuda
```
*Note:* Don't re-enable `nvidia-driver`
### Problems
#### Suspend Issues
I had issues with my K80 not working after being suspended. For example, `torch.cuda.is_available()` would give an error and return False, rather than saying True.
To fix this, install `xorg-x11-drv-nvidia-470xx-power`
```bash
dnf install xorg-x11-drv-nvidia-470xx-power
```
---
#### CUDA is higher version than driver
Sometimes the driver in the CUDA repo, and therefore dependencies for CUDA are of a later version than the driver. To fix this, run:
```bash
dnf module enable nvidia-driver -y && dnf download cuda-drivers && dnf module disable nvidia-driver -y
rpm -Uvh cuda-drivers*.rpm --nodeps
dnf update
```
### More stuff
Why not install `xorg-x11-drv-nvidia-470xx`?
- That's the _display_ driver, not the data center driver. It is the same version number, but is not the same.
### Links
- [Repo Config](https://rpmfusion.org/Configuration) ([Internet Archive Link](https://web.archive.org/web/20221111180224/https://rpmfusion.org/Configuration))
- [Verify Repo Signing Keys](https://rpmfusion.org/keys) ([Internet Archive Link](https://web.archive.org/web/20221111180744/https://rpmfusion.org/keys))
- [NVIDIA Guide](https://rpmfusion.org/Howto/NVIDIA) ([Internet Archive Link](https://web.archive.org/web/20221111181211/https://rpmfusion.org/Howto/NVIDIA))
- [CUDA Guide](https://rpmfusion.org/Howto/CUDA) ([Internet Archive Link](https://web.archive.org/web/20221111181243/https://rpmfusion.org/Howto/CUDA))

View file

@ -0,0 +1,28 @@
# Install Firmware
## During Linux Installation
When installing Linux, you may get an error like this:
```
Some of your hardware needs non-free firmware files to operate. The firmware can be loaded from removable media, such as a USB stick or floppy.
The missing firmware files are: iwlwifi-3168-29.ucode iwlwifi-3168-28.ucode iwlwifi-3168-27.ucode iwlwifi-3168-26.ucode iwlwifi-3168-25.ucode iwlwifi-3168-24.ucode iwlwifi-3168-23.ucode iwlwifi-3168-22.ucode
If you have such media available now, insert it, and continue.
Load missing firmware from removable media?
[ ] No
[x] Yes
```
These are all actually just different versions of the one firmware file you need. Just get `iwlwifi-3168-29.ucode` from [here](iwlwifi-3168-29.ucode) or [here](/static/iwlwifi-3168-29.ucode), put it on another USB drive, then insert it and continue.
## Post-Installation
Get the firmware from [here](iwlwifi-3168-29.ucode), then move it to `/lib/firmware`, and restart.
```bash
sudo mv iwlwifi-3168-29.ucode /lib/firmware/
reboot
```

View file

@ -0,0 +1,99 @@
# mergerfs + SnapRAID setup
## mergerfs
`/etc/fstab`:
```txt
# Data drives
UUID=2eeb4386-e26e-4340-9747-74fb3d18dd57 /mnt/disk1 xfs defaults 0 0
UUID=e030fa2f-a9b4-4788-8d10-05cf5031f9c0 /mnt/disk2 xfs defaults 0 0
UUID=f9a79cef-3959-4aa8-a9c9-af54660cb755 /mnt/disk3 xfs defaults 0 0
UUID=c7283793-37c6-4b01-95e1-cca26af0da8f /mnt/cache btrfs defaults 0 0
UUID=8d8cb485-eb23-475b-a9c1-03b8309cdbaa /mnt/parity xfs defaults 0 0
# mergerfs
/mnt/disk1:/mnt/disk2:/mnt/disk3:/mnt/cache /mnt/user fuse.mergerfs defaults,allow_other,use_ino,category.create=lfs,moveonenospc=true,minfreespace=512G,cache.files=partial,dropcacheonclose=true 0 0
/mnt/disk1:/mnt/disk2:/mnt/disk3 /mnt/hdds fuse.mergerfs defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=25M,cache.files=partial,dropcacheonclose=true 0 0```
```
Command equivalent to fstab mergerfs mounts:
```txt
mergerfs -o defaults,allow_other,use_ino,category.create=lfs,moveonenospc=true,minfreespace=512G,cache.files=partial,dropcacheonclose=true /mnt/disk1:/mnt/disk2:/mnt/disk3:/mnt/cache /mnt/user
mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=25M,cache.files=partial,dropcacheonclose=true /mnt/disk1:/mnt/disk2:/mnt/disk3 /mnt/hdds
```
## Caching and mover
### Topology
- `/mnt/user` - Combined mergerfs pool
- `/mnt/hdds` - HDD-only mergerfs pool
- `/mnt/cache` - cache mount point
- `/mnt/disk*` - Each HDD, starting from 1. `/mnt/disk1`, `/mnt/disk2`, etc.
### Mover script
Stolen from [here](https://raw.githubusercontent.com/trapexit/mergerfs/latest-release/tools/mergerfs.time-based-mover)
It moves anything that hasn't been access in more than 3 days.
Requires `rsync` - install with `apt update && apt install rsync`
```sh
#!/usr/bin/env sh
if [ $# != 3 ]; then
echo "usage: $0 <cache-fs> <backing-pool> <days-old>"
exit 1
fi
CACHE="${1}"
BACKING="${2}"
N=${3}
find "${CACHE}" -type f -atime +${N} -printf '%P\n' | \
rsync --files-from=- -axqHAXWES --preallocate --remove-source-files "${CACHE}/" "${BACKING}/"
```
Located at `/root/mergerfs.time-based-mover.sh`, runs daily at 4 AM:
```cron
0 4 * * * /root/mergerfs.time-based-mover.sh /mnt/cache /mnt/hdds 3
```
## SnapRAID
### `/etc/snapraid.conf`
The list of files is stored on multiple disks in `snapraid.content`, and the parity is just one file (`snapraid.parity`)
```txt
parity /mnt/parity/snapraid.parity
content /var/snapraid/snapraid.content
content /mnt/disk1/snapraid.content
content /mnt/disk2/snapraid.content
content /mnt/disk3/snapraid.content
data d1 /mnt/disk1/
data d2 /mnt/disk2/
data d3 /mnt/disk3/
```
### Syncing
Run daily at 2 AM (`/etc/cron.d/snapraid-sync`):
```cron
* 02 * * * /root/snapraid-sync.sh
```
`/root/snapraid-sync.sh`:
```sh
#!/usr/bin/env sh
CONTAINERS=$(docker ps -q)
docker stop $CONTAINERS
snapraid sync
docker start $CONTAINERS
```

View file

@ -0,0 +1,20 @@
# Mount Drive On Boot
To mount a drive on boot, first find the UUID of the drive:
```bash
sudo blkid
```
Then add the following to `/etc/fstab`:
```conf
UUID=<UUID_OF_DRIVE> /mnt/big-stuff ext4 defaults
```
For example, for my big drive (4TB Toshiba X300 Performance):
```conf
# big-stuff
UUID=d68f1a75-af20-4627-8382-7198c3a34b5d /mnt/big-stuff ext4 defaults
```

View file

@ -0,0 +1,15 @@
# Spice Guest Tools
These are the software packages for the guest OS that provide stuff like copy-paste, shared folders, graphics drivers, etc. They're not required, but are quite useful (and tiny!)
## Windows
The download is [here](https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe), it's easy. Just install it and restart.
## Linux
Linux guests use the packages `spice-vdagent` (for copy-paste, shared folders, etc.) and `xf86-video-qxl` (for graphics drivers) (or `xf86-video-qxl-devel` if you're building from source, according to GitHub copilot, IDK). The `spice-vdagent` package is available in most distributions' repositories, but the `xf86-video-qxl` package is not. You can build it from source (download [here](https://www.spice-space.org/download.html)).
## macOS
No. Maybe the Linux ones would work, IDK. I don't feel like testing it. Check out [this](https://github.com/utmapp/UTM/discussions/3772) and [this](https://docs.getutm.app/).