Search This Blog

Tuesday 26 December 2023

Java stuff

 Following this tutorial:

https://www.youtube.com/watch?v=8SGI_XS5OPw&t=433s


You have to go to this github link:

https://github.com/amigoscode/spring-data-jpa-course

Login to your account so you can see all the necessary options. 

Go to  Code/Local/SSH and copy the url

you need to generate the ssh keys. The first step is to install git. In this case for windows. Go to this page for reference. 

https://github.com/git-guides/install-git

After this installation, we should generate an ssh key, follow this link for reference:

https://docs.github.com/es/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent


Now go to IntelliJ -> New -> Project form version control

Paste the URL https://github.com/amigoscode/spring-data-jpa-course and then clone. 

For the next step look for the SQL shell using the windows bottom. 

You can create the data base amigoscode using the SQL shell or you can directly create the database using pgAdmin, that worked for me. 


I follow this tutorial to connect successfully the postgres database with the spring boot project

https://www.youtube.com/watch?v=ZTxn38j4DJE

Sunday 10 December 2023

Software Engineering Stuff

 Angular Notes:


I'm following the next tutorial 

https://www.youtube.com/watch?v=NMzl2pGOK_8&list=PL1BztTYDF-QNrtkvjkT6Wjc8es7QB4Gty

and I just write the commands that I think are very important to remember.

Install Angular CLI global:

npm install -global @angular/cli@latest

create a new project call app1

ng new app1

go inside the folder app1

Run Angular project:

ng serve -o

do:

 ng generate component header

Display app in Local host:

Write in your browser:

 http://localhost:4200/

To solve the error:

ng.ps1 cannot be loaded. You cannot run this script on the current 

system

Go to this website to correct it: 

https://caiomsouza.medium.com/fix-for-powershell-script-not-digitally-signed-69f0ed518715

Create a new angular project

 If your project does not load app.mode.ts file, run 

ng new my-app --no-standalone --routing --ssr=false

there is a post about it here:

https://github.com/angular/angular/issues/52751


Docker


Trying to run a docker-compose.yml, I found that the document presented in the tutorial:

https://app.amigoscode.com/courses/267273/lectures/44198924

Should be:

services:
db:
container_name: postgres
image: postgres
environment:
POSTGRES_USER: amigoscode
POSTGRES_PASSWORD: PASSWORD
PGDATA: /data/postgres
volumes:
- db:/data/postgres
ports:
- "5332:5432"
networks:
- db
restart: unless-stopped

networks:
db:
driver: bridge

volumes:
db:


I ran docker and it worked well. 

We run with the command docker-compose up -d




Tuesday 11 April 2023

Viscoplastic fluids using GPU

Viscoplastic Fluids New Algorithm in Parallel

An optimization of Viscoplastic Fluid model using GPU and a new algorithm

This file has some recommendations to compile and run the code.

This repository has four main versions of the code. The original code was named Alg2FixSerial7_bueno, the original code in serial with the new algorithm is Alg2FixSerialNewAlgorithm3_bueno, the code in parallel is Alg2FixParallelbueno and the code in parallel with the new algorithm is ParallelwithNewAlgoritmBueno.

To run any of these versions we recommend to run in Linux command line:

make clean

make

./Alg2Fix

The code was tested for different cases and combinations of parameters of Viscoplastic fluids. The code will be continued to be tested and integrated.

https://github.com/ivonneleonor/ViscoplasticFluids_with_NewAlgorithm_using_GPU_V2.0

Sunday 12 February 2023

Install Cuda Fortran in Ubuntu 22

 Download the hpc-sdk from 

https://developer.nvidia.com/nvidia-hpc-sdk-downloads

Click on the option Linux x86_64 Tarball

Follow the instructions for this kind of installation 

$ wget https://developer.download.nvidia.com/hpc-sdk/23.1/nvhpc_2023_231_Linux_x86_64_cuda_12.0.tar.gz
$ tar xpzf nvhpc_2023_231_Linux_x86_64_cuda_12.0.tar.gz
$ nvhpc_2023_231_Linux_x86_64_cuda_12.0/install

MANPATH=$MANPATH:/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/compilers/man; export MANPATHPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/compilers/bin:$PATH; export PATHexport PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs/mpi/bin:$PATHexport MANPATH=$MANPATH:/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs/mpi/man

If you want to test the installation, you can go to 

/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/examples/CUDA-Fortran/SDK

and run make to some of the examples


Install Matlab in Ubuntu 22

Download the MATLAB from 

 https://www.mathworks.com/downloads

Use your login and password to download the last version of Matlab

Unzip the file that you downloaded with

unzip -X -K matlab_R2022b_glnxa64.zip -d matlab_2022b_installer

cd matlab_2022b_installer

sudo ./install

Use your email and password associated with your Matlab account and license

Be careful, when the installer ask you for your Login name, use the username of your local computer. To know what is that, use the command

whoami

I found that the prompt of the installer didn't work properly, my solution for that was to write down the word somewhere else and then copy and paste it using Ctrl+c and Ctrl+p

If you want to try the GPU in Matlab make sure you install GPU coder and parallel computing options. The command that you have to run is

openExample('parallel/paralleldemo_gpu_benchmark')

It is assumed that your CUDA toolkit is running appropriately in your system. 


CUDA 12.0 for Ubuntu 22.04 LTS

 I will  start from the beginning again so we don't have to reread past posts

Checking your version of Ubuntu

lsb_release -a

Download the latest version of Ubuntu at

https://ubuntu.com/download/desktop

Do the USB stick to make your installation, follow this link as a guide

https://ubuntu.com/tutorials/create-a-usb-stick-on-ubuntu#1-overview

Once you have the USB stick, insert the usb and  choose  Try Ubuntu instead of Installing ubuntu

When you are in the system, open Gparted from show applications and manage the memory given your necessities. Don't forget to mount the root.  After this reboot and do the real installation. 

run the command whoami to know or remember your username, you will be in a command line mode and not been able to know. 



Installing Nvidia Driver

 

Check the version of your card

lspci | grep VGA

Download the Nvidia driver from

https://www.nvidia.com/Download/index.aspx?lang=en-us 

sudo chmod 777 -R NVIDIA-Linux-x86_64-*.run

sudo apt-get update
sudo apt-get upgrade

Install all these libraries

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglu1-mesa glew-utils mesa-utils

Modify the next file

sudo gedit /etc/modprobe.d/blacklist.conf

write down at the end of the file the next list

blacklist amd76x_edac
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv

save and close the file and then type:

sudo apt-get remove --purge nvidia*
sudo apt-get remove --purge xserver-xorg-video-nouveau
sudo reboot

After that

CTRL ALT F5

check your login using whoami command

Enter your login and pass and then type

sudo telinit 3

enter your pass again.
After this the driver has to start, choose yes for everything except for the last question about the Xorg file.

When this finishes, get in to the graphic mode with


sudo telinit 5

If everything goes right you can go for CUDA. Download the toolkit from

https://developer.nvidia.com/cuda-downloads

Pick the version that is convenient for you

In case of Ubuntu 22 the link is:

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local

Run a terminal and type

sudo gedit .bashrc

for 32 bits include these lines:
export PATH=/usr/local/cuda-12.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib:$LD_LIBRARY_PATH

and for 64 bits:
export PATH=/usr/local/cuda-12.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib:/usr/local/cuda-12.0/lib64:$LD_LIBRARY_PATH

and save the changes.

 

Run a sample to test your installation

Download the samples using

git clone https://github.com/NVIDIA/cuda-samples.git

once installed go to 

cuda-samples/Samples/1_Utilities/deviceQuery

make

If everything goes well then your installation is ready to go.