CONSIDER USING CUDA???
FROM THIS: https://en.wikipedia.org/wiki/CUDA, MY GPU Nvidia GeForce GT 520M IS SUPPORTED!!! Micro Architecture Fermi (https://en.wikipedia.org/wiki/Fermi_(microarchitecture)) version 2.1
CHECK CUDA FROM TERMINAL:
ref:http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/#axzz44a7lZNcT
|
1 2 3 |
teddy@teddy-K43SJ:~$ lspci | grep -i nvidia 01:00.0 VGA compatible controller: NVIDIA Corporation GF119M [GeForce GT 520M] (rev a1) 01:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1) |
INSTALLING CUDA TOOLKIT 7.5 ON UBUNTU 14.04
ref:http://www.r-tutor.com/gpu-computing/cuda-installation/cuda7.5-ubuntu
https://www.quantstart.com/articles/Installing-Nvidia-cuda-on-Ubuntu-14-04-for-Linux-GPU-Computing
https://developer.nvidia.com/cuda-downloads -> Linux -> x86_64 -> Ubuntu -> 14.04 -> deb(local)
http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
(1.9 GB)
1. The first task is to make sure that you have the GNU compiler collection (GCC) tools installed. This is carried out by installing the build-essential package:
|
1 |
teddy@teddy-K43SJ:~$ sudo apt-get install build-essential |
2. Download the latest Cuda toolkit:
Manually FROM:
http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
OR:
|
1 2 |
teddy@teddy-K43SJ:~$ cd ~/Downloads/ teddy@teddy-K43SJ:~/Downloads$ wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb |
3. PREPARE THE PACKAGE:
|
1 2 3 4 5 6 7 |
teddy@teddy-K43SJ:~/Downloads$ sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb [sudo] password for teddy: Selecting previously unselected package cuda-repo-ubuntu1404-7-5-local. (Reading database ... 511757 files and directories currently installed.) Preparing to unpack cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb ... Unpacking cuda-repo-ubuntu1404-7-5-local (7.5-18) ... Setting up cuda-repo-ubuntu1404-7-5-local (7.5-18) ... |
OK
4. Update
|
1 |
teddy@teddy-K43SJ:~/Downloads$ sudo apt-get update |
5. INSTALL CUDA:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
teddy@teddy-K43SJ:~/Downloads$ sudo apt-get install cuda Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: gnome-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed Depends: libcheese7 (>= 3.0.1) but it is not going to be installed unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed Depends: libcheese7 (>= 3.0.1) but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. |
SOLUTION:
ref:http://askubuntu.com/questions/672047/anyone-has-successfully-installed-cuda-7-5-on-ubuntu-14-04-3-lts-x86-64
|
1 |
teddy@teddy-K43SJ:~/Downloads$ sudo apt-get install libglew-dev libcheese7 libcheese-gtk23 libclutter-gst-2.0-0 libcogl15 libclutter-gtk-1.0-0 libclutter-1.0-0 |
RUN AGAIN:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
teddy@teddy-K43SJ:~/Downloads$ sudo apt-get install cuda ... *** LICENSE AGREEMENT *** By using this software you agree to fully comply with the terms and conditions of the EULA (End User License Agreement). The EULA is located at /usr/local/cuda-7.5/doc/EULA.txt. The EULA can also be found at http://docs.nvidia.com/cuda/eula/index.html. If you do not agree to the terms and conditions of the EULA, do not use the software. Setting up nvidia-352-uvm (352.39-0ubuntu1) ... Setting up nvidia-352-dev (352.63-0ubuntu0.14.04.1) ... Setting up nvidia-modprobe (352.39-0ubuntu1) ... Setting up cuda-drivers (352.39-1) ... Setting up cuda-runtime-7-5 (7.5-18) ... Setting up cuda-7-5 (7.5-18) ... *** LICENSE AGREEMENT *** By using this software you agree to fully comply with the terms and conditions of the EULA (End User License Agreement). The EULA is located at /usr/local/cuda-7.5/doc/EULA.txt. The EULA can also be found at http://docs.nvidia.com/cuda/eula/index.html. If you do not agree to the terms and conditions of the EULA, do not use the software. ***************************************************************************************** *** Please reboot your computer and verify that the nvidia graphics driver is loaded. *** *** If the driver fails to load, please use the NVIDIA graphics driver .run installer *** *** to get into a stable state. *** ***************************************************************************************** Setting up cuda (7.5-18) ... *** LICENSE AGREEMENT *** By using this software you agree to fully comply with the terms and conditions of the EULA (End User License Agreement). The EULA is located at /usr/local/cuda-7.5/doc/EULA.txt. The EULA can also be found at http://docs.nvidia.com/cuda/eula/index.html. If you do not agree to the terms and conditions of the EULA, do not use the software. Processing triggers for libc-bin (2.19-0ubuntu6.7) ... |
6. REBOOT
7. MODIFY ENVIRONMENT VARIABLES:
As part of the CUDA environment, you should add the following in the .bashrc file of your home folder.
|
1 |
teddy@teddy-K43SJ:~$ sudo gedit ~/.bashrc |
ADD THESE LINES AT THE BOTTOM:
|
1 2 3 4 5 6 7 |
... #NVIDIA CUDA ENVIRONMENT VARIABLES export CUDA_HOME=/usr/local/cuda-7.5 export LD_LIBRARY_PATH=${CUDA_HOME}/lib64 PATH=${CUDA_HOME}/bin:${PATH} export PATH |
THEN SAVE AND CLOSE!
8. Remember to make sure that the terminal has access to these variables:
|
1 |
teddy@teddy-K43SJ:~$ source ~/.bashrc |
9. Before proceeding to test the GPU cards we will ensure that the drivers are correctly installed. The following line will provide us with the driver version:
|
1 2 3 |
teddy@teddy-K43SJ:~$ cat /proc/driver/nvidia/version NVRM version: NVIDIA UNIX x86_64 Kernel Module 352.63 Sat Nov 7 21:25:42 PST 2015 GCC version: gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1) |
10. Check the version of the Nvidia CUDA compiler:
|
1 2 3 4 5 |
teddy@teddy-K43SJ:~$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2015 NVIDIA Corporation Built on Tue_Aug_11_14:27:32_CDT_2015 Cuda compilation tools, release 7.5, V7.5.17 |
TRY THE CUDA 7.5 SAMPLES:
1. Copy the samples into /home/teddy/Documents/
|
1 2 3 |
teddy@teddy-K43SJ:~$ cuda-install-samples-7.5.sh /home/teddy/Documents/ Copying samples to /home/teddy/Documents/NVIDIA_CUDA-7.5_Samples now... Finished copying samples. |
2. GO to the samples directory:
|
1 |
teddy@teddy-K43SJ:~$ cd Documents/NVIDIA_CUDA-7.5_Samples/ |
3. Go to the deviceQuery directory THEN make:
|
1 2 3 4 5 6 |
teddy@teddy-K43SJ:~/Documents/NVIDIA_CUDA-7.5_Samples$ cd 1_Utilities/deviceQuery teddy@teddy-K43SJ:~/Documents/NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery$ make /usr/local/cuda-7.5/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o deviceQuery.o -c deviceQuery.cpp /usr/local/cuda-7.5/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o deviceQuery deviceQuery.o mkdir -p ../../bin/x86_64/linux/release cp deviceQuery ../../bin/x86_64/linux/release |
4. run the deviceQuery script to test if we can communicate with the GPU:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
teddy@teddy-K43SJ:~/Documents/NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery$ ./deviceQuery ./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected 1 CUDA Capable device(s) Device 0: "GeForce GT 520M" CUDA Driver Version / Runtime Version 7.5 / 7.5 CUDA Capability Major/Minor version number: 2.1 Total amount of global memory: 1023 MBytes (1072889856 bytes) ( 1) Multiprocessors, ( 48) CUDA Cores/MP: 48 CUDA Cores GPU Max Clock rate: 1480 MHz (1.48 GHz) Memory Clock rate: 800 Mhz Memory Bus Width: 64-bit L2 Cache Size: 65536 bytes Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65535), 3D=(2048, 2048, 2048) Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers Total amount of constant memory: 65536 bytes Total amount of shared memory per block: 49152 bytes Total number of registers available per block: 32768 Warp size: 32 Maximum number of threads per multiprocessor: 1536 Maximum number of threads per block: 1024 Max dimension size of a thread block (x,y,z): (1024, 1024, 64) Max dimension size of a grid size (x,y,z): (65535, 65535, 65535) Maximum memory pitch: 2147483647 bytes Texture alignment: 512 bytes Concurrent copy and kernel execution: Yes with 1 copy engine(s) Run time limit on kernels: Yes Integrated GPU sharing Host Memory: No Support host page-locked memory mapping: Yes Alignment requirement for Surfaces: Yes Device has ECC support: Disabled Device supports Unified Addressing (UVA): Yes Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0 Compute Mode: < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.5, CUDA Runtime Version = 7.5, NumDevs = 1, Device0 = GeForce GT 520M Result = PASS The final line is the most important. It states that the test was successful as we received a "PASS" |
5. Go to the bandwidthTest directory THEN make:
|
1 2 3 4 5 6 7 |
teddy@teddy-K43SJ:~/Documents/NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery$ cd .. teddy@teddy-K43SJ:~/Documents/NVIDIA_CUDA-7.5_Samples/1_Utilities$ cd bandwidthTest/ teddy@teddy-K43SJ:~/Documents/NVIDIA_CUDA-7.5_Samples/1_Utilities/bandwidthTest$ make /usr/local/cuda-7.5/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o bandwidthTest.o -c bandwidthTest.cu /usr/local/cuda-7.5/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o bandwidthTest bandwidthTest.o mkdir -p ../../bin/x86_64/linux/release cp bandwidthTest ../../bin/x86_64/linux/release |
6. run bandwidthTest:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
teddy@teddy-K43SJ:~/Documents/NVIDIA_CUDA-7.5_Samples/1_Utilities/bandwidthTest$ ./bandwidthTest [CUDA Bandwidth Test] - Starting... Running on... Device 0: GeForce GT 520M Quick Mode Host to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 6491.7 Device to Host Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 6488.2 Device to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 11079.2 Result = PASS NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled. |