Friday, November 20, 2015

Installing Titan X drivers and Cuda 7.5 to Ubuntu 14.04 LTS

Download the installer
Then get rid of any Nvidia residuals, run the following command in a terminal 
sudo apt-get remove --purge nvidia*
This may take a while, so be patient. Once it’s done, reboot your machine. At the login screen, don’t login just yet. Press Ctrl+Alt+F1 to switch to a text-based login, and switch to the directory which contains the downloaded driver. Run the following commands -
sudo service lightdm stop
change permissions to the installer where NVIDIA*.run is the full name of your driver.
chmod +x NVIDIA*.run
Next, start the installation with -
sudo ./NVIDIA*.run
Restart computer. 

Titan X for CUDA 7.5 login-loop error [Ubuntu 14.04] after power out

My computer was not responding so I did a hard shut down and when it restarted I couldn't login.
I found for solutions and everything seemed to point that I needed to reinstall my drivers.

To get to this conclusion I inspected the .xsession_errors file and it told me I had a few errors. One of them was with team viwere so I did remove it

sudo apt-get purge teamviewer
Another issue was an error that went something like this

"GLX couldn't find display"

Some forums said to reinstall the drivers.
One easy way to reinstall the drivers is to do it through :

sudo add-apt-repository ppa:mamarley/nvidia

sudo apt-get update

sudo apt-get install nvidia-352
where 352 is the latest driver for Titan X. I did this and reboot the system. After this I was able to login. However, I still needed to fix cuda because the new installation of drivers broke my cuda installation. How to fix the cuda part will be on another post. Good luck





Thursday, November 19, 2015

Install OpenCV 2.4.10 in Ubuntu 14.04 to work with Caffe

As I mentioned in previous posts. This is a tricky problem and can take quite some time to get the right versions and dependencies figured out. That is the joy or working with opencv, linux and caffe (sarcasm)

Here is a link to a script I used to get opencv working to use with caffe. I tried installing opencv 3.0 but failed because of some issues with that version. I also tried getting 2.4.9 installed and also failed because wasn't compatible with my cuda library since I have CUDA 7.0 and a Titan X.

After many tries, installing the dependecies in this link helped. Please share your solutions if you found some issues.

https://github.com/olivernina/ubuntu-scripts/blob/master/install-opencv.sh


I also found some useful information in this link :
http://milq.github.io/install-opencv-ubuntu-debian/

Also I noticed that it helped to add my libraries to my LD path

export LD_LIBRARY_PATH = $LD_LIBRARY_PATH:/usr/local/lib

And also anytime there was an error on compiling opencv and I needed to recompile it was better to erase the build directory and start all over. But of course everyone knows this right? :)

Thursday, November 12, 2015

Rename external hard drive in Linux

Usually hard drives have long names and you just want to rename them. One easy way to do that is by using label commands in Linux. For instance:

sudo ntfslabel /dev/sdd1 sea1

where sea1 is the new name.
You also need to know which drive is which to do that you can just do:

sudo fdisk -l

If you want to know which type of file system you have, you can do:

blkid /dev/sdd1

If you have exFAT then just use :

sudo exfatlabel /dev/sdd1 sea1

Tuesday, October 20, 2015

git commit error due to large files

I couldn't commit apparently because something was cashed. I found this workaround
git stash save --keep-index
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch  path2file' 

Friday, October 16, 2015

Recently I had an issue with updating my log file and csv file from python when working on a cluster. Even though I waited for a long time the files were not being updated only when the script finished. In order to fix this I researched what other people have done. By flushing every so often the files will update. This solution worked for me. Hopefully it will work for you


import csv
import sys
csvfile = open('results/test.csv','wb')\
csvout = csv.writer(csvfile,delimiter=',',quotechar='"')
sys.stdout = open('results/log.txt','w')
for it in xrange(max_iters): # rest of the program csvout.writerow(['test1','test2']) csvfile.flush() sys.stdout.flush()

Thursday, September 10, 2015

startx timeout in locking authority file

I found this solution in one of the forums: I pretty much copied and paste the solution here
check
ls -l ~/.Xauthority
It should be owned by you. If not, run
 sudo chown user ~/.Xauthority 
where user is your username
Then, run
 chmod u+rw ~/.Xauthority
startx

Monday, January 12, 2015

Error compiling MatConvNet in Ubuntu

I realized that compiling MatConvNet in Ubuntu is better to do it from the linux shell as supposed to from matlab. From matlab I would get this message after following the instructions:

vl_compilenn: CUDA: MEX config file: '.../matconvnet/matlab/src/config/mex_CUDA_glnxa64.sh'
gcc-4.4: No such file or directory

However, after compiling from the bash shell the tests would all pass.

This was my command from the command

make ENABLE_GPU=y ARCH=glnxa64 MATLABROOT=/usr/local/MATLAB/R2014a/ CUDAROOT=/usr/local/cuda-5.5/