Updated nvidia-driver-assistant (v51 rebase + Manjaro legacy support)

Hi all,

I wanted to share my current refactor of nvidia-driver-assistant.

Earlier this year I already worked on improving the Manjaro version with additional fallback logic and detection changes. Over the last couple of days I rebased that work onto the current upstream NVIDIA codebase (v51).

The goal is to keep upstream compatibility while preserving Manjaro-specific behavior, since Manjaro packaging differs from upstream assumptions. In particular, Manjaro still provides the full driver stack down to legacy 390, so treating everything below 580 as unsupported does not reflect Manjaro reality.

One edge case is still being finalized:
when a legacy 580-only GPU is present together with a GPU capable of open kernel modules, upstream logic currently prefers open kernel drivers, which is incorrect for mixed setups because the legacy 580 device cannot operate with that selection.

This mixed-GPU handling will be completed tomorrow, after which the refactor should be essentially production-ready.

Note: no supported-gpus.json changes are needed.
(BTW, you can also test it with the broken supported-gpus.json, which maps openkernel to the legacy580 branch. The nvidia-driver-assistant script contains logic that forces every legacy branch up to and including 580 onto the proprietary kernel module.)

Branch:

I’m sharing this here since it includes both my work and Manjaro-specific logic/workflows, and may be useful for future sync/update efforts.

Please adjust if you think this is not the correct place/topic


Update (May 05): I dug deeper into the code and the newest supported-gpus.json. They removed the legacy580 branch (which correctly does not have the openkernel flag) in the latest Ubuntu 26.04 v51 database file. However, it does not matter with my version.
I verified Debian 13 v51 which still has the legacy 580.xx branch (but mistakenly includes the openkernel flag as well), and Ubuntu 24.04 v51 is the same.

Update (May 17): Now this puppy is a modular Python program driven by external YAML configuration files for much easier maintenance. Since I opened this topic, the core structure has evolved, and the current README.md on the repository is the new source of truth.

PKGBUILD:

# Maintainer: Gyöngyösi Gábor <gabor at gshoots dot hu>

pkgname=nvidia-driver-assistant
pkgver=0.51.71.05_1.gcf643c078b
pkgrel=1
pkgdesc="Detect and install the best NVIDIA driver packages for the system"
arch=('any')
url="https://github.com/megvadulthangya/nvidia-driver-assistant"
license=('MIT' 'custom')
depends=('python' 'python-pyyaml')
makedepends=('git' 'curl' 'libarchive' 'gzip')

# The source code comes from the git repo; the DEB is pulled in prepare()
# only for the production supported-gpus.json and NVIDIA EULA.
source=("git+https://github.com/megvadulthangya/nvidia-driver-assistant.git#branch=master")
sha256sums=('SKIP')

_nvidia_repo_base='https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64'

_latest_deb_info() {
  local html latest_file ver
  html=$(curl -fsSL --retry 3 --retry-delay 2 --connect-timeout 10 "${_nvidia_repo_base}/") || return 1
  latest_file=$(echo "$html" | grep -oP 'nvidia-driver-assistant_[\d\.-]+_all\.deb' | sort -V | tail -n1)

  if [[ -z "$latest_file" ]]; then
    return 1
  fi

  ver=$(echo "$latest_file" | sed -E 's/nvidia-driver-assistant_(.*)_all\.deb/\1/')
  echo "${ver}|${latest_file}"
}

pkgver() {
  cd "${srcdir}/${pkgname}"

  local meta deb_ver git_hash
  meta="$(_latest_deb_info)" || return 1

  deb_ver="${meta%%|*}"
  deb_ver="${deb_ver//-/_}"
  git_hash="$(git rev-parse --short=10 HEAD)"

  printf '%s.g%s' "${deb_ver}" "${git_hash}"
}

prepare() {
  cd "${srcdir}"

  local meta deb_file deb_url
  meta="$(_latest_deb_info)" || return 1
  deb_file="${meta#*|}"
  deb_url="${_nvidia_repo_base}/${deb_file}"

  rm -rf "debroot"
  mkdir -p "debroot"

  echo "==> Downloading upstream DEB for assets: ${deb_file}..."
  curl -fL --retry 5 -o "upstream.deb" "${deb_url}"

  echo "==> Unpacking DEB payload..."
  bsdtar -xf "upstream.deb" -C "debroot"

  local data_tar
  data_tar=$(find "debroot" -maxdepth 1 -type f \( -name 'data.tar.*' -o -name 'data.tar' \) | head -n 1)

  if [[ -n "$data_tar" ]]; then
    bsdtar -xf "$data_tar" -C "debroot"
    rm "$data_tar"
  fi
}

package() {
  # 1. Directory structure
  install -d "${pkgdir}/usr/bin"
  install -d "${pkgdir}/usr/share/${pkgname}"
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  install -d "${pkgdir}/usr/share/licenses/${pkgname}"

  # Determine Python site-packages path
  local site_packages
  site_packages="$(python -c 'import site; print(site.getsitepackages()[0])')"
  install -d "${pkgdir}${site_packages}/nvidia_driver_assistant/data"

  # 2. Main wrapper script from git → /usr/bin/
  msg2 "Installing main script from git source..."
  install -m755 "${srcdir}/${pkgname}/nvidia-driver-assistant" \
    "${pkgdir}/usr/bin/nvidia-driver-assistant"

  # 3. Python package from git → site-packages
  #    (modules + YAML configuration data)
  msg2 "Installing Python package (nvidia_driver_assistant/)..."
  install -m644 "${srcdir}/${pkgname}/nvidia_driver_assistant/"*.py \
    "${pkgdir}${site_packages}/nvidia_driver_assistant/"
  install -m644 "${srcdir}/${pkgname}/nvidia_driver_assistant/data/"*.yaml \
    "${pkgdir}${site_packages}/nvidia_driver_assistant/data/"

  # NOTE: data/supported-gpus.json is a symlink used only for testing;
  #       the production supported-gpus.json comes from the DEB (step 5).

  # 4. Other git-sourced utilities (if present)
  if [[ -f "${srcdir}/${pkgname}/show-driver" ]]; then
    install -m755 "${srcdir}/${pkgname}/show-driver" \
      "${pkgdir}/usr/bin/nvidia-recommended-driver"
  fi

  # 5. Data files from DEB (production supported-gpus.json, icons, etc.)
  #    The CLI resolves supported-gpus.json at:
  #      /usr/share/nvidia-driver-assistant/supported-gpus/supported-gpus.json
  if [[ -d "${srcdir}/debroot/usr/share/${pkgname}" ]]; then
    cp -ra "${srcdir}/debroot/usr/share/${pkgname}"/* "${pkgdir}/usr/share/${pkgname}/"
  fi

  # 6. Documentation from git
  install -m644 "${srcdir}/${pkgname}/README.md" \
    "${pkgdir}/usr/share/doc/${pkgname}/README.md"
  install -m644 "${srcdir}/${pkgname}/docs/Configuration.md" \
    "${pkgdir}/usr/share/doc/${pkgname}/Configuration.md"
  install -m644 "${srcdir}/${pkgname}/COPYING" \
    "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # 7. Licenses from DEB (copyright + NVIDIA EULA)
  local deb_doc="${srcdir}/debroot/usr/share/doc/${pkgname}"
  if [[ -f "${deb_doc}/copyright" ]]; then
    install -m644 "${deb_doc}/copyright" "${pkgdir}/usr/share/licenses/${pkgname}/copyright"
  fi

  local eula="${srcdir}/debroot/usr/share/${pkgname}/driver_eula/LICENSE"
  if [[ -f "$eula" ]]; then
    install -m644 "$eula" "${pkgdir}/usr/share/licenses/${pkgname}/NVIDIA-EULA"
  fi
}


Update (May 19): A ready-to-test Manjaro Testing ISO is now live, fully integrating this modular YAML architecture along with the new mixed-GPU and legacy 580 fallback safeguards.
Download Latest ISO

cc: @linux-aarhus @philm — Whenever you have a spare moment to verify how the new decoupled architecture handles multi-GPU edge cases or legacy rules on real hardware, you can drop this ISO onto a flash drive and test it instantly without any local setup overhead.

5 Likes

Hi @Yochanan @philm ,

Just a quick heads-up: I’ve opened a pull request at the official NVIDIA Driver Assistant repo, incorporating the Manjaro‑specific kernel detection.
Link: Add Manjaro/Arch support (with Manjaro team contributions), GPU detection & production hardening by megvadulthangya · Pull Request #1 · NVIDIA/nvidia-driver-assistant · GitHub
If you have a moment, feel free to check it out – and thanks again for the great work!
Cheers,
Gábor