This document explains how to install NVIDIA GPU drivers and CUDA support, allowing integration with popular penetration testing tools.
Note that many Linux distributions provide their own packages of the NVIDIA Linux Graphics Driver in the distribution's native package management format. This may interact better with the rest of your distribution's framework, and you may want to use this rather than NVIDIA's official package. Other Privileged access to your Linux system as root or via the sudo command. The first method is the easiest to perform and in most cases it is the recommended approach. First, detect the model of your nvidia graphic card and the recommended driver. To do so execute the following command. Ubuntu Linux Install Nvidia Driver The procedure to install proprietary Nvidia GPU Drivers on Ubuntu 16.04 / 17.10, 18.04 / 18.10 is as follows: Update your system running apt-get command You can install Nvidia drivers either using GUI or CLI method. I'm on Ubuntu 16.04 and I notice that in the 'Additional Drivers' tab of 'Software & Updates', the latest versions of NVIDIA drivers I can install are version 367.57 from nvidia-367 (proprieta. If you have NVIDIA graphic card like GTX 1080 and you want to do something cool with the card you will need latest drivers. In order to install latest driver you have two ways: using Ubuntu default repository or download drivers from Ubuntu site.
Prerequisites
First, you’ll need to ensure that your system is fully upgraded and that your card supports CUDA.
Note: GPUs with a CUDA compute capability > 5.0 are recommended, but GPUs with less will still work.
Note: GPUs with a CUDA compute capability > 5.0 are recommended, but GPUs with less will still work.
Let’s determine the exact GPU installed, and check the kernel modules it’s using.
root@kali:~# lspci-v
01:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970](rev a1)(prog-if 00 [VGA controller])
Subsystem: ZOTAC International (MCO) Ltd. GM204 [GeForce GTX 970]
Region 1: Memory at e0000000 (64-bit, prefetchable)[size=256M]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [78] Express (v2) Legacy Endpoint, MSI 00
Capabilities: [600 v1] Vendor Specific Information: ID=0001 Rev=1Len=024
Kernel driver in use: nouveau
Kernel modules: nouveau
01:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970](rev a1)(prog-if 00 [VGA controller])
Subsystem: ZOTAC International (MCO) Ltd. GM204 [GeForce GTX 970]
Region 1: Memory at e0000000 (64-bit, prefetchable)[size=256M]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [78] Express (v2) Legacy Endpoint, MSI 00
Capabilities: [600 v1] Vendor Specific Information: ID=0001 Rev=1Len=024
Kernel driver in use: nouveau
Kernel modules: nouveau
Installation
Once the system has rebooted, we will proceed to install the OpenCL ICD Loader, Drivers, and the CUDA toolkit.
apt install-y ocl-icd-libopencl1 nvidia-driver nvidia-cuda-toolkit
Bitdefender problems with windows 10 version 1809. During installation of the drivers the system created new kernel modules, so another reboot is required.
Verify Driver Installation
Now that our system should be ready to go, we need to verify the drivers have been loaded correctly. We can quickly verify this by running the nvidia-smi tool.
root@kali:~# nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.26 Driver Version: 375.26|
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|++|
|0 GeForce GTX 970 Off | 0000:01:00.0 On | N/A |
|36% 46C P0 47W / 325W | 200MiB / 4036MiB |0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
||
|0692 G /usr/lib/xorg/Xorg 198MiB |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.26 Driver Version: 375.26|
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|++|
|0 GeForce GTX 970 Off | 0000:01:00.0 On | N/A |
|36% 46C P0 47W / 325W | 200MiB / 4036MiB |0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
||
|0692 G /usr/lib/xorg/Xorg 198MiB |
+-----------------------------------------------------------------------------+
With the output displaying our driver and GPU correctly, we can now dive into benchmarking. Before we get too far ahead, let’s double check to make sure hashcat and CUDA are working together.
root@kali:~# hashcat -I
OpenCL Info:
Platform ID #1
Vendor : NVIDIA Corporation
Name : NVIDIA CUDA
Version : OpenCL 1.2 CUDA 8.0.0
Device ID #1
Type : GPU
Vendor ID : 32
Vendor : NVIDIA Corporation
Name : GeForce GTX 970
Version : OpenCL 1.2 CUDA
Processor(s) : 13
Clock : 1240
Memory : 1009/4036 MB allocatable
OpenCL Version : OpenCL C 1.2
Driver Version : 375.26
OpenCL Info:
Platform ID #1
Vendor : NVIDIA Corporation
Name : NVIDIA CUDA
Version : OpenCL 1.2 CUDA 8.0.0
Device ID #1
Type : GPU
Vendor ID : 32
Vendor : NVIDIA Corporation
Name : GeForce GTX 970
Version : OpenCL 1.2 CUDA
Processor(s) : 13
Clock : 1240
Memory : 1009/4036 MB allocatable
OpenCL Version : OpenCL C 1.2
Driver Version : 375.26
It appears everything is working, let’s go ahead and run a benchmark test.
Benchmarking
root@kali:~# hashcat -b
OpenCL Platform #1: NVIDIA Corporation
* Device #1: Geforce GTX 970, 1009/4095 MB allocatable, 13MCU
Hashtype: MD5
Speed.Dev.#1...: 10443.1 MH/s
Hashtype: SHA1
Speed.Dev.#1...: 3349.8 MH/s
Hashtype: SHA256
Speed.Dev.#1...: 1321.8 MH/s
OpenCL Platform #1: NVIDIA Corporation
* Device #1: Geforce GTX 970, 1009/4095 MB allocatable, 13MCU
Hashtype: MD5
Speed.Dev.#1...: 10443.1 MH/s
Hashtype: SHA1
Speed.Dev.#1...: 3349.8 MH/s
Hashtype: SHA256
Speed.Dev.#1...: 1321.8 MH/s
There are a multitude of configurations to improve cracking speed, not mentioned in this guide. However, we encourage you to take a look at the hashcat documentation for your specific cases.
Troubleshooting
In the event setup isn’t going as planned, we’ll install clinfo for detailed troubleshooting information.
OpenCL Loaders
It may be necessary to check for additional packages that may be conflicting with our setup. Let’s first check to see what OpenCL Loader we have installed. The NVIDIA OpenCL Loader and the generic OpenCL Loader will both work for our system.
root@kali:~# dpkg-l|grep-i icd
ii nvidia-egl-icd:amd64 375.26-2 amd64 NVIDIA EGL installable client driver (ICD)
ii nvidia-opencl-icd:amd64 375.26-2 amd64 NVIDIA OpenCL installable client driver (ICD)
ii nvidia-vulkan-icd:amd64 375.26-2 amd64 NVIDIA Vulkan installable client driver (ICD)
ii ocl-icd-libopencl1:amd64 2.2.11-1 amd64 Generic OpenCL ICD Loader
ii nvidia-egl-icd:amd64 375.26-2 amd64 NVIDIA EGL installable client driver (ICD)
ii nvidia-opencl-icd:amd64 375.26-2 amd64 NVIDIA OpenCL installable client driver (ICD)
ii nvidia-vulkan-icd:amd64 375.26-2 amd64 NVIDIA Vulkan installable client driver (ICD)
ii ocl-icd-libopencl1:amd64 2.2.11-1 amd64 Generic OpenCL ICD Loader
If mesa-opencl-icd is installed run:
Since we have determined that we have a compatible ICD loader installed, we can easily determine which loader is currently being used.
Nvidia Driver For Linux Mint 19
root@kali:~# clinfo |grep-i'icd loader'
ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.11
ICD loader Profile OpenCL 2.1
ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.11
ICD loader Profile OpenCL 2.1
As expected, our setup is using the open source loader that was installed earlier. Now, let’s get some detailed information about the system.
Querying GPU Information
We’ll use nvidia-smi once again, but with a much more verbose output.
Best Nvidia Driver For Linux
root@kali:~# nvidia-smi -i0-q
Driver Version : 375.26
Attached GPUs : 1
GPU 0000:01:00.0
Product Name : GeForce GTX 970
Product Brand : GeForce
Display Mode : Enabled
Display Active : Enabled
Persistence Mode : Disabled
Accounting Mode : Disabled
Accounting Mode Buffer Size : 1920
Temperature
GPU Current Temp : 47 C
GPU Shutdown Temp : 96 C
GPU Slowdown Temp : 91 C
Clocks
Graphics : 1101 MHz
SM : 1101 MHz
Memory : 3523 MHz
Video : 1012 MHz
Processes
Process ID : 692
Type : G
Name : /usr/lib/xorg/Xorg
Used GPU Memory : 198 MiB
Driver Version : 375.26
Attached GPUs : 1
GPU 0000:01:00.0
Product Name : GeForce GTX 970
Product Brand : GeForce
Display Mode : Enabled
Display Active : Enabled
Persistence Mode : Disabled
Accounting Mode : Disabled
Accounting Mode Buffer Size : 1920
Temperature
GPU Current Temp : 47 C
GPU Shutdown Temp : 96 C
GPU Slowdown Temp : 91 C
Clocks
Graphics : 1101 MHz
SM : 1101 MHz
Memory : 3523 MHz
Video : 1012 MHz
Processes
Process ID : 692
Type : G
Name : /usr/lib/xorg/Xorg
Used GPU Memory : 198 MiB
It looks like our GPU is being recognized correctly, so let’s use glxinfo to determine if 3D Rendering is enabled.
root@kali:~# glxinfo |grep-i'direct rendering'
direct rendering: Yes
direct rendering: Yes
The combination of these tools should assist the troubleshooting process greatly. If you still experience issues, we recommend searching for similar setups and any nuances that may affect your specific system.
Active1 year ago
I'm on Ubuntu 16.04 and I notice that in the 'Additional Drivers' tab of 'Software & Updates', the latest versions of NVIDIA drivers I can install are
- version 367.57 from nvidia-367 (proprietary)
- version 370.28 from nvidia-370 (open source)
Latest Nvidia Driver For Linux Mint
![Linux Linux](/uploads/1/2/4/9/124907745/176300218.jpg)
Aside from the fact that I don't know what 'proprietary' and 'open source' mean here, I also don't see an option to select the driver version based on my actual graphics card. I'm using GTX 1080 and the current Long Lived Branch version is 375.20; will the Ubuntu graphics PPA be updated eventually, or will I have to manually install 375?
Zizheng TaiZizheng Tai
5 Answers
I cant find any reference to support in
jockey
for nVidia 375 yet. But the manual installation isn't as difficult as you might think.Official Instructions
- Download the driver version 375.20 from here
$ chmod 777 NVIDIA-Linux-x86_64-375.20.run
$ sudo sh NVIDIA-Linux-x86_64-375.20.run
$ sudo apt-get update
$ sudo apt-get upgrade
Install via PPA
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt update
Potential Issues
- Black screen on startup - Add nomodeset to grub - see this answer
- Removing nVidia Drivers - Purge - see this answer
Addendum to the Login Loop issue, via @michael__treat :
Make sure that secure boot is disabled in Windows Boot Manager. The walk-through from Ubuntu may be incomplete. During testing, I found that I had to use the Windows System Boot Manager, and manually disable secure boot.
This solved the login loop issue in my case.
TL;DR: Make sure secure boot is actually turned off.
- When you reach grub, go to windows boot manager
- Press e
- change secureboot from
enabled
todisabled
3,67111 gold badge1111 silver badges3434 bronze badges
If you want to use
CUDA
(nVidia's stuff for executing functions on the GPU), you should use the proprietary driver.If you want to use
OpenCL
(something like CUDA, developed by Khronos), you have to use the open source driver.To install latest drivers add
PPA
:Now, find
Software & Updates
under System Settings
and select the required driver version form the Additional Drivers
tab, select the driver and click Apply Changes
. Restart and Enjoy!PS: Sometimes the best driver version doesn't seem to work well, so you must check whether you're enjoying all the functionalities provided and whether it contain bugs and please do check whether
Zannanvidia-prime
Apache attack helicopter for sale. is installed because it comes handy in most of the situations where bugs lead to a black screen. 53.5k1515 gold badges150150 silver badges251251 bronze badges
mohitR0_0mohitR0_0
$ sudo add-apt-repository ppa:graphics-drivers/ppa$ sudo apt update
This is the best solution.Do this and update the nvidia driver and it works with 4.13 kernelsNvidia 340.104 works with kernel 4.13 without problems. I tested it on Peppermint 8 respin
Robert RadacRobert Radac
I was successful updating Asus NVIDIA 1080 8 GB GPU drivers for Ubuntu 16.04 with the CUDA Toolkit:
Reboot then proceed with the following:
I lifted the aforementioned from Changjiang's blog, which primes your build for Deep Learning if you're so inclined. :D
alexanderjsingletonalexanderjsingleton
Recently I found it more convenient to use the proprietary drivers. The next question is, which version? There is a systematic approach to installing the most appropriate driver, which may or not may be the latest version. I wrote the annotated installation guide in this article. The steps in brief are as follows.
- Go to NVIDIA driver download page.
- Lightroom free download full version. Provide the OS information, graphics card model, and CUDA toolkit version and perform Search.
- In the search result page, the recommended driver version will be displayed. Keep it as a reference.
- After adding the private NVIDIA ppa repository, update the apt index.$ sudo apt-get update
- Search the available drivers from the apt cache$ sudo apt-cache search nvidia | grep -E 'nvidia-[0-9]{3}'
- From the list, install the version recommended by NVIDIA (may not be the latest). For version 390, the install command will be as simple as:$ sudo apt-get install nvidia-390
- Reboot the system and check the driver version with nvidia-smi command
MikeMike