Search This Blog

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.

Sunday, 29 May 2022

Install Nvidia driver for Ubuntu 20.04 LTS

 sudo apt install build-essential libglvnd-dev pkg-config


sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"


cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf


sudo telinit 3


sudo ubuntu-drivers autoinstall

Sunday, 27 January 2019

Installing Cuda 10.0 in Ubuntu 18.04.1 LTS

Cuda 10.0 in Ubuntu 18.04.1 LTS

Go straightforward to

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal

And download the Cuda .deb package from it and follow the next instructions that are in the last link as well.
Installation Instructions:


  1. `sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb`
  2. `sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub`
  3. `sudo apt-get update`
  4. `sudo apt-get install cuda`    

After doing so, follow the next steps.

Run a terminal and type

sudo gedit .bashrc

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

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

save the changes and close the terminal.

There you go.

Saturday, 20 June 2015

CudaFortran 15.5 on Ubuntu 12.10

First run

sudo apt-get update


Then check that you have Linux Standard Base with

lsb_release

if not run

sudo apt-get update 
sudo apt-get install lsb-core

Also make sure you have a new version of a gcc compiler, check it with

gcc -v

If you do not have it, get it with

sudo apt-get install build-essential

Create a PGI account at


Log in at


If you haven't acquire the license go to


If you already have a license then just log in and go to

and download the software that you need.

Unpack the PGI software. In the instructions that follow, replace <tarfile> with the name of the file that you downloaded.

Use the following command sequence to unpack the tar file into a temporary directory before installation.

mkdir /tmp/pgi % mv
mv <tarfile>.tar.gz /tmp/pgi
cd /tmp/pgi
tar xpfz <tarfile>.tar.gz

Then change the unpack file to another carpet and open it

Get in to the carpet and run

sudo ./install

Accept and say yes to everything (recommended).

You can also check in the manual the steps for the installation of the Cluster Development Kit if you need it.

Then open your .bash file and add
For 64bit

export PGI=/opt/pgi
export PATH=/opt/pgi/linux86-64/15.5/bin:$PATH
export MANPATH=$MANPATH:/opt/pgi/linux86-64/15.5/man
export LM_LICENSE_FILE=$LM_LICENSE_FILE:/opt/pgi/license.dat

For 32bit

export PGI=/opt/pgi;
export PATH=/opt/pgi/linux86/15.5/bin:$PATH;
export MANPATH=$MANPATH:/opt/pgi/linux86/15.5/man;
export LM_LICENSE_FILE=$LM_LICENSE_FILE:/opt/pgi/license.dat;

Verify the release number of the installed software with:

pgfortran -V

To check your ID run

lmutil lmhostid

Choose one of the next two options:

For permanent license:

Generate a Permanent License Key

1. Click Create permanent keys.

2. Click the PIN associated with the product for which you wish to generate license keys. If you don't see any PINs listed, you first need to tie one to your account: a. Obtain your PIN code from your original PGI order confirmation email, in the section labeled: "SHARING ADMINISTRATION" or contact license@pgroup.com. b. Click the link: Tie a PIN to this account. c. Enter the 16-digit PIN code and follow the instructions provided.
3. Click License keys to generate the keys.

Trial license:

Generate a Trial License Key
1. Click Create trial keys.
2. Accept the terms of the agreement.
3. Enter any one of the FlexNet hostids detected, exactly as it appears in the message that is displayed during installation or when you issue the command: lmutil lmhostid 4. Click the Generate License keys button.”

Install License Keys Once you have generated your trial or permanent license keys, copy and paste them into the file: /opt/pgi/license.dat, substituting the appropriate installation directory path if you have not installed in the default /opt/pgi directory. The license.dat depends on the product you are installing. However, each license.dat file looks somewhat similar to the following sample file from a PGI Workstation installation: SERVER <hostname> 0123456789ab 27000 DAEMON pgroupd PACKAGE PGI2015-<PGI_PIN>pgroupd<suscription end date>

In your license file:

<hostid> should match the hostid you submitted above when you generated your license keys. You should see it on the SERVER line.

If necessary, you can enter or edit the <hostname> entry manually, but you cannot edit the <hostid>
entry or you will invalidate the license keys.

Go to the file

/opt/pgi/linux86-64/15.5/bin

And copy the file lmgrd.rc to the carpet init.d


sudo cp lmgrd.rc ~/../../etc/init.d/lmgrd

Create a carpet /usr/tmp. In the root directory

sudo mkdir tmp

Then run the license daemon

cd $PGI/linux86-64/15.5/bin/sudo ./lmgrd.rc start

Finally, try to run a code with

pgfortran program.cuf

You can check the documentation at


Some of the paragraph are taken from:


Where you can find more detail about the installation.



Saturday, 6 June 2015

Dear all,

I like to post some of the work my colleagues and I have developed in my class of Software Engineering.

It is a calculator in C++, It uses a DLL, a wrapper and a CLI form as a user interface. It also include a Unit Test.

We worked under agile system and I can say that it works very fine.

This is the source code

https://github.com/ivonneleonor/Calculator-C-

Thanks to Afolabi, Antreas and Norah for their patient and contribution.