Sunday, April 16, 2017

Ubuntu 14.4 - GPU - Torch Installation Guides (issues and solutions)

   


Ubuntu installation 14.4

1. make a USB copy;
2. install ubuntu with USB (most of the system should be able to automatically boot from USB in fresh installation). If not, change the boot order in DOS. To get intot he DOS, press 'del' or 'f1' or others.
3. after installation, make sure that the hard driver (where the ubuntu is installed) is rank the first in the boot order in DOS.
4.  make sure the user account is used, otherwise all data in guest account will be eliminated after each rebooting.





GPU driver – CUDA 7.5 installation

post 1:
post 2:
post 3:



Confirmation of the environment –

1.    lspci | grep -i nvidia (Confirm that the information of NVIDIA's board is displayed)
2.    uname -m (make sure that it is a x86_64)
3.    gcc --version (make sure it is installed)

Installation of CUDA –

1.    Download cuda_7.5.18_linux.run file from https://developer.nvidia.com/cuda-downloads
NOTE: In the .run file, GPU card drivers  are included. So before this installation, remove all previously installed nvidia related softwares by [post 3] or section 2.7 in [post 1].

2.    Run the following command –
a. sudo apt-get install build-essential
b. sudo vi /etc/modprobe.d/blacklist-nouveau.conf
c. Then, add the following line in that file:
NOTE: when copy following two lines into the TCL window, make sure the completeness and there are no space in front of each line!
            NOTE: use 'sudo vi' to edit; 'esc' or 'I' to change between command and insert mode; in             command mode, use ':wq', ':q' or ':wq!' to save and quite, quite without save and             quite/save/ignore warnings.
blacklist nouveau
options nouveau modeset=0
d. sudo update-initramfs -u(If it fails, check NOTES above)
3.    Reboot computer
4.    At login screen, press Ctrl+Alt+F1and login to your user.
5.    Go to the directory where you have the CUDA driver, and run
a. chmod a+x .
b. sudo service lightdm stop
c. sudo bash cuda-7.5.18_linux.run --no-opengl-libs
6.    During the install –
a. Accept EULA conditions
b. Say YES to installing the NVIDIA driver
c. Say YES to installing CUDA Toolkit + Driver
d. Say YES to installing CUDA Samples
e. Say NO rebuilding any Xserver configurations with Nvidia
7.    Check if /dev/nvidia* files exist. If they don't, do the following –
a. sudo modprobe nvidia
Note: if failed, try the section 4.4 in [post 1] to manually make a nvida* file in '/dev/nvidia*' with shown contents there.

8.    Set Environment path variables –
a. export PATH=/usr/local/cuda-7.5/bin:$PATH
b. export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
9.    Verify the driver version –
a. cat /proc/driver/nvidia/version
     Note: if showing 'no such folder/file exist', it may mean the driver is not installed correctly. And because this failure, the 13.d and 13.e in this doc will absolutely fail. To resolve this, see section [Driver re-installation] in this doc.

10.                        Check CUDA driver version
a. nvcc –V
11.                        Switch the lightdm back on again
a. sudo service lightdm start
12.                        Ctrl+Alt+F7 and login to the system through GUI
13.                        Create CUDA Samples –
a. Go to NVIDIA_CUDA-7.5_Samples folder through terminal
b. make
c. cd bin/x86_64/linux/release/
d. ./deviceQuery
e. ./bandwidthTest
NOTE: if d. and e. fail, refer to section [Driver re-installation] in this doc.
f. Both tests should ultimately output a 'PASS' in terminal
14.                        Reboot the system

Driver re-installation

     The way here is to remove the previously installed driver and      reinstalled it again:

     1. remove the GPU driver: according to [post 3];
     2. install the driver according to [post 3];
     3. reboot;
4. At login screen, press Ctrl+Alt+F1 and login to your user.
5. Set Environment path variables –
a. export PATH=/usr/local/cuda-7.5/bin:$PATH
b. export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
6. Verify the driver version –
a. cat /proc/driver/nvidia/version
7. Check CUDA driver version
a. nvcc –V

8. Ctrl+Alt+F7 and login to the system through GUI
9. Create CUDA Samples –
Note: do a. and b. only when they are not done before. Otherwise, go to c. directly.
a. Go to NVIDIA_CUDA-7.5_Samples folder through terminal
b. make
c. cd bin/x86_64/linux/release/
d.     ./deviceQuery
e. ./bandwidthTest

----------------
some useful commands for nvidia:
nvidia-settings: see what GPU is installed;
nvidia-smi: see what GPU is running and their loads/usage.



CuDNN INSTALL



1. down load the correct file: “cuDNN v5 Library for Linux”. Not 'runtime' or 'developer library' for Ubuntu.
2. install follow this link:








Friday, April 7, 2017

What Deep Learning can not do?

Deep learning is great! But it also has limitations. 

1. It need accurate data (or at least not so dirty data);
2. It usually needs large amount of data or many many tries;

e.g., by contrast, humans “learn from very few examples, can do very long-term planning, and are capable of forming abstract models of a situation and manipulate these models to achieve extreme generalization.”
Even simple human behaviors are laborious to teach to a deep learning algorithm. Let’s examine the task of not being hit by a car as you walk down the road. If you go the supervised learning route, you’d need huge data sets of car situations with clearly labeled actions to take, such as “stop” or “move”. Then you’d need to train a neural network to learn the mapping between the situation and the appropriate action.
If you go the reinforcement learning route, where you give an algorithm a goal and let it independently determine the ideal actions to take, the computer would need to die thousands of times before learning to avoid cars in different situations.
“You cannot achieve general intelligence simply by scaling up today’s deep learning techniques,” warns Francois Chollet.
3. As for success of AlphaGo, it's not purely based on deep learning. It is built with 
deep supervised learning + deep reinforcement learning + Monte Carlo Tree Search
each part is essential to make it successful.  

4. Reasoning and logical thinking, see following example. (all machine learning algorithms can't do it) 
quoted from LINK