Problems in the construction of CUDA environment (GPU parallel programming)

Installation environment: ubuntu14.04 + Hasee k550-i7 d1. Unique display: Nvidia GTX950. There’s also an integrated graphics card.
1. Install the cuda
1. Download CUDa Toolkit from nvidia official website, such as download runFile type. Installation steps. Complete the selection according to resources:

    Run ‘sudo sh cuda_8.0.61_375.26_linux.run’ Follow the command-line prompts

2. Since the Nouveau driver (nvidia open source driver) is installed by default on Linux system, it will conflict with cudA drivers, so nouveau driver needs to be disabled. Follow Resources -4.1.2.2. Runfile Installer.

Q1: After installing CUDA environment in accordance with the tutorial, the sample can be compiled, but it cannot be run. If the error is reported, the driver version is invalid for the running version. If the driver is replaced, the screen will be black. The reason is that my laptop is a dual graphics card and requires nvidia-Prime to perform the default driver selection. When the DPKG has Nvidia-Settings, it can also be executed to switch.
After installing Nvidia-Prime and Nvidia-Settings, it is found that the default driver is Nouveau. If the manual change is invalid, nouveau will be selected automatically. Changing Blacklist.conf to add it to the blacklist is also invalid, so the problem becomes how to disable nouveau driver and use the installed Nvidia driver.

List of questions:
Insufficient RUNNING of compiled CUDa sample: Cuda driver version is insufficient for CUDa runtime version
2. Download the new CUDA8.0 installation file and check checksum to be inconsistent. damn
3. My N card and integrated video card cannot be identified in the nvidia-Settings installation.

Reinstall 1. Change the default driver to X.Org Xserver(in system Settings -> Software and updates -& GT; Additional drive; Or search driver – & gt; As you can see, it should be set to Nouveau.
2. Switch to command line mode (CTRL + Alt +f1, aka tty1),log in; Sudo Service LightDM Restart. if restart to lightdm,open a terminal and use the next step,if not,use tty1, as before;

3. Delete Nvidia related files.

sudo apt-get remove –purge nvidia-*
4. Check for nvidia related file residue

DPKG –get-selection | grep nvidia ensures there are no nvidia residues

5. Look at the additional drivers again and select the one that is most available.

6.go back to tty1 and issue sudo service lightdm restart, lightdm should restart and you should have the latest driver, for your system.

___

7. Because my laptop is a dual video card, which is a very painful thing, I need to install nvidia-prime and nvidia-settings to switch the video card. (During installation, go to YouTube and listen to Linus say it again: “So fuck you, Nividia!” )

Note: another way mentioned to disable nouveau is to change the boot mode in grub. To:

edit /etc/default/grub file.

—-

the For Ubuntu 12.04 the setting is stored in/etc/default/grub. You add it to the line titled GRUB_CMDLINE_LINUX_DEFAULT. If the line says:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”

you would change it to:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash nomodeset”

After adding NOMODESET to this line you should run sudo update-grub to allow grub2 to see it the next time you boot.

——

### error message after changing the use of video card in nvidia-settings:

ERROR: NVIDIA driver is not loaded

ERROR: Error querying enabled displays on GPU 0 (Missing Extension).

ERROR: Error querying connected displays on GPU 0 (Missing Extension).

** Message: PRIME: Requires offloading

** Message: PRIME: is it supported?yes

ERROR: nvidia-settings could not find the registry key file. This file should

have been installed along with this driver at

/usr/share/nvidia/nvidia – application profiles – key – documentation. The

application profiles will continue to work, but values cannot be

prepopulated or validated, and will not be listed in the help text.

Please see the README for possible values and descriptions.

execute prime-select query to get information: unknow

finally passed
Prime -select Nvidia completed the selection of N card compiled to run CUDA samples through.

— — –

Cuda installation verifies the pre-installation conditions, such as whether the GPU is supported, whether the OS is supported, etc. It should be noted that this machine is a dual graphics card, which is specifically mentioned in the installation tutorial:

If the target system includes both an integrated GPU (iGPU) and a discrete GPU

(dGPU),
the –no-opengl-libs option must be used. Otherwise, the openGL library used

by the graphics driver of the iGPU will be overwritten and the GUI will not work. In

addition, the xorg.conf update at the end of the installation must be declined.

installation files: cuda-tookit and Nvidia drivers and official files are in the removable hard drive.

reference tutorial:

1. Runfile installation and disable nouveau driver: http://blog.csdn.net/masa_fish/article/details/51882183


Read More: