Ubuntu16.04+nvidia Gt240m+cuda 6.5 Configuration

Source: Internet
Author: User
Tags nvcc

This configuration is only a test configuration, it is estimated that with this type of graphics card to do parallel computing almost no, but the configuration method, a lot of it is worth borrowing, and ultimately want to apply in GEANT4 parallel computing.

All right, ladies and gentlemen, I'm starting to play.

First, if you have failed to install many times, then make sure that you have uninstalled the existing graphics drivers and Cuda

1. If you have already installed Cuda-related, and unsuccessful (do not see this success), please see below related, if not installed, please skip 1.1 uninstall the relevant files

In the table of contents (for example, cuda7.0 version):

/usr/local/cuda-7.0/bin

Cuda comes with the uninstall tool uninstallCudatoolkit_7.0.pl, using the command:

shell sudo ./uninstall_cuda_toolkit_7.0.pl

Uninstall the original NVIDIA driver:

shell sudo apt-get remove nvidia*

Uninstalling Nvidia in this way can cause the graphical interface to become thicker and larger (you know, hehe). Another way to unload is to be gentle:

shell sudo apt-get remove --purge nvidia-*

sudo apt-get install ubuntu-desktop

sudo rm /etc/X11/xorg.conf echo ‘nouveau‘ | sudo tee -a /etc/modules

1.2 If it's not as troublesome, re-install the system, save time and effort

How to install, please self-search ha, do not repeat.

2. Install driver 2.1 Download graphics driver

Http://www.nvidia.com/Download/index.aspx?lang=en-us

My test card is relatively low, the gods do not spray, a look, lying trough, but also with the 200M series, too rubbish. Cough, um, I'm doing a record of the configuration process. (Smiling face), after a picture is downloaded, it should be a file like this Nvidia-linux-x86_64-340.104.run

-340.104 version number, generally use XXX to express, your xxx and my, other people may not be the same, so do not side.

2.2 Turn off Ubuntu's graphical interface

On the command line, enter

sudo service lightdm stop

2.3 Add executable permissions to XXX

chmod +x NVIDIA-Linux-x86_64-340.104.runNote XXX may not be the same yo, do not copy directly

2.4 Execution

./NVIDIA-Linux-x86_64-340.104.runWhen installing, do not install 32bit Library, only this one chooses the right that no, is 32 bit of that Kochhar, do not choose, the rest chooses left.

2.5 After installing the driver, test

nvidia-smi

As shown, it proves that you have installed the driver successfully:

Do you find that there is a not supported, no side, the master told you no matter.

2.6 Update Grub

sudo echo ‘GRUB_CMDLINE_LINUX="nomodeset"‘ >> /etc/default/grub

sudo update-grub sudo nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration

2.7 reboot

Open graphical interface sudo service lightdm start not much to say, do not want to see the beauty of mosaic can not open

3 Installation cuda3.1 Of course, it was downloaded first, which is also used to say

Come on, the website is here, I am under the cuda6.5, test success, interested or the graphics card, you can choose a high version. Https://developer.nvidia.com/cuda-downloads Choose the right version oh, don't choose too high, unless you buy a new tens of thousands of new graphics card.

3.2 Installation

My Cuda version name is such a cuda6.5.14linuxaarch64native.run so you follow your own version of the download to compare.

./cuda_6.5.14_linux_aarch64_native.runSkip the front to see, you can press the space, you can also CTRL + C, according to the prompt, all agree on the good.

3.3 Adding environment variables

sudo usermod -a -G video $USER

echo "" >> ~/.bashrc

echo "export PATH=/usr/local/cuda-6.5/bin:$PATH" >> ~/.bashrc

echo "export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc

3.4 and then restart

sudo shutdown -r now

3.5 gcc downgrade (quite important)

The GCC version of 16,04 may be too high, not suitable for cuda6.5 or nearby versions, so lower the GCC version level

3.5.1, of course, is to download gcc.

The gcc--4.7 version is downloaded here.

sudo apt-get install gcc-4.7 g++-4.7

3.5.2 Changing to Cuda's path

cd /usr/local/cuda/binThe path may be different, also do not copy said, find the Cuda and cuda-6.5 place is good

3.5.3 in the bin file, create a new GCC folder and connect the relevant GCC

sudo su

mkdir gcc

cd gcc

ln -s /usr/bin/gcc-4.4 gcc

ln -s /usr/bin/cpp-4.4 cpp

ln -s /usr/bin/g++-4.4 g++

exitNote Yo, enter exit, child Ah, the current directory ha, don't get the wrong directory, should still be in the/usr/local/cuda/bin directory

3.5.4 increasing the variation path of NVCC

sudo su

echo "compiler-bindir = /opt/cuda/bin/gcc" >> nvcc.profile

exit

3.5.5

and reboot.

sudo reboot

4 Here's the end, let's start the test.

There is a devicequery example under the catalogue/usr/local/cuda/samples/1_utilities/devicequery, just test it, and you'll succeed.

Of course, you can also test other examples, such as this path under/usr/local/cuda/samples/3_imaging/boxfilter

In this example there is a woman, a will be very beautiful, a will with a dozen mosaic as vague, probably can learn, understand, haha

All right, Belle, it's time to do something, compile the GPU version of GEANT4.

(Stretch, good sleepy) tomorrow in the mutation it, yuck, wrong, this morning in the compilation bar, sleep ~ ~

Ubuntu16.04+nvidia Gt240m+cuda 6.5 configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.