Takuma Yoneda

ArchLinux

Network

Installation guide let us set up network with ip-link tool.

$ ip link  # List network interfaces
$ ip address show  # List IP addresses

# Manually add a static IP address to an interface
$ ip address add <address>/<prefix_len> broadcast + dev <interface>

# Manually set up a routing table
$ ip route show  # Show routing table
$ ip route add default via <address> dev <interface>  # Add "default" route

This lets us connect to the internet, but the configuration with ip-link is not persistent.
A persistent configuration can be made with NetworkManager:

$ sudo pacman -S networkmanager  # Install
$ sudo systemctl enable NetworkManager.service  # Enable service (i.e., it will start automatically at boot)
$ sudo systemctl start NetworkManager.service  # Start the service right now

$ nmcli device  # List network devices
DEVICE    TYPE      STATE        CONNECTION
enp6s0f1  ethernet  connected    Wired connection 1
enp6s0f0  ethernet  unavailable  --
lo        loopback  unmanaged    --

$ nmcli conn  # List connections
NAME                UUID                                  TYPE      DEVICE
Wired connection 1  c3a1896c-a190-3e1b-b1d5-8849ada345a5  ethernet  enp6s0f1
Wired connection 2  064d9092-0987-3060-9d9d-c6fdfcbcaefe  ethernet  --

$ sudo nmcli conn edit 'Wired connection 1'  # Edit connection interactively
...
$ sudo nmcli connection modify 'Wired connection 1' <setting>.<property> <value>  # Edit manually

DNS can be also configured in nmcli.

Install NVIDIA driver

ArchWiki (NVIDIA)

Install an appropriate driver. In my case I have GeForce GTX 1080 Ti on my box. Thus simply install nvidia package:

$ sudo pacman -S nvidia

In my case I needed to run sudo pacman -Syu to update package list (?) first. Otherwise the driver version was not the latest.

After reboot, I can confirm the GPU is visible:

$ nvidia-smi
Fri Jul  8 17:59:39 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.57       Driver Version: 515.57       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:82:00.0 Off |                  N/A |
| 24%   41C    P0    58W / 250W |      0MiB / 11264MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

$ python3
Python 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True

Install from AUR repository

First, go to the AUR package page (e.g., https://aur.archlinux.org/packages/nvidia-container-toolkit)
And then download the repository that contains PKGBUILD file.
You can either git clone from the git repository or click Download Snapshot in Package Actions.

Once you enter the directory that contains PKGBUILD, run makepkg -si.

  • -s, --syncdeps: Install missing dependencies using pacman
  • -i, --install: Install or upgrade the package after a successful build using pacman

Dependency installation seems to fail when the dependency is an AUR package. I resolved it by manually installing that AUR package first.

Get X11 forward working

https://bbs.archlinux.org/viewtopic.php?id=202098

# Install xauth
$ sudo pacman -S xorg-xauth

# Enable X11Forwarding on sshd config
$ sudo vi /etc/ssh/sshd_config
...
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
...

# Restart sshd daemon
$ sudo systemctl restart sshd