LinuxCommandLibrary

mhwd

Manage Manjaro hardware drivers

TLDR

List available drivers

$ mhwd [[-l|--list]]
copy

List installed drivers
$ mhwd [[-li|--listinstalled]]
copy

Install a driver
$ mhwd [[-i|--install]] [pci|usb] [driver_name]
copy

Remove a driver
$ mhwd [[-r|--remove]] [pci|usb] [driver_name]
copy

Display detailed information about detected hardware
$ mhwd [[-l|--list]] [[-d|--detail]]
copy

Automatically install best available driver for the detected graphics card
$ mhwd [[-a|--auto]] pci [free|nonfree] 0300
copy

SYNOPSIS

mhwd [-h|--help]
mhwd [-v|--version]
mhwd [-d|--detect]
mhwd [-l|--list [-p busid]]
mhwd [-la|--listall [-p busid]]
mhwd [-li|--listinstalled [-p busid]]
mhwd [-a|--autoinstall pci {free|nonfree} [0300|0380|0600]]
mhwd [-i|--install pci driver_name [-f|--force]]
mhwd [-r|--remove pci driver_name [-f|--force]]

PARAMETERS

-h, --help
    Displays a help message and exits.

-v, --version
    Displays version information and exits.

-d, --detect
    Detects hardware and outputs a list of detected PCI devices.

-l, --list
    Lists currently detected and recommended drivers for your hardware. Can be filtered by -p busid.

-la, --listall
    Lists all available drivers for installation, including those not currently recommended for your system. Can be filtered by -p busid.

-li, --listinstalled
    Lists all drivers currently installed on your system. Can be filtered by -p busid.

-a, --autoinstall pci {free|nonfree} [0300|0380|0600]
    Automatically installs recommended free (open-source) or nonfree (proprietary) drivers for a specific PCI device class (e.g., 0300 for VGA controllers).

-i, --install pci driver_name
    Installs the specified driver (e.g., video-nvidia or video-linux) for PCI devices. Use mhwd -la to find driver names.

-r, --remove pci driver_name
    Removes the specified driver from PCI devices. Use mhwd -li to find installed driver names.

-f, --force
    Forces the installation or removal of a driver, potentially overriding warnings or conflicts. Use with caution.

-p, --pci busid
    Specifies a particular PCI bus ID (e.g., 0000:01:00.0) to target operations on a specific device, especially useful for multi-GPU setups.

--nvidia-prime
    Configures NVIDIA Prime for hybrid graphics systems, allowing seamless switching between integrated and dedicated NVIDIA GPUs.

--amdgpu-prime
    Configures AMDGPU Prime for hybrid graphics systems, allowing seamless switching between integrated and dedicated AMD GPUs.

DESCRIPTION

mhwd (Manjaro Hardware Detection) is a powerful, Manjaro-specific command-line utility designed to simplify the complex process of installing and managing hardware drivers, particularly graphics drivers. It automatically detects the hardware components of your system and provides a straightforward way to install the most suitable open-source (free) or proprietary (nonfree) drivers. This significantly improves the user experience, especially for new Linux users who might find manual driver installation challenging.

mhwd acts as an abstraction layer over lower-level package managers like pacman, handling dependencies and configurations automatically. It's especially useful for managing dual-GPU setups (e.g., NVIDIA Optimus or AMD switchable graphics), allowing users to easily switch between integrated and dedicated GPUs. Its primary goal is to ensure optimal system performance and stability by providing robust and well-tested driver solutions tailored for the Manjaro ecosystem.

CAVEATS

mhwd is a utility specific to Manjaro Linux and is not available or functional on other distributions. Misuse, particularly with the -f (force) option, can lead to system instability, unbootable systems, or display issues. Always ensure your system is up-to-date before installing or removing drivers, and consider creating a system snapshot or backup for critical changes. While mhwd simplifies driver management, a basic understanding of your hardware and driver types (free vs. nonfree) is recommended.

DRIVER TYPES

mhwd distinguishes between two main driver types:
free: Refers to open-source drivers, typically developed by the Linux community (e.g., video-linux which includes Mesa for Intel/AMD/Nouveau). These are generally more stable and integrated with the kernel.
nonfree: Refers to proprietary drivers provided by hardware manufacturers (e.g., video-nvidia for NVIDIA cards). These often offer better performance or support for newer features but can sometimes be less stable or cause compatibility issues with kernel updates.

PCI BUS IDS AND DEVICE CLASSES

mhwd interacts with hardware via PCI Bus IDs (e.g., 0000:01:00.0) which uniquely identify each PCI device on your system. You can find these using lspci.
Additionally, mhwd uses PCI Device Classes for broad categorization. Common classes include:
0300: VGA compatible controller (graphics cards)
0380: Display controller (other display related devices)
0600: Host bridge (system controllers)
These are used in commands like mhwd -a pci nonfree 0300 to target specific types of hardware for driver auto-installation.

HYBRID GRAPHICS MANAGEMENT

One of mhwd's key features is its ability to manage hybrid graphics setups (systems with both an integrated GPU and a dedicated GPU, common in laptops). It provides tools and configurations, such as --nvidia-prime and --amdgpu-prime, to set up and switch between GPUs, ensuring optimal power efficiency or performance depending on the user's needs.

HISTORY

mhwd was developed as a core component of Manjaro Linux with the goal of providing an 'it just works' experience for hardware and driver management. Recognizing that driver installation, especially for graphics cards, was a frequent pain point for new Linux users, Manjaro developers created mhwd to automate and simplify this process. Its development focused on abstracting away the complexities of kernel modules, Xorg configuration, and package dependencies, making Manjaro more accessible and user-friendly since its early days.

SEE ALSO

lspci(8), lsusb(8), pacman(8), xrandr(1), prime-run(1)

Copied to clipboard