Monday, January 18, 2016

ubuntu 14.04 install cuda 7.5

Made with Remarkable!

ubuntu 14.04 install cuda 7.5

In the past blog, I showed that it’s easy to install cuda. While the truth is that, as my laptop has two graphical cards(a intel and nvidia GT850M), it’s really hard to install nvidia driver and CUDA.

Fail trace:

Using the cuda-new-version.run as other blogs says, the installation is successeed, but ubuntu wouldn’t be able to login after entering the password.

Success trace

then I tried to use the local cuda.deb file download from the website: https://developer.nvidia.com/cuda-downloads .

  • follow the steps:

sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb

sudo apt-get update

sudo apt-get install cuda

tips: if you also has two graphical cards, you should use:

sudo service lightdm stop

and then login your account in the tty1 or other ttys except the graphical one.
the use the three step.

  • after the installation of cuda.
    reboot

  • then set the environment variables:

echo ‘export PATH=/usr/local/cuda-7.5/bin:$PATH’ >> ~/.bashrc

echo ‘export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH’ >> ~/.bashrc

source ~/.bashrc

sudo reboot

After reboot. check whether it’s successfully installed:

nvcc -V

if it returns the version of CUDA.
Then congralates.

New tips: It happened to me that ubuntu stops at the screen of logo and it wouldn't let me login.

the problem is caused by the pre-installed open source graphical card driver nouveau, it can be solved by taking them into the blacklist using following steps:

go to the recovery mode and if it shows that the file system is read-only, choose the selection ' root'

mount -o remount, rw /

Then we can modify the files, edit the file /etc/modprobe.d/blacklist and add following lines at the end of it:

blacklist amd76x_edac

blacklist vga16fb

blacklist nouveau

blacklist rivafb

blacklist nvidiafb

blacklistrivatv

all finished~

Tuesday, January 12, 2016

ubuntu 14.04 install theano

At first, we should set up the python environment.
maybe we can simply use the apt-get method:
sudo apt-get install -y python-dev python-pip python-nose gcc g++ git gfortran
for some district such as china, pypi host may not available, we can use other open source, such as pypi.douban.com/simple

Theano also needs BLAS, LAPACK, ATLAS. just install them
sudo apt-get install -y libopenblas-dev liblapack-dev libatlas-base-dev
 
then install numpy. During my installation, An error due to numpy 1.10.1+ can cause failure of test of theano.
So we can download earlier edition's (such as 1.9.2) source code of numpy, then install it. As we have installed gfortran. The step can be:
 sudo tar -zxvf numpy-1.9.2.gz.zip
cd numpy-1.9.2
sudo python setup.py build  --fcompiler=gnu95
sudo python setup.py install
After the set-up of numpy. we should test numpy.
python -c 'import numpy; numpy.test()'
it shouldn't have any error return.
 
then install scipy. As I got none error from scipy, so we can just install scipy by pip
sudo pip install scipy
then test it:
python -c 'import scipy; scipy.test()'
Also no error is accepted
 
then install   theano.
sudo pip install theano
also test it:
sudo python -c 'import theano; theano.test()'
this test step is really time-consuming, wait and check it has no error.
then theano is successfully set up.
 
then install Nivida gpu develop drivers.
 
if error of blas not found errors, sudo apt-get install gfortran libopenblas-dev liblapack-dev

Saturday, November 22, 2014

Thursday, December 6, 2012

Accelerate BSEG









对于BSIM:


In addition: After our further research, we find that using that six tables we may loose some fields. The detail is below:

table                    missing fields                              
BSIS          vbeln          kidno     vbel2      posn2
BSAS         vbeln          kidno     vbel2      posn2
BSID          segment      werks     bewar
BSAD         segment      werks     bewar
BSIK          segment      vbeln     vbel2     posn2     werks     bewar
BSAK          segment      vbeln     vbel2     posn2     werks     bewar


So we lost many data. Then we research again. 
Finally we get that,  if we use the statement 'select single XXX from bseg where bukrs = bukrs  and belnr = belnr
                                                                                                                                                                          gjahr = gjahr  and buzei = buzei'

we can get the fully needed data faster, because 'BUKRS BELNR GJAHR BUZEI' consist all the key fields of the table BSEG, in other words, to a fixed group of ( BUKRS BELNR GJAHR BUZEI ), we can only find one record. So the data we get is correct.




Next is the code of the project:
Source code:




Way to Connect the six table:


 


   Way to use 'Select single from BSEG'




    When we won't loose the fields, we can use the six tables to do the selection. 
    If we loose fields, we can use the 'select single XXX from BSEG'. Tips: the key fields should be given.

  







f