Package Base Details: nvidia-340xx

Git Clone URL: https://aur.archlinux.org/nvidia-340xx.git (read-only, click to copy)
Submitter: simonsmh
Maintainer: JerryXiao
Last Packager: JerryXiao
Votes: 70
Popularity: 0.21
First Submitted: 2019-06-07 10:29 (UTC)
Last Updated: 2024-03-17 06:41 (UTC)

Pinned Comments

JerryXiao commented on 2022-10-13 03:51 (UTC) (edited on 2022-10-14 02:44 (UTC) by JerryXiao)

For testing users, contributors: check out https://github.com/archlinux-jerry/nvidia-340xx
Warning: force push may happen to match the aur tree

Latest Comments

« First ‹ Previous 1 .. 10 11 12 13 14 15 16 17 18 19 20 .. 55 Next › Last »

mauzil commented on 2022-02-18 17:48 (UTC) (edited on 2022-02-20 08:39 (UTC) by mauzil)

[Solved with kernel 5.16.10-artix1-1]

Hi all. In Artix with latest update I get this error

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (GCC) 11.2.0
  You are using:           cc (GCC) 11.2.0
make -f ./scripts/Makefile.build obj=/home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel \
single-build= \
need-builtin=1 need-modorder=1
  cc -Wp,-MMD,/home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel/.nv.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-stack-clash-protection -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -g -gdwarf-4 -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin-arg-structleak_plugin-byref-all -DSTRUCTLEAK_PLUGIN -DNV_MODULE_INSTANCE=0 -DNV_BUILD_MODULE_INSTANCES=0 -UDEBUG -U_DEBUG -DNDEBUG -I/home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel -Wall -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"340.108\" -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -DNV_UVM_ENABLE -D__linux__ -DNV_DEV_NAME=\"nvidia\"  -DMODULE  -DKBUILD_BASENAME='"nv"' -DKBUILD_MODNAME='"nvidia"' -D__KBUILD_MODNAME=kmod_nvidia -c -o /home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel/nv.o /home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel/nv.c  ; ./tools/objtool/objtool orc generate  --module  --no-fp   --retpoline  --uaccess  /home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel/nv.o
cc1: error: incompatible gcc/plugin versions
cc1: error: failed to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
make[2]: *** [scripts/Makefile.build:287: /home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel/nv.o] Errore 1
make[1]: *** [Makefile:1846: /home/mauro/Scaricati/Artix/nvidia-340xx/src/NVIDIA-Linux-x86_64-340.108-no-compat32/kernel] Errore 2
make[1]: uscita dalla directory «/usr/lib/modules/5.16.8-artix1-2/build»
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [Makefile:202: nvidia.ko] Errore 1

DAC324 commented on 2022-02-18 08:22 (UTC) (edited on 2022-02-18 09:53 (UTC) by DAC324)

@norambna: Manjaro is different from Arch (as you already have encountered). For Manjaro, use this PKGBUILD (you will have to edit the _linuxprefix and _extramodules variables to match the kernel version you are using):

# Based on the Arch file by:
# Maintainer: graysky <graysky AT archlinux DOT us>
# Maintainer: Jerry Xiao <aur@mail.jerryxiao.cc>
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>

# Maintainer: Philip Müller <philm@manjaro.org>
# Maintainer: Roland Singer <roland@manjaro.org>

_linuxprefix=linux516
_extramodules=extramodules-5.16-MANJARO
pkgname=(nvidia-340xx-dkms)
_pkgname=nvidia
pkgver=340.108
pkgrel=29
provides=("$_pkgname=$pkgver")
groups=("$_linuxprefix-extramodules")
pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
arch=('i686' 'x86_64')
url="http://www.nvidia.com/"
depends=(
         "$_linuxprefix"
         "nvidia-340xx-utils=${pkgver}"
         )
makedepends=("$_linuxprefix-headers")
conflicts=('nvidia-96xx' 'nvidia-183xx' "$_linuxprefix-nvidia" "$_linuxprefix-nvidia-304xx")
license=('custom')
options=(!strip)
# https://github.com/warpme/minimyth2/tree/master/script/nvidia/nvidia-340.108/files
source=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
  20-nvidia.conf
  0001-kernel-5.7.patch
  0002-kernel-5.8.patch
  0003-kernel-5.9.patch
  0004-kernel-5.10.patch
  0005-kernel-5.11.patch
  0006-kernel-5.14.patch
  0007-kernel-5.15.patch
  0008-kernel-5.16.patch
)
b2sums=('6538bbec53b10f8d20977f9b462052625742e9709ef06e24cf2e55de5d0c55f1620a4bb21396cfd89ebc54c32f921ea17e3e47eaa95abcbc24ecbd144fb89028'
        '49d99f612e8eee3ab5e34083c25348bfd14ed5fc8a7984dafc0dad7c0ae0df2c0b2a63a1bb993da440eb0a60293d7c753ca3889bd2f51991b8ddc51bce2fe4a8'
        '7150233df867a55f57aa5e798b9c7618329d98459fecc35c4acfad2e9772236cb229703c4fa072381c509279d0588173d65f46297231f4d3bfc65a1ef52e65b1'
        'b436095b89d6e294995651a3680ff18b5af5e91582c3f1ec9b7b63be9282497f54f9bf9be3997a5af30eec9b8548f25ec5235d969ac00a667a9cddece63d8896'
        '947cb1f149b2db9c3c4f973f285d389790f73fc8c8a6865fc5b78d6a782f49513aa565de5c82a81c07515f1164e0e222d26c8212a14cf016e387bcc523e3fcb1'
        '665bf0e1fa22119592e7c75ff40f265e919955f228a3e3e3ebd76e9dffa5226bece5eb032922eb2c009572b31b28e80cd89656f5d0a4ad592277edd98967e68f'
        '344cd3a9888a9a61941906c198d3a480ce230119c96c72c72a74b711d23face2a7b1e53b9b4639465809b84762cdc53f38210e740318866705241bc4216e4f35'
        '31a4047ab84d13e32fd7fdbf9f69c696d3fab6666c541d2acf0a189c1d17c876970985167fd389a4adc0f786021172bdec1aa6d690736e3cf9fcd8ceabe5fd32'
        'b3b7bbd597252b25ccb68f431f83707a10d464996f6c74bb67143795df96054da719faf09c1ad2e1c215261356833ad3fa0d9e60552151f827f9d7be7ae44605'
        'caedc5651bfd14c02fb677f9c5e87adef298d871c6281b78ce184108310e4243ded82210873014be7fedee0dd6251305fa9bbce0c872b76438e0895ef76109d9')
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"

[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"

prepare() {
    # Remove previous builds
    [ -d "$_pkg" ] && rm -rf "$_pkg"
    sh "${_pkg}.run" --extract-only
    cd "${_pkg}"
    # patches here

  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = 0*.patch ]] || continue
    echo "Applying patch $src..."
    patch -Np1 < "../$src"
  done

    cd kernel
    sed -i "s/__VERSION_STRING/${pkgver}/" dkms.conf
    sed -i 's/__JOBS/`nproc`/' dkms.conf
    sed -i 's/__DKMS_MODULES//' dkms.conf
    sed -i '$iBUILT_MODULE_NAME[0]="nvidia"\
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\
BUILT_MODULE_NAME[1]="nvidia-uvm"\
DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\
BUILT_MODULE_NAME[2]="nvidia-modeset"\
DEST_MODULE_LOCATION[2]="/kernel/drivers/video"\
BUILT_MODULE_NAME[3]="nvidia-drm"\
DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf

    # Gift for linux-rt guys
    sed -i 's/NV_EXCLUDE_BUILD_MODULES/IGNORE_PREEMPT_RT_PRESENCE=1 NV_EXCLUDE_BUILD_MODULES/' dkms.conf

    cd ..
    cp -a kernel kernel-dkms
}

build() {
    _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"

    cd "${_pkg}"/kernel
    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module

    cd uvm
    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
}

package_nvidia-340xx-dkms() {
    pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
    depends=('dkms' "nvidia-340xx-utils=$pkgver" 'libgl')
    optdepends=('linux-headers: Build the module for Manjaro kernel')
    provides=("nvidia-340xx=$pkgver")
    conflicts+=('nvidia-340xx')
    install=nvidia-340xx.install

    cd "${_pkg}"

    install -dm 755 "${pkgdir}"/usr/src
    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}/usr/src/nvidia-${pkgver}"

    echo "blacklist nouveau" |
        install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"

  install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/usr/share/nvidia-340xx/20-nvidia.conf"
}

# vim:set ts=2 sw=2 et:

norambna commented on 2022-02-17 13:42 (UTC) (edited on 2022-02-17 15:02 (UTC) by norambna)

I'm running a fresh install of Manjaro KDE, Kernel 5.10, Plasma 5.23.5 on a late 2008 Macbook that comes with a GeForce 9400M. When trying to install this package it stops with this error:

==> Starting build()...
NVIDIA: calling KBUILD...
make[1]: *** /usr/src/linux: No such file or directory.  Stop.
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [Makefile:202: nvidia.ko] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

Any hints how to solve this? Thanks in advance.

edit: It seems this comment has the solution to this problem!

pissbrain commented on 2022-02-16 03:04 (UTC)

Can confirm, you do need to reinstall the drivers after the recent gcc update

airgap97 commented on 2022-02-15 21:16 (UTC) (edited on 2022-02-16 00:31 (UTC) by airgap97)

it does not work after update [gcc] [toolchain]

upd : you need to reinstall all the drivers (nvidia-utils, opencl-nvidia), so they pick up the new version of gcc.

bigjuck commented on 2022-01-15 11:28 (UTC)

Thanks to all keeping the package working with new kernels

Viterzgir commented on 2022-01-12 23:23 (UTC)

Patch for kernel 5.16 https://pastebin.com/8bhF3kcj or full archive with PKGBUILD https://www.upload.ee/files/13789758/nvidia-340xx.tar.gz.html

DAC324 commented on 2022-01-04 13:28 (UTC) (edited on 2022-01-04 13:49 (UTC) by DAC324)

0007-kernel-5.15.patch seems to contain DOS instead of Unix line breaks, causing patch to spit out the following:

(Stripping trailing CRs from patch; use --binary to disable.)
patching file kernel/nv-drm.c
patch unexpectedly ends in middle of line

For everybody who prefers avoiding such issues, a command like

sed -i.bak 's/\r$//' 0007-kernel-5.15.patch 

or, alternatively,

echo "$(tr -d '\r' < 0007-kernel-5.15.patch)" > 0007-kernel-5.15.patch

might help. Of course, the checksum in PKGBUILD has to be corrected accordingly.

soylent commented on 2022-01-02 08:32 (UTC)

Thanks for keeping the package up to date! I appreciate it a lot!