Wednesday, January 16, 2019

Installing LonestarGPU v3.0 on Linux Mint / Ubuntu & Errors faced during installation

These are the steps for installing.
1. Clone the release 3 repo.
git clone -b release-3.0 https://github.com/IntelligentSoftwareSystems/GaloisGPU
2. Next 
cd GloisGPU
make
../../rt/include/cutil_subset.h:10:10: fatal error: cub/cub.cuh: No such file or directory
 #include "cub/cub.cuh"
compilation terminated

This errors are due to as we have not the linked the dependencies. cub and moderngpu

3. I am using moderngpu v1.1 and cub v1.4.1 and you can download from the cub and moderngpu from the release tab.

rajz@LordOfWarriors:~/d6$ cd GaloisGPU
rajz@LordOfWarriors:~/d6/GaloisGPU$ ls -l
total 36
drwxr-xr-x 9 rajz rajz 4096 Jan 16 12:15 apps
drwxr-xr-x 2 rajz rajz 4096 Jan 16 13:37 bin
drwxr-xr-x 2 rajz rajz 4096 Jan 16 12:15 include
-rw-r--r-- 1 rajz rajz 1504 Jan 16 12:15 LICENSE.txt
-rw-r--r-- 1 rajz rajz  919 Jan 16 12:15 Makefile
-rw-r--r-- 1 rajz rajz 1967 Jan 16 12:15 README.md
drwxr-xr-x 5 rajz rajz 4096 Jan 16 12:15 rt
drwxr-xr-x 2 rajz rajz 4096 Jan 16 12:15 skelapp
drwxr-xr-x 3 rajz rajz 4096 Jan 16 12:15 tuning


// unlink the dep if present
unlink cub
unlink mgpu
 
ln -s /home/rajz/install/cub-1.4.1/ cub
ln -s /home/rajz/install/

// unlink the dep if present
unlink cub
unlink mgpu

cd rt/include/
ln -s /home/rajz/install/cub-1.4.1/cub/
ln -s /home/rajz/install/moderngpu-1.1/ mgpu

After linking, it should look like this.
rajz@LordOfWarriors:~/d6/GaloisGPU$ ls -l
total 40
drwxr-xr-x 9 rajz rajz 4096 Jan 16 12:15 apps
drwxr-xr-x 2 rajz rajz 4096 Jan 16 14:52 bin
lrwxrwxrwx 1 rajz rajz   29 Jan 16 14:37 cub -> /home/rajz/install/cub-1.4.1/
drwxr-xr-x 2 rajz rajz 4096 Jan 16 12:15 include
drwxr-xr-x 2 rajz rajz 4096 Jan 16 14:27 inputs
-rw-r--r-- 1 rajz rajz 1504 Jan 16 12:15 LICENSE.txt
-rw-r--r-- 1 rajz rajz  919 Jan 16 12:15 Makefile
lrwxrwxrwx 1 rajz rajz   33 Jan 16 14:38 mgpu -> /home/rajz/install/moderngpu-1.1/
-rw-r--r-- 1 rajz rajz 1967 Jan 16 12:15 README.md
drwxr-xr-x 5 rajz rajz 4096 Jan 16 12:15 rt
drwxr-xr-x 2 rajz rajz 4096 Jan 16 12:15 skelapp
drwxr-xr-x 3 rajz rajz 4096 Jan 16 12:15 tuning


rajz@LordOfWarriors:~/d6/GaloisGPU/rt/include$ ls -l
total 148
-rw-r--r-- 1 rajz rajz  2831 Jan 16 12:15 abitset.h
-rw-r--r-- 1 rajz rajz  4929 Jan 16 12:15 aolist.h
-rw-r--r-- 1 rajz rajz   219 Jan 16 12:15 bmk2.h
-rw-r--r-- 1 rajz rajz  6057 Jan 16 12:15 component.h
-rw-r--r-- 1 rajz rajz  4274 Jan 16 12:15 counter.h
-rw-r--r-- 1 rajz rajz  4167 Jan 16 12:15 csr_graph.h
lrwxrwxrwx 1 rajz rajz    33 Jan 16 14:43 cub -> /home/rajz/install/cub-1.4.1/cub/
-rw-r--r-- 1 rajz rajz 14929 Jan 16 12:15 cuda_launch_config.hpp
-rw-r--r-- 1 rajz rajz  2138 Jan 16 12:15 cutil_subset.h
-rw-r--r-- 1 rajz rajz  2092 Jan 16 12:15 exclusive.h
-rw-r--r-- 1 rajz rajz   633 Jan 16 12:15 failfast.h
-rw-r--r-- 1 rajz rajz  5145 Jan 16 12:15 gbar.cuh
-rw-r--r-- 1 rajz rajz   144 Jan 16 12:15 ggc_rt.h
-rw-r--r-- 1 rajz rajz   365 Jan 16 12:15 ggcuda.h
-rw-r--r-- 1 rajz rajz  1793 Jan 16 12:15 gg.h
-rw-r--r-- 1 rajz rajz  2621 Jan 16 12:15 instr.h
-rw-r--r-- 1 rajz rajz  3510 Jan 16 12:15 internal.h
-rw-r--r-- 1 rajz rajz  2114 Jan 16 12:15 lockarray.h
lrwxrwxrwx 1 rajz rajz    33 Jan 16 14:43 mgpu -> /home/rajz/install/moderngpu-1.1/
-rw-r--r-- 1 rajz rajz  4630 Jan 16 12:15 pipe.h
-rw-r--r-- 1 rajz rajz  1116 Jan 16 12:15 rv.h
-rw-r--r-- 1 rajz rajz  4139 Jan 16 12:15 sharedptr.h
-rw-r--r-- 1 rajz rajz   359 Jan 16 12:15 snfile.h
-rw-r--r-- 1 rajz rajz  2999 Jan 16 12:15 Timer.h
-rw-r--r-- 1 rajz rajz 18012 Jan 16 12:15 worklist.h


4. Now do a make from GloisGPU folder.

rajz@LordOfWarriors:~/install/GaloisGPU$ make

5. Now, the error is different

../../rt/include/cub/block/specializations/../../block/../util_ptx.cuh(694): warning: function "__all"
/usr/local/cuda-9.2/bin/..//include/device_atomic_functions.h(181): here was declared deprecated ("__all() is deprecated in favor of __all_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

../../rt/include/cub/block/specializations/../../block/../util_ptx.cuh(720): warning: function "__any"
/usr/local/cuda-9.2/bin/..//include/device_atomic_functions.h(180): here was declared deprecated ("__any() is deprecated in favor of __any_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

../../rt/include/cutil_subset.h(44): warning: function "__ballot"
/usr/local/cuda-9.2/bin/..//include/sm_20_intrinsics.h(407): here was declared deprecated ("__ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

../../rt/include/cutil_subset.h(52): warning: function "__ballot"
/usr/local/cuda-9.2/bin/..//include/sm_20_intrinsics.h(407): here was declared deprecated ("__ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

../../rt/include/mgpu/include/kernels/../device/../device/intrinsics.cuh(112): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.2/bin/..//include/sm_30_intrinsics.hpp(260): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

../../rt/include/mgpu/include/kernels/../device/../device/intrinsics.cuh(122): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.2/bin/..//include/sm_30_intrinsics.hpp(174): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

../../rt/include/mgpu/include/kernels/../device/../device/intrinsics.cuh(123): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.2/bin/..//include/sm_30_intrinsics.hpp(174): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
/usr/bin/ld: ../../rt/lib/libggrt.a(ggc_rt.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../rt/lib/libggrt.a(ggc_rt.link.o): relocation R_X86_64_32S against `__nv_module_id' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../rt/lib/libggrt.a(instr.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../rt/lib/libggrt.a(bmk2.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'dmr' failed
make[1]: *** [dmr] Error 1
make[1]: Leaving directory '/home/rajz/install/GaloisGPU/apps/dmr'
Makefile:12: recipe for target 'all' failed
make: *** [all] Error 2



Monday, December 10, 2018

Time synchronization issues in Dual boot Linux Mint/Ubuntu and Windows

I have always used to have the network time in my Linux Mint 19 or Windows 8. However when I switch between Linux and Windows[or vice versa] the time gets modified and wrong time would show up. This Time synchronization issues in Linux Mint/Ubuntu which can be solved by the following simple task.

Steps.
1. Use your favorite editor to edit the file as root [If file not found create a new one]. I am using xed here.

sudo xed /etc/adjtime

2. Make the file looks as below. For me, I had only the first line. I created the next two line and saved it.

0.0 0 0.0
0
LOCAL


3. Reboot!

The issues exactly what is happening in the background is very well explained in this reference article.

References: https://www.techgainer.com/fix-windows-showing-wrong-time-in-linux-windows-dual-boot-system/

Install Latex Texmaker on Linux mint 19 / Ubuntu 18.04

Installing latex is pretty straight forward. We could get it from the official packages /repos througth command line. I wish to install a "full" latex support as I don't want to install any other packages to install later on. So, the Download size is ~2.5GB and installation space need is 4.5GB roughly. Texmaker is just 5-50MB where as the rest is fully occupied by LaTeX  or TeX or TeXLive.
sudo apt-get update
sudo apt-get texlive-full texmaker
Next things is that spell check
When do a check spelling you will get an "Error can't open dictionary"
Go to Options>Configure>Editor tab
Change myspell to hunspell dictionary. I wanted British English so I selected the below:
/usr/share/hunspell/en_GB.dic

Thanks to vijay!

Next thing is you may have to install Latexdraw for drawing pictures. It need Java SE/JDK. I installed JDK from official oracle site here. Click JDK download(I would need for java programming etc).  I used deb file. Clicking/opening it will install it automatically or based on deb file

"sudo dpkg -i jdk-11.0.1_linux-x64_bin.deb"

As oracle Jdk didn't registered in update-java-alternative or update-alternative --config java. I went to fix it manually. I was able to locate my installation at  "/usr/lib/jvm" called "jdk-11.0.1" folder.

Extract the downloaded LaTeXDraw-3.x.x.-bin.zip from https://sourceforge.net/projects/latexdraw/. After extracting run the following.

sudo /usr/lib/jvm/jdk-11.0.1/bin/java -jar installer.jar
That's it. Bye for now.
I have disabled trigger email from comment. Contact me on twitter instead for any questions.

Sunday, November 25, 2018

Install CUDA 10 on Linux mint 19 or Ubuntu 18.04

Assuming that you have nvidia GPU with cuda compatibility.
 
These are the steps for installing CUDA 10 on Linux mint 19 or Ubuntu 18.04
  • Install Linux mint 19/Ubuntu 18.04 fresh
  • Use the ppa nvidia drivers repo from lauchpad here
    • sudo add-apt-repository ppa:graphics-drivers/ppa
      sudo apt-get update
      
      
  • The version 410 is the current long term version as on date
  • From "Driver Manager" install the current stable version


  •  


    • Reboot; verify the driver installed from terminal using "nvidia-smi" command


    • Install these packages
      • sudo apt-get install build-essential dkms
        sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev
        
    • Download the deb file and follow the below steps


    • sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
      sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
      sudo apt-get update
      sudo apt-get install cuda

    • That's it.
    • Default location of installation is /usr/local/cuda
    • "cuda-install-samples-10.0.sh ~/install" installs sample files
    • cd into the folder "NVIDIA_CUDA-10.0_Samples"
    • make -j2
    • Add the "PATH=$PATH:/usr/local/cuda/bin"  to your "~/.bashrc" as a last line.
      (or)
      PATH=$PATH:/usr/local/cuda/bin:/home/rajz/install/NVIDIA_CUDA-9.2_Samples/bin/x86_64/linux/release
    • run "deviceQuery" to verify the cuda installation.  And do the post installation formalities
    • sudo apt-get install g++ freeglut3-dev build-essential libx11-dev \
          libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
       
       
       
      References
      1. https://www.pugetsystems.com/labs/hpc/How-to-install-CUDA-9-2-on-Ubuntu-18-04-1184/
      2. https://www.pugetsystems.com/labs/hpc/How-To-Install-CUDA-10-together-with-9-2-on-Ubuntu-18-04-with-support-for-NVIDIA-20XX-Turing-GPUs-1236/

Saturday, November 24, 2018

Challenges in installing Linux Mint 19 to dual boot along side windows


 WARNING: There is an updated Install notes. Check out  the recent post
Had a tough time setting/installing up Linux mint 19 on my existing dual boot machine to solve these 2 problems:
1. grub-efi-amd64-signed' package failed to install into /target
2. Hash Sum mismatch.
3. shim-signed and grub-efi-amd64-signed failure to configure.
Huh. Nearly 6 hours trying to figure out.

As it happened:

I had a Linux mint 18 and a rusted windows. So I wanted to refresh my machine. So I reset factory/recovery settings on windows. And wished to install Linux mint afresh. So, I have downloaded the ISO file named linuxmint-19-cinnamon-64bit-v2.iso from the official website and verified. I have made necessary partitions while installing and installation went smooth. However, right after installing and just before grub installation, this error came up.



"GRUB Installation Failed.
The 'grub-efi-amd64-signed' package failed to install into /target/. Without the GRUB boot loader, the installed system will not boot".


To rectify this.
1. install boot-repair
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair 

Open boot repair and run the recommended things. [it took 20mins; be patient] It will FAIL badly. Never mind go ahead and restart it. It worked. Because it has successfully reinstalled grub.

2. apt-get update would not completed it will show error like "Hash Sum mismatch"


E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-i386/by-hash/SHA256/a70a891ed73362c0a3966c9c6c790096f5aba663389ab578a6b991b698ae43c6  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:393124 [weak]
    - SHA256:a70a891ed73362c0a3966c9c6c790096f5aba663389ab578a6b991b698ae43c6
    - SHA1:4e0cfabaaf47b0cbf6ecc284e5281430bbe530d2 [weak]
    - MD5Sum:94742010fa630d152bbff1445f6369b4 [weak]
   Hashes of received file:
    - SHA256:ea9bf28ed7d57e5bd739fc63485459130475026c35a84f25e57d2f5ca0521ec7
    - SHA1:af7bad4e086d5e768c450c77032ee520d58afeda [weak]
    - MD5Sum:aa28e356c8a66b4838a83ab18e10e2d5 [weak]
    - Filesize:393124 [weak]
   Last modification reported: Fri, 23 Nov 2018 12:50:34 +0000
   Release file created at: Fri, 23 Nov 2018 13:51:10 +0000

To resolve this:

sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/partial
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
sudo apt-get update
 



Resolve steps 2:
I am not sure above steps did resolve it completely. because I was still getting. Hash sum mismatch even after doing that.

Changing the main mirrors to different URL in Software source actually fixed in.

3. New problems:
Everytime I installed some pkg
It would try install some failed installed packages such as
shim-signed
grub-efi-amd64-signed



Resolve steps

sudo rm /sys/firmware/efi/efivars/dump-*
sudo update-grub
sudo apt-get -f install

References
Linux mint and askubuntu forums.

Thursday, November 9, 2017

sed, awk and bash it

Edit the files in folder

1. Chop off few words from the 1st line
2. Reads a particular word from the 1st line and then replaces that with some other word.

More particularly 
1. Removes "p tw" from the 1st line.
2. Replace the 3rd word(in line 1) with "0" in all the lines except line 1.

$cat sample
p tw 5 4
1 2
5 2
3 4
1 5

$cat required-sample
5 4
1 2
0 2
3 4
1 0


#!/bin/bash
for file in `ls *.gr`
do
    nodes=`awk 'NR==1{print $3}' $file` #takes the 3rd word which is n or |V|
    sed -i "1s/p tw //" $file             #chops the p and tw from the 1st line
    echo $file - done $nodes
    sed -i '2,$ s/$nodes/0/g' $file     #f   
done

Thanks to Vijay R



Thursday, September 7, 2017

Resolving expired GPG key and Github signing

My GPG key during creation had default expiry date which I didn't bother to change it at that time. One fine day it got expired. I was using that same key to sign commits on Github . In all my commits it was showing signed with unverified / expired key. However later from "password and keys" i was able to revoke the expiry. Even then after signing it was showing signed with unverified / expired key.

Here are the steps to resolve:
1. Github setting delete the existing GPG key
2. gpg --list-keys
3. gpg --armour --export  YOUR-KEY-ID
4. Copy it to Github GPG settings as new GPG key
5. Try committing and pushing on github!

All your commits have a verified and have a non-expired signature. :-)

Installing LonestarGPU v3.0 on Linux Mint / Ubuntu & Errors faced during installation

These are the steps for installing. 1. Clone the release 3 repo. git clone -b release-3.0 https://github.com/IntelligentSoftwareSystems/...