Ubuntu 16.04 Installs Nvidia Driver & Installs cuda &&?

Keywords: sudo Ubuntu Linux

Reference Link 1: Ubuntu Series Switches Intel and NVIDIA graphics cards (pits I encountered on Linux graphics cards)


Reference link 3:


1. Install Nvidia graphics card driver, reference link 1

  • Distinguish from reference links:
  1. The software update interface is different. There are no unknown rows below.
 sudo ubuntu-drivers devices also did not have cpu-microcode.pyde>
sudo apt-get install nvidia-384 (my model) nvidia-prime nvidia-settings
2. Statement switching is not good
prime-select intel
prime-select nvidia
What software updates really do have the interface that appears after nvidia-settings is ok, which can change state every time it logs in and out

  • Different from some other installation methods:
link This person installs the NVIDIA driver by disabling it first and then opening it. The result is that nvidia-settings can be opened almost anyway.
There are two differences:
1) It shouldn't matter if I turn on nvidia without disabling nouveau or something like that. It automatically cancels.
2)sudo service lightdm start and sudo service lightdm stop are operations I haven't done, that is to say, I have not changed in the graphics system, just log in and out when changing the system. I don't need to think too much about them for the time being. Maybe they have the same effect.

Links: Installation Configuration Caffe(GPU version) The second step here is to install NVIDIA driver. It is necessary to disable and close the graphical interface when downloading the run file installation, but sudo nvidia-smi can list the GPU information list ok!!!

  • lspci parameters on my computer
<span face="Source Code Pro, Consolas, Menlo, Monaco, Courier New, Monspace" style="line-height: 28px;">NVIDIA interface: My computer is automatically expanded every time I log in.
00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04) (prog-if 00 [VGA controller])
	Subsystem: Lenovo Device 505e
	Flags: bus master, fast devsel, latency 0, IRQ 128
	Memory at f0000000 (64-bit, non-prefetchable) [size=16M]
	Memory at e0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at e000 [size=64]
	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)
	Subsystem: Lenovo GM108M [GeForce 940MX]
	Flags: bus master, fast devsel, latency 0, IRQ 131
	Memory at f1000000 (32-bit, non-prefetchable) [size=16M]
	Memory at c0000000 (64-bit, prefetchable) [size=256M]
	Memory at d0000000 (64-bit, prefetchable) [size=32M]
	I/O ports at d000 [size=128]
	Capabilities: <access denied>
	Kernel driver in use: nvidia(Changed)
	Kernel modules: nvidiafb, nouveau, nvidia_384_drm, nvidia_384
The difference between the two depends on NVidia's belief that it is not a VGA adapter and that it needs only hardware acceleration through intel transmission; another argument is that independent graphics cards are installed on integrated graphics cards and cannot work independently.
When intel works:
VGA compatible controller: Intel Corporation Device 591b (rev 04) (prog-if 00 [VGA controller])
	Subsystem: Lenovo Device 505e
	Flags: bus master, fast devsel, latency 0, IRQ 128
	Memory at f0000000 (64-bit, non-prefetchable) [size=16M]
	Memory at e0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at e000 [size=64]
	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev ff) (prog-if ff)
	!!! Unknown header type 7f
	Kernel modules: nvidiafb, nouveau, nvidia_384_drm, nvidia_384


Installation of cuda (Reference Link 2)

Find the path to download the file (mine is in / home/zbq/append extended memory, otherwise there is no space)
sudo sh cuda_9.0.176_384.81_linux.run
  • Difference:
I installed / home/zbq/append/cuda/install with a default parameter. Whether to add sympolic links to / usr/local/cuda I cancelled so there are many remedies.
1) Installation directory of / etc/profile
export  PATH=/home/zbq/append/cuda/install/bin:$PATH
export  LD_LIBRARY_PATH=/home/zbq/append/cuda/install/lib64$LD_LIBRARY_PATH  
The end of the environment variable written to ~/. bashrc is the same as this
2) The location of the CUDA example changed and the operation was successful.
When setting environment variables and dynamic link libraries, you need to use
/ usr/local/cuda/bin and / usr/local/cuda/lib64 I have copied it from / home/zbq/append/cuda/install / so simply in / usr/local / create a new cuda folder and then sudo chmod 777 /usr/local/cuda / copy things over

Record:
Driver:   Not Selected
Toolkit:  Installed in /home/zbq/append/cuda/install
Samples:  Installed in /home/zbq/append/cuda/samples

Please make sure that
 -   PATH includes /home/zbq/append/cuda/install/bin
 -   LD_LIBRARY_PATH includes /home/zbq/append/cuda/install/lib64, or, add /home/zbq/append/cuda/install/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /home/zbq/append/cuda/install/bin

Please see CUDA_Installation_Guide_Linux.pdf in /home/zbq/append/cuda/install/doc/pdf for detailed information on setting up CUDA.

***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 9.0 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run -silent -driver

Logfile is /tmp/cuda_install_13680.log

Posted by miltonos on Wed, 12 Dec 2018 22:48:06 -0800