Search This Blog

Monday, 26 February 2024

Installing CUDA 12.3 on Windows 11

 Go to

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

Pick your flavor until you find the button Download

Execute the .exe in your downloads and follow the wizard installation. 

Verify the installation by opening a command prompt

The paste

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

in the command prompt and hit enter. 

Go to the folder where the samples were downloaded and double-click one the solutions to try one of the samples. 

For more info go to 

https://github.com/nvidia/cuda-samples

Happy Installation. 

AWS stuff

 Steps to deploy in AWS using windows:


Create an instance in EC2 with the Windows platform. 

Save your key pair with pem ending. 

Go to the instance and open Actions -> Security -> Get windows password and in upload private key file, upload the .pem file with the key pair you saved before. Click on Decrypt password and save all the information that appears. 


In your local computer go to remote desktop connection and use the information that you just saved. 

Install Maven in the remote windows. Download apache-maven. Go to environmental variables-> advance ->paste the path address of the bin folder in maven.


Follow this tutorial for that

https://www.youtube.com/watch?v=39NhCB5YFSY


For windows server and was deployment follow:

https://www.youtube.com/watch?v=x4KtSHyULVs&t=256s

and

https://www.youtube.com/watch?v=yO7Vh7N2me8&t=316s



Wednesday, 14 February 2024

DataBases Stuff

 How to Connect a database in MySQL with a c++ application in Windows

Download Mysql from 

https://dev.mysql.com/downloads/installer/

And the connector library from 

https://dev.mysql.com/downloads/connector/cpp/

Unzip the file 

https://cdn.mysql.com//Downloads/Connector-C++/mysql-connector-c++-8.3.0-winx64.zip


Create a C++ empty project in Visual Studio.

Right-click over the name of the project, ->Add -> New Item -> C++ File. Rename the file as main.cpp

One important thing is to create a database. For that, you can open a command prompt, type the next command:

MySQL -u root -p 

Enter password: the one you used when install MySQL

Then use the command:

create database quickstartdb

Copy and paste the next code:

<stdlib.h> #include <iostream> #include "mysql_connection.h" #include <cppconn/driver.h> #include <cppconn/exception.h> #include <cppconn/prepared_statement.h> using namespace std; //for demonstration only. never save your password in the code! const string server = "localhost"; const string username = "root"; const string password = "yourownpassword"; int main() { sql::Driver *driver; sql::Connection *con; sql::Statement *stmt; sql::PreparedStatement *pstmt; try { driver = get_driver_instance(); con = driver->connect(server, username, password); } catch (sql::SQLException e) { cout << "Could not connect to server. Error message: " << e.what() << endl; system("pause"); exit(1); } //please create database "quickstartdb" ahead of time con->setSchema("quickstartdb"); stmt = con->createStatement(); stmt->execute("DROP TABLE IF EXISTS inventory"); cout << "Finished dropping table (if existed)" << endl; stmt->execute("CREATE TABLE inventory (id serial PRIMARY KEY, name VARCHAR(50), quantity INTEGER);"); cout << "Finished creating table" << endl; delete stmt; pstmt = con->prepareStatement("INSERT INTO inventory(name, quantity) VALUES(?,?)"); pstmt->setString(1, "banana"); pstmt->setInt(2, 150); pstmt->execute(); cout << "One row inserted." << endl; pstmt->setString(1, "orange"); pstmt->setInt(2, 154); pstmt->execute(); cout << "One row inserted." << endl; pstmt->setString(1, "apple"); pstmt->setInt(2, 100); pstmt->execute(); cout << "One row inserted." << endl; delete pstmt; delete con; system("pause"); return 0; }

I leave the video from where I took the code. 

Change debug to release in solution configuration. 

Go to Project-> NameofProject Properties. Change Configuration to Release. Follow the next configuration steps in:

https://www.youtube.com/watch?v=a_W4zt5sR1M&t=2s

And this link for the database creation, And another option for connection processes:

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


MySQL - Java  Installation process 

I will share links that I used in the process:

This one is the forts one:

https://www.ionos.com/digitalguide/server/tools/xampp-tutorial-create-your-own-local-test-server/

Then the two for the antivirus and UAC disable:

https://www.process.st/how-to/disable-microsoft-defender-antivirus-service/

https://portal.microfocus.com/s/article/KM000020477?language=en_US

You will find some error, I encounter some and these videos helped me:

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

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

This video shows how to manage a MySQL database from intellij but does not show how to use java

This one gives the connection using Apache Net Beans, Java and MySQL

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

These series of youtube videos teach JDBC concepts

https://www.youtube.com/playlist?list=PLhs1urmduZ2-yp3zID5rMEmXDETN8xvMo

Here is the code I generated following the last tutorial:

https://github.com/ivonneleonor/JavaSqlConnection



















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