UniParthenope Open Source Lab … only who writes ugly code doesn't want to show it …

5Mar/100

gVirtuS: the first beta release

We are proud to announce the first beta release of gVirtuS.

gVirtuS allows an instanced virtual machine to access GPGPUs in a transparent way, with an overhead  slightly greater than a real machine/GPGPU setup. gVirtuS is hypervisor independent, and, even though it currently virtualizes nVIDIA CUDA based GPUs.

The software, developed for research applications, is provided as it is.

We encourage using and testing it in order to collect useful feedbacks and suggestions.

Take a look to the gVirtuS project page: http://osl.uniparthenope.it/projects/gvirtus/.

5Mar/101

gVirtuS: the first beta release

We are proud to announce the first beta release of gVirtuS.

gVirtuS allows an instanced virtual machine to access GPGPUs in a transparent way, with an overhead  slightly greater than a real machine/GPGPU setup. gVirtuS is hypervisor independent, and, even though it currently virtualizes nVIDIA CUDA based GPUs.

The software, developed for research applications, is provided as it is.

We encourage using and testing it in order to collect useful feedbacks and suggestions.

Take a look to the gVirtuS project page: http://osl.uniparthenope.it/projects/gvirtus/.

18Jan/100

Petroula: An automated weather forecast system

Petroula (http://osl.uniparthenope.it/projects/petroula/) aims to make up an automated system for weather forecasts using a Bayesian classification for predict weather from known cases in the reference period. Each case (and each class) is characterized by some meteorological variables and their trend in the previous day.

Petroula has been developed in the  the Applied High-Performance Scientific Computing Research Laboratory  of the "Department of Applied Science" (DSA) - University of Napoli "Parthenope" http://dsa.uniparthenope.it/lmncp/.

26Dec/090

VMSocket: a mechanism to expose UNIX Sockets in KVM Virtual Machines

VMSocket is a mechanism to expose UNIX Sockets (sockets in AF_UNIX domain) from the host operating system to the KVM’s virtual machines.

It provides a really fast communication channel between host and guests os. It can ben used for communication that needs to be fast, such as HPC (High Performance Computing) software solutions and so on.

The socket is bounded on the host os and the guests can connect to the socket using special drivers. At this time only the driver for linux is ready.

The sources of the patched qemu to support vmsocket are found on: http://github.com/cjg/qemu/tree/vmsocket/.

Usage

To use VMSocket you should compile qemu grabbing the sources from the branch vmsocket of the my qemu fork on github: http://github.com/cjg/qemu/tree/vmsocket:

git clone git://github.com/cjg/qemu.git
cd qemu
git checkout origin/vmsocket
./configure
make
make install

Now to use it you have to add the option

 -vmsocket unix:/path/to/the/unix/socket

to the usual qemu options that you have to use.

To use vmsocket you have to use a gnu/linux distribution as guest os.

The guest driver for linux is kvm_vmsocket, it is provided as an “out-of-tree” kernel module, and it’s found on http://github.com/cjg/linux-vmsocket, so to obtain the driver, on the guest os you have to do:

git clone git://github.com/cjg/linux-vmsocket.git
cd linux-vmsocket
make
make modules_install
modprobe kvm_vmsocket

Now a character device “vmsocket0″ will be created, and from the user space it’s possible to interact with the socket through this file: the opening of vmsocket0 corresponds to the connect on the socket, the write to the send, the read to the receive and the close to the close of course.

Implementation Details

On the host side VMSocket is implemented as a qemu device, vmsocket, attached on the virtual PCI bus. The virtual device has some registers for controlling the Input/Output actions and two buffers, one for input and another one for output.

The registers are on the first pci bar, and they are:

  • Status: read only long, mapped at 0×0, it’s used by the driver to obtain the status of the device (i.e.: the result code of the last action performed).
  • Connect: write only word, mapped at 0×20, it’s used to request a connection to the socket. The driver to request a connection have to write a string of 1 to this register.
  • Close: write only word, mapped at 0×30, it’s used to close the connection from the socket. The driver to request the release of the connection have to write a string of 1 to this register.
  • WriteCommit: write only long, mapped at 0×40, it’s used to request the sending (or writing) the data stored in the output buffer to the connection already opened. The driver to request the sending of the data have to write to this register the size of the data to send.
  • Read: write only long, mapped at 0×60, it’s used to request the receiving (or reading) the data to the input buffer from the connection already opened. The driver to request the receiving of the data have to write to this register the size of the data to receive.

The input buffer is on the second pci bar and the output buffer is on the third one.

Imagining to have bounded an “echo server” on the host’s socket, the driver that want’s (or that have to) to use the services of the server should:

  1. Write a string of 1 to the Connect register
  2. Check the status, reading the Status register
  3. Copy the buffer to send to the “output buffer”, the memory situated on the third pci bar of the device
  4. Write the size of the buffer to the WriteCommit register
  5. Check the status, reading the Status register
  6. Write the size of the data to receive to the Read register
  7. Check the status, reading the Status register
  8. Copy from the device’s “input buffer” the received data
  9. Write a string of 1 to the Close register
  10. Check the status, reading the Status register
16Jul/090

Netinstalling CentOS using Attansic L1 Gigabit Ethernet (aka HOWTO modify Red Hat based iso’s bootkernel)

I needed to install CentOS 5.3 on a workstation with an “Attansic Technology Corp. L1 Gigabit Ethernet Adapter”, the driver for this kind of adapter (atl1e) was introduced in the version 2.6.26 of the kernel but CentOS 5.3 uses the 2.6.18 one. ElRepo provides an rpm with the atl1e.ko module backported for using with the 2.6.18 provided in CentOS so what I’m going to do is to insert the module taken from ElRepo on the CentOS netinstall iso.

First of all the netinstall iso and the rpm containing the module are needed (I created a directory to store all the files related to this thing):

[root@anestethize centos-net]# wget http://mirrors.bevc.net/CentOS/5.3/isos/x86_64/CentOS-5.3-x86_64-netinstall.iso
[root@anestethize centos-net]# wget http://elrepo.org/linux/elrepo/el5/x86_64/RPMS/kmod-atl1e-1.0.1.0-1.el5.elrepo.x86_64.rpm

Now we can extract the module from the rpm (note that because the rpm is done to be installed on a system the module is contained in the … subdirectory, we move it from that subdirectory to the top directory):

[root@anestethize centos-net]# rpm2cpio kmod-atl1e-1.0.1.0-1.el5.elrepo.x86_64.rpm | cpio -id
177 blocks
[root@anestethize centos-net]# mv lib/modules/2.6.18-92.el5/extra/atl1e/atl1e.ko .
[root@anestethize centos-net]# rm -rf lib/

Then we need to extract the files from the iso to modify them: we mount the iso then we copy the file in a newly created directory:

[root@anestethize centos-net]# mount -o loop CentOS-5.3-x86_64-netinstall.iso /mnt/
[root@anestethize centos-net]# mkdir iso.d
[root@anestethize centos-net]# cp -a /mnt/. iso.d/

The kernel modules are contained in the initrd.img image found in the isolinux/ directory of the iso. initrd.img is a gzipped cpio archive, we exctract it in a newly creted directory (initrd.d):

[root@anestethize centos-net]# mkdir initrd.d
[root@anestethize centos-net]# cd initrd.d/
[root@anestethize initrd.d]# zcat ../iso.d/isolinux/initrd.img | cpio -id
16523 blocks

The extracted archive looks like:

[root@anestethize initrd.d]# ls
bin  dev  etc  init  modules  proc  sbin  selinux  sys  tmp  var

Now we have to focus our attention on the modules/ directory:

[root@anestethize initrd.d]# ls modules/
module-info  modules.alias  modules.cgz  modules.dep  pci.ids

module-info is a text file used by the installation program to gain informations about the modules, we can consider that this file is divided in sections, each section starts with the name of the module (starting from the first column) and then the content of the section is contained on the following rows indented by a tab; the first content entry specify the kind of driver (scsi or eth) and the second is an human readable description. So we have to append in this file the following rows:

atl1e
	eth
	"Atheros 1000M Ethernet Network Driver"

modules.alias is a text file that contains a lookup table that basically associates an abitrary text a module name, so it’s possible to call the kernel module (for example using modprobe) with the alias. Each line of the file specifies an alias, the syntax is:

alias [alias_text] [module_name]

When “Module Autoload” is enabled (and for the CentOS kernel it is) when a new device is attached the kernel generates an uevent that announces the identity of the newly inserted device, the identity of the device is contained in the “MODALIAS” variable; then udevd captures the event and invokes modprobe with the content of MODALIAS. So we have to add the right alias to modules.alias to make the system autoload the driver, to obtain the right alias to add we use modinfo:

[root@anestethize initrd.d]# modinfo ../atl1e.ko
filename:       ../atl1e.ko
version:        1.0.1.0
license:        GPL
description:    Atheros 1000M Ethernet Network Driver
author:         Atheros Corporation,
srcversion:     1C61E431138A92D0D438FDA
alias:          pci:v00001969d00001026sv*sd*bc*sc*i*
depends:
vermagic:       2.6.18-92.el5 SMP mod_unload gcc-4.1
parm:           TxRingSz:Transmit Ring Sizen (array of int)
parm:           RxfMemSize:memory size of rx buffer(KB) (array of int)
parm:           MediaType:MediaType Select (array of int)
parm:           IntModTimer:Interrupt Moderator Timer (array of int)

Then we can the following row to modules.alias:

alias pci:v00001969d00001026sv*sd*bc*sc*i* atl1e

modules.alias usually is compiled automatically by depmod in the same way we have just done.

modules.cgz is a gzipped cpio archive that contains the modules; is where we have to add the atl1e.ko module. First of all we need to extract it in a new directory:

[root@anestethize initrd.d]# cd ..
[root@anestethize centos-net]# mkdir modules.d
[root@anestethize centos-net]# cd modules.d/
[root@anestethize modules.d]# zcat ../initrd.d/modules/modules.cgz | cpio -id
41082 blocks

The modules are contained in the 2.6.18-128.el5/x86_64/ subdirectory, we copy atl1e.ko in this subdirectory

[root@anestethize modules.d]# cp ../atl1e.ko 2.6.18-128.el5/x86_64/

Now we remake the gzipped archive:

[root@anestethize modules.d]# find ./ | cpio -H newc -o | gzip > ../initrd.d/modules/modules.cgz
41258 blocks

modules.dep contains the dependencies of each module, ie the modules that the actual module needs to work, atl1e has no dependencies (as we could see when we invoked modinfo above) so we can skip this file.

pci.ids is a database of all known pci IDs, we can leave it unchenged.

Our rework on the modules subdirectory is done, so we can rebuild the initrd archive and the netinstall iso:

[root@anestethize modules.d]# cd ../initrd.d
[root@anestethize initrd.d]# find ./ | cpio -H newc -o | gzip > ../iso.d/isolinux/initrd.img
16643 blocks
[root@anestethize initrd.d]# cd ../
[root@anestethize centos-net]# mkisofs -o CentOS-5.3-x86_64-atl1e-netinstall.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table iso.d/

That’s all! Now we can use CentOS-5.3-x86_64-atl1e-netinstall.iso to do the installation.

26Jun/090

Fedora 11 Release Party in Naples, Italy

Source: Gianluca Varisco's weblog, http://www.techtemple.org/

 

Thursday 18th, June 2009 – Naples, Italy: UDU Parthenope (Unione degli Universitari) organized, in collaboration with NaLUG (Napoli GNU/Linux Users Group), the Fedora 11 Release Party. The location was simply perfect: a building property of Parthenope’s University, located in the hearth of Naples.