Search This Blog

Sunday, 12 January 2025

Installing Cuda 12.5 on Windows 11

I want to make a note. I did this update because I received an error when I tried to run a code of mine. A similar error can be seen in:

https://forums.developer.nvidia.com/t/cannot-run-samples-on-ms-visual-studi-2019/72472/37


So what I did was to reinstall the cudatoolkit 12.5 with the cuda samples 12.5 but before that I reinstall the driver for my nvidia card

Go to the windows icon and in search type system so you know what driver you need, then go to:

https://www.nvidia.com/es-la/drivers/

https://developer.nvidia.com/cuda-12-5-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local

https://github.com/NVIDIA/cuda-samples/releases


I deleted the past  nvidia toolkits I had and then it work like a charm. 


Related with these topic there is an error that I got after doing the update. It is related with the path of the common files.  The cuda samples that I download from github work fine but when I copy and paste an example in another folder, I got:

Cannot open include file: 'helper_cuda.h': No such file or directory

The way I solved it was:

I added the path to the  common files. I went to Project / NameofProject properties /Configuration Properties / VC++ Directories /$(IncludePath) / Edit / Include Directories / Click on the file icon / Then on the ellipsis icon / Add the path of the common folder 

In my case that was something like:

C:\Users\myuser\cuda-samples-12.5\cuda-samples-12.5\Common

Then:


Select folder / Ok / Ok /

In this way we add the path for the common folder and the compiler can recognize headers like  

helper_cuda.h

Another link relate with this error is:

https://forums.developer.nvidia.com/t/vs-2019-include-helper-cuda-h-and-other-helper-suffix-cant-be-found-compilation-error/258651

PS. 

I added one cuda project in a One Drive folder (one which shares my laptop and desktop) and then added the both common paths to the project, the one in my desktop computer and the one in my laptop computer. I made the project to work in both machines and obviously to sincronize any change. Ok, some of you would say, why don't you use git instead but in this way the changes are totally automatic. This procedure feels a little bit artistic, don't you think?

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