Skip to main content

CachyOS Linux: Pacman Package Manager & Nvidia Configuration

963 words·
Linux CachyOS Pacman ML NVIDIA pip Docker
Table of Contents

Fish Shell
#

Note that Cachy OS uses fish as the default shell:

# Verify current shell
echo $SHELL

# Shell output:
/bin/fish

Pacman Commands & Useful Packages
#

Install, Uninstall & Upgrade Package
#

# Install package / reinstall package
sudo pacman -S package-name

# Uninstall package
sudo pacman -R package-name

# Upgrade packages & system
sudo pacman -Syu

NeoVIM & Standard Editor
#

# NeoVIM
sudo pacman -S neovim
# Current shell
vi ~/.zshrc

export EDITOR='nvim'
export VISUAL='nvim'
# Global
sudo vi /etc/environment

EDITOR=nvim
VISUAL=nvim
# Verify default editor
echo $EDITOR

# Shell output:
nvim

Tree
#

# Install tree package
sudo pacman -S tree

SSH
#

# Install SSH package
sudo pacman -S openssh

# Start and enable
sudo systemctl start sshd &&
sudo systemctl enable sshd

# Verify status
systemctl status sshd
  • Add firewall rule for ssh

Docker
#

Start and enable the Docker server after installing it via the CachyOS Package Manager:

# Start and enable the Docker service
sudo systemctl start docker &&
sudo systemctl enable docker



Nvidia Stack
#

Verify Packages
#

# Install installed / available packages
pacman -Qs nvidia

# Shell output:
local/egl-gbm 1.1.2.1-1.1
    The GBM EGL external platform library
local/egl-wayland 4:1.1.20-1.1
    EGLStream-based Wayland external platform
local/egl-x11 1.0.3-1.1
    NVIDIA XLib and XCB EGL Platform Library
local/lib32-nvidia-utils 580.105.08-3
    NVIDIA drivers utilities (32-bit)
local/lib32-opencl-nvidia 580.105.08-3
    OpenCL implemention for NVIDIA (32-bit)
local/libva-nvidia-driver 0.0.14-1.1
    VA-API implementation that uses NVDEC as a backend
local/libvdpau 1.5-3.1
    Nvidia VDPAU library
local/libxnvctrl 580.105.08-1
    NVIDIA NV-CONTROL X extension
local/linux-cachyos-lts-nvidia 6.12.60-2
    nvidia module of 580.105.08 driver for the linux-cachyos-lts kernel
local/linux-cachyos-nvidia 6.18.0-2
    nvidia module of 580.105.08 driver for the linux-cachyos kernel
local/linux-firmware-nvidia 1:20251125-2
    Firmware files for Linux - Firmware for NVIDIA GPUs and SoCs
local/nvidia-settings 580.105.08-1.1
    Tool for configuring the NVIDIA graphics driver
local/nvidia-utils 580.105.08-4
    NVIDIA drivers utilities
local/opencl-nvidia 580.105.08-4
    OpenCL implemention for NVIDIA
  • local/ Package is installed

NVIDIA System Management Interface
#

NVIDIA System Management Interface is a CLI tool that is installed with the NVIDIA driver /nvidia-utils package.

# List GPU status / CUDA version
nvidia-smi

# Shell output:
Sat Dec  6 16:20:44 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.105.08             Driver Version: 580.105.08     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| 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 GTX 1060 6GB    Off |   00000000:09:00.0  On |                  N/A |
|  0%   29C    P8              7W /  156W |      75MiB /   6144MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

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

Useful commands:

# Reset the GPU (useful when CUDA apps are stuck)
sudo nvidia-smi --gpu-reset

# Watch GPU usage
watch -n 1 nvidia-smi

Docker GPU Configuration
#

# Install NVIDIA Container Toolkit
sudo pacman -S nvidia-container-toolkit
# Configure Docker to use the NVIDIA runtime
sudo nvidia-ctk runtime configure --runtime=docker

# Verify Docker configuration
sudo cat /etc/docker/daemon.json

# Shell output:
{
    "runtimes": {
        "nvidia": {
            "args": [],
            "path": "nvidia-container-runtime"
        }
    }
}
# Restart Docker daemon
sudo systemctl restart docker

# Check Docker status
sudo systemctl status docker
# Verify the container can access the GPU
docker run --rm --gpus all nvidia/cuda:11.8.0-runtime-ubuntu22.04 nvidia-smi

# Shell output:
==========
== CUDA ==
==========

CUDA Version 11.8.0

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

Thu Dec 11 15:47:20 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.105.08             Driver Version: 580.105.08     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| 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 GTX 1060 6GB    Off |   00000000:09:00.0  On |                  N/A |
|  0%   32C    P8              6W /  156W |    1459MiB /   6144MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

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



CUDA
#

Create Python Venv
#

# Create directory
mkdir machinelearning && cd machinelearning

# Create virtual environment
python3 -m venv .venv-ml

# Active environment
source .venv-ml/bin/activate.fish

# Upgrade pip
pip install --upgrade pip

# Deactivate venv
deactivate

More useful commands:

# Verify pip
which pip

# Shell output:
/home/cachyos/machinelearning/.venv-ml/bin/pip

Pip Requirements
#

Find CUDA version: https://download.pytorch.org/whl/

  • nvim requirements-cuda.txt
--index-url https://download.pytorch.org/whl/cu118  # CUDA 11.8

torch  # PyTorch framework
torchvision  # PyTorch companion package for computer vision
torchaudio  # PyTorch companion package for audio processing / speech & audio models
  • nvim requirements-core.txt
# Utilities
python-dotenv

# Hugging Face ecosystem
transformers[torch]  # Hugging Face main library for LLMs
accelerate  # Hugging Face utility toolkit for device management and training support
datasets  # library for handling datasets
huggingface_hub  # API for interacting with the Hugging Face Model Hub
# Install requirements
pip install -r requirements-cuda.txt
pip install -r requirements-core.txt

# List installed packages
pip list

# List details about specific package
pip show packagename

PyTorch
#

Verify that PyTorch finds the GPU:

# Start Python
python

# Paste Python script:
import torch

print("Torch version:", torch.__version__)
print("CUDA available:", torch.cuda.is_available())
if torch.cuda.is_available():
    print("GPU name:", torch.cuda.get_device_name(0))
    x = torch.randn(1024, 1024, device="cuda")
    print("Tensor on:", x.device)

# Run Python script
<retrurn>

# Shell output:
Torch version: 2.7.1+cu118
CUDA available: True
GPU name: NVIDIA GeForce GTX 1060 6GB
Tensor on: cuda:0

# Exit Python
exit
  • cuda:0 First GPU