- nvidia-340-updates on Linux Mint 20.3 «Una»
- 2. Uninstall / Remove nvidia-340-updates package
- 3. Details of nvidia-340-updates package
- 4. References on Linux Mint 20.3 «Una»
- 5. The same packages on other Linux Distributions
- nvidia-340 on Linux Mint 21 «Vanessa»
- 2. Uninstall / Remove nvidia-340 package
- 3. Details of nvidia-340 package
- 4. References on Linux Mint 21 «Vanessa»
- 5. The same packages on other Linux Distributions
- Nvidia 340 linux mint
- Linux Mint Forums
- Linux Mint 19.x — How To Fix Nvidia-340 Package For Kernel 5.0.x
- Linux Mint 19.x — How To Fix Nvidia-340 Package For Kernel 5.0.x
nvidia-340-updates on Linux Mint 20.3 «Una»
Please follow the step by step instructions below to install nvidia-340-updates package:
2. Uninstall / Remove nvidia-340-updates package
Please follow the steps below to uninstall nvidia-340-updates package:
3. Details of nvidia-340-updates package
Package: nvidia-340-updates
Architecture: amd64
Version: 340.108-0ubuntu5.20.04.2
Priority: optional
Section: restricted/misc
Source: nvidia-graphics-drivers-340
Origin: Ubuntu
Maintainer: Ubuntu Core Developers
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 21
Depends: nvidia-340
Filename: pool/restricted/n/nvidia-graphics-drivers-340/nvidia-340-updates_340.108-0ubuntu5.20.04.2_amd64.deb
Size: 4892
MD5sum: f4dd7b75f046b9e92486542654c5a465
SHA1: 771bc6807c3a72d2ca120d46ca4243e65b0e2e1c
SHA256: 4e2f8df81c60091df15244ececdb771318c12a5878135e33f21154162d2639a5
SHA512: 0bef20f0d26c54e0dc179c7aac0f2f36a69789bebfc8a061c5906f4b6de42d4589501d5250ea6a162b15e3c3193378a804a992acdc10f7cf206017cabddf8c22
Description: Transitional package for nvidia-340
Description-md5: 57112f542d553ab72039643ae9695ee9
Package: nvidia-340-updates
Architecture: amd64
Version: 340.108-0ubuntu2
Priority: optional
Section: restricted/misc
Source: nvidia-graphics-drivers-340
Origin: Ubuntu
Maintainer: Ubuntu Core Developers
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 21
Depends: nvidia-340
Filename: pool/restricted/n/nvidia-graphics-drivers-340/nvidia-340-updates_340.108-0ubuntu2_amd64.deb
Size: 4888
MD5sum: d1d98a853601402c30aef40b736edf93
SHA1: 44585b9a02d69eec953fbd88bc3be79029bd5473
SHA256: 60049fce3417180f9e966c7d35f236a369a1a32897b9c674d3541c5da3d07880
Description: Transitional package for nvidia-340
Description-md5: 57112f542d553ab72039643ae9695ee9
4. References on Linux Mint 20.3 «Una»
5. The same packages on other Linux Distributions
nvidia-340-updates (340.108-0ubuntu0.18.04.1) Ubuntu 18.04 LTS (Bionic Beaver)
nvidia-340-updates (340.107-0ubuntu0.16.04.2) Ubuntu 16.04 LTS (Xenial Xerus)
nvidia-340 on Linux Mint 21 «Vanessa»
This tutorial shows how to install nvidia-340 package:
2. Uninstall / Remove nvidia-340 package
Please follow the steps below to uninstall nvidia-340 package:
3. Details of nvidia-340 package
Package: nvidia-340
Architecture: amd64
Version: 340.108-0ubuntu8
Priority: optional
Section: restricted/misc
Source: nvidia-graphics-drivers-340
Origin: Ubuntu
Maintainer: Ubuntu Core Developers
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 21
Depends: xserver-xorg-video-nouveau
Filename: pool/restricted/n/nvidia-graphics-drivers-340/nvidia-340_340.108-0ubuntu8_amd64.deb
Size: 6452
MD5sum: 75d47baa1b7bb214dea660908e2a1e72
SHA1: c6d9a3b9c7a06f3bc2067beb923ba9529db5a484
SHA256: 495def2a1675784fc5c796cfce91662f43c460119866094034c1802a9cea3929
SHA512: 34eff89b2766f75375832ce6cc67a0d3e4d543dab4ed3a3cdaf16efa3d9c1bbde515158afed362e1598430f605479079d5485e712185844c855206b47ecb2ec2
Description: Transitional package for xserver-xorg-video-nouveau
Description-md5: 72561af068042237387957ca2ea4776c
4. References on Linux Mint 21 «Vanessa»
5. The same packages on other Linux Distributions
nvidia-340 (340.108-0ubuntu0.18.04.1) Ubuntu 18.04 LTS (Bionic Beaver)
nvidia-340 (340.107-0ubuntu0.16.04.2) Ubuntu 16.04 LTS (Xenial Xerus)
nvidia-340 (340.108-0ubuntu8) Ubuntu 21.10 (Impish Indri)
nvidia-340 (340.108-0ubuntu8) Ubuntu 22.04 LTS (Jammy Jellyfish)
Nvidia 340 linux mint
First-of-all, you should make sure that you really need those proprietary drivers. If you’re happy with your current performance with Nouveau in use — just don’t touch it. Nouveau drivers are updating, while legacy proprietary drivers from NVIDIA (340.xx) aren’t.
Second-of-all, make sure that you didn’t try to install these manually via other 3rd-party PPAs or even official .run from NVIDIA (installing that requires A LOT OF EFFORT and surely the method of it’s installation is far outdated). If you did, and especially were half-way on installing .run from NVIDIA then proceed really carefully. You can end up with unbootable system, that just blinks underscore and refuses to load.
So, setup I recommend to proceed with is:
- some legacy NVIDIA videocard plugged in (like GeForce 210)
- freshly installed Linux Mint 21, without anything done with videodrivers
- bad performance with Nouveau (so you really need proprietary ones)
- driver manager not showing you proprietary NVIDIA videodrivers (cause they aren’t updating and considered legacy)
Now, let’s get started:
- Go to the NVIDIA official site and go to their driver downloader. Enter your videocard, and if you ended up with «340.xx», then you’re good and we can proceed. If it’s not, that’s not a tutorial you need.
- Add PPA with 340 drivers from kelebek333. You can do it by these commands (open your Terminal and copy-past these):
sudo add-apt-repository ppa:kelebek333/nvidia-legacy
sudo apt update
sudo apt install nvidia-340 xorg-modulepath-fix
And finally, if after installing proprietary drivers you’ll need to switch those to Nouveau (or some weird package will switch them for you on installation process) just open your Driver Manager and it will show avaivable options.
Linux Mint Forums
Linux Mint 19.x — How To Fix Nvidia-340 Package For Kernel 5.0.x
Forum rules
Don’t add support questions to tutorials please; start your own topic in the appropriate sub-forum instead. Before you post please read forum rules
Linux Mint 19.x — How To Fix Nvidia-340 Package For Kernel 5.0.x
Post by kelebek333 » Wed Mar 13, 2019 5:23 pm
This topic is no longer valid, now you can install new version from repository without any patch. New version in the repository has support for kernel 5.0 and 5.2.
2019-07-25 - Alberto Milone nvidia-graphics-drivers-340 (340.107-0ubuntu0.18.04.3) bionic; urgency=medium * debian/templates/dkms_nvidia.conf.in: debian/patches/buildfix_kernel_5.0.patch, debian/patches/buildfix_kernel_5.2.patch, debian/patches/use-kmem_cache_create_usercopy-on-4.16.patch: - Backport kernel compatibility fixes (LP: #1837834).
Nvidia-340 driver supports GF 8x, GF 9x and GT 2xx series. You can install Nvidia-340 driver from PPA with following commands.
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update sudo apt install nvidia-340 nvidia-settings
But, nvidia-340 packages in the PPA repository support up to kernel 4.20.x. You need to make a fix as follows to support kernel 5.0.x.
1. Create a patch file with following commands
sudo touch /usr/src/nvidia-340-340.107/patches/buildfix_kernel_5.0.patch
sudo xed /usr/src/nvidia-340-340.107/patches/buildfix_kernel_5.0.patch
sudo xed /usr/src/nvidia-340-340.107/patches/buildfix_kernel_5.0.patch
From 0b4e74ba61c50aefa16a4bafac3a60799eab7a20 Mon Sep 17 00:00:00 2001 From: Alberto Milone Date: Fri, 15 Feb 2019 14:43:21 +0100 Subject: [PATCH 1/1] Add support for Linux 5.0 --- Makefile | 2 ++ conftest.sh | 33 +++++++++++++++++++++++++++++++++ nv-drm.c | 12 +++++++++++- nv-time.h | 24 ++++++++++++++++++++++++ os-interface.c | 13 +++++++------ uvm/Makefile | 1 + uvm/nvidia_uvm_linux.h | 1 + uvm/nvidia_uvm_lite.c | 4 ++-- 8 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 nv-time.h diff --git a/Makefile b/Makefile index 8ac3c1a..1959dce 100644 --- a/Makefile +++ b/Makefile @@ -147,6 +147,8 @@ COMPILE_TESTS = \ vm_fault_present \ vm_fault_has_address \ drm_driver_unload_has_int_return_type \ + drm_gem_object_get \ + do_gettimeofday \ drm_legacy_pci_init \ timer_setup # diff --git a/conftest.sh b/conftest.sh index 64d75a1..fb0bf60 100755 --- a/conftest.sh +++ b/conftest.sh @@ -168,6 +168,7 @@ test_headers() < FILES="$FILES linux/sched/task.h" FILES="$FILES xen/ioemu.h" FILES="$FILES linux/fence.h" + FILES="$FILES linux/ktime.h" FILES_ARCH="$FILES_ARCH asm/set_memory.h" @@ -1971,6 +1972,38 @@ compile_test() < compile_check_conftest "$CODE" "NV_DRM_DRIVER_UNLOAD_HAS_INT_RETURN_TYPE" "" "types" ;; + drm_gem_object_get) + # + # Determine if the function drm_gem_object_get() is present. + # + CODE=" + #include + #if defined(NV_DRM_DRM_GEM_H_PRESENT) + #include + #endif + void conftest_drm_gem_object_get(void) < + drm_gem_object_get(); + >" + + compile_check_conftest "$CODE" "NV_DRM_GEM_OBJECT_GET_PRESENT" "" "functions" + ;; + + do_gettimeofday) + # + # Determine if the function do_gettimeofday() is present. + # + CODE=" + #include + #if defined(NV_LINUX_KTIME_H_PRESENT) + #include + #endif + void conftest_do_gettimeofday(void) < + do_gettimeofday(); + >" + + compile_check_conftest "$CODE" "NV_DO_GETTIMEOFDAY_PRESENT" "" "functions" + ;; + drm_legacy_pci_init) # # Determine if drm_legacy_pci_init() is present. drm_pci_init() was diff --git a/nv-drm.c b/nv-drm.c index 0eb72e4..1c968de 100644 --- a/nv-drm.c +++ b/nv-drm.c @@ -37,6 +37,16 @@ struct nv_gem_object < struct page **pages; >; +static inline void +nv_drm_gem_object_unreference_unlocked(struct nv_gem_object *nv_gem) +< +#if defined(NV_DRM_GEM_OBJECT_GET_PRESENT) + drm_gem_object_put_unlocked(&nv_gem->base); +#else + drm_gem_object_unreference_unlocked(&nv_gem->base); +#endif +> + static int nv_drm_load( struct drm_device *dev, unsigned long flags @@ -252,7 +262,7 @@ RM_STATUS NV_API_CALL nv_alloc_os_descriptor_handle( goto done; > - drm_gem_object_unreference_unlocked(&nv_obj->base); + nv_drm_gem_object_unreference_unlocked(nv_obj); status = RM_OK; diff --git a/nv-time.h b/nv-time.h new file mode 100644 index 0000000..cc828aa --- /dev/null +++ b/nv-time.h @@ -0,0 +1,24 @@ +#ifndef __NV_TIME_H__ +#define __NV_TIME_H__ + +#include "conftest.h" +#include + +#if defined(NV_LINUX_KTIME_H_PRESENT) +#include +#endif + +static inline void nv_gettimeofday(struct timeval *tv) +< +#ifdef NV_DO_GETTIMEOFDAY_PRESENT + do_gettimeofday(tv); +#else + struct timespec64 now; + + ktime_get_real_ts64(&now); + tv->tv_sec = now.tv_sec; + tv->tv_usec = now.tv_nsec/1000; +#endif +> + +#endif diff --git a/os-interface.c b/os-interface.c index 7e3d362..7190b26 100644 --- a/os-interface.c +++ b/os-interface.c @@ -13,6 +13,7 @@ #include "os-interface.h" #include "nv-linux.h" +#include "nv-time.h" RM_STATUS NV_API_CALL os_disable_console_access(void) < @@ -440,7 +441,7 @@ RM_STATUS NV_API_CALL os_get_current_time( < struct timeval tm; - do_gettimeofday(&tm); + nv_gettimeofday(&tm); *seconds = tm.tv_sec; *useconds = tm.tv_usec; @@ -475,7 +476,7 @@ RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds) #ifdef NV_CHECK_DELAY_ACCURACY struct timeval tm1, tm2; - do_gettimeofday(&tm1); + nv_gettimeofday(&tm1); #endif if (in_irq() && (MicroSeconds >NV_MAX_ISR_DELAY_US)) @@ -490,7 +491,7 @@ RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds) udelay(usec); #ifdef NV_CHECK_DELAY_ACCURACY - do_gettimeofday(&tm2); + nv_gettimeofday(&tm2); nv_printf(NV_DBG_ERRORS, "NVRM: osDelayUs %d: 0x%x 0x%x\n", MicroSeconds, tm2.tv_sec - tm1.tv_sec, tm2.tv_usec - tm1.tv_usec); #endif @@ -518,7 +519,7 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds) struct timeval tm_start; #endif - do_gettimeofday(&tm_aux); + nv_gettimeofday(&tm_aux); #ifdef NV_CHECK_DELAY_ACCURACY tm_start = tm_aux; #endif @@ -552,7 +553,7 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds) do < schedule_timeout(jiffies); - do_gettimeofday(&tm_aux); + nv_gettimeofday(&tm_aux); if (NV_TIMERCMP(&tm_aux, &tm_end, <)) < NV_TIMERSUB(&tm_end, &tm_aux, &tm_aux); @@ -574,7 +575,7 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds) udelay(MicroSeconds); >#ifdef NV_CHECK_DELAY_ACCURACY - do_gettimeofday(&tm_aux); + nv_gettimeofday(&tm_aux); timersub(&tm_aux, &tm_start, &tm_aux); nv_printf(NV_DBG_ERRORS, "NVRM: osDelay %dmsec: %d.%06dsec\n", MilliSeconds, tm_aux.tv_sec, tm_aux.tv_usec); diff --git a/uvm/Makefile b/uvm/Makefile index 42ad927..5c7b466 100644 --- a/uvm/Makefile +++ b/uvm/Makefile @@ -171,6 +171,7 @@ COMPILE_TESTS = \ kbasename \ fatal_signal_pending \ kuid_t \ + do_gettimeofday \ vm_fault_has_address MODULE_NAME:= nvidia-uvm diff --git a/uvm/nvidia_uvm_linux.h b/uvm/nvidia_uvm_linux.h index 1625209..1edb620 100644 --- a/uvm/nvidia_uvm_linux.h +++ b/uvm/nvidia_uvm_linux.h @@ -146,6 +146,7 @@ #include /* tasklets, interrupt helpers */ #include #include /* do_gettimeofday()*/ +#include "nv-time.h" #include /* do_div() */ #if defined(NV_ASM_SYSTEM_H_PRESENT) diff --git a/uvm/nvidia_uvm_lite.c b/uvm/nvidia_uvm_lite.c index 119c93a..33b8d4b 100644 --- a/uvm/nvidia_uvm_lite.c +++ b/uvm/nvidia_uvm_lite.c @@ -2019,7 +2019,7 @@ static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker, < if (!!(rmInterruptSet) && !bEccIncomingError) < - do_gettimeofday(&eccErrorStartTime); + nv_gettimeofday(&eccErrorStartTime); _set_timeout_in_usec(&eccErrorStartTime, &eccTimeout, UVM_ECC_ERR_TIMEOUT_USEC); @@ -2051,7 +2051,7 @@ static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker, // if (!!(rmInterruptSet) && (eccErrorStartTime.tv_usec != 0)) < - do_gettimeofday(&eccErrorCurrentTime); + nv_gettimeofday(&eccErrorCurrentTime); if ((eccErrorCurrentTime.tv_sec >eccTimeout.tv_sec) || ((eccErrorCurrentTime.tv_sec == eccTimeout.tv_sec) && (eccErrorCurrentTime.tv_usec >= eccTimeout.tv_usec))) -- 2.19.1
Open dkms.conf file with the following command,
sudo xed /usr/src/nvidia-340-340.107/dkms.conf
#PATCH[1]="buildfix_kernel_4.14.patch"