public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
To: isar-users@googlegroups.com
Cc: "Moessbauer, Felix" <felix.moessbauer@siemens.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	 Henning Schild <henning.schild@siemens.com>
Subject: Re: ISAR evaluation nVidia image generator based on Debian bullseye
Date: Thu, 6 Oct 2022 00:01:30 +0200	[thread overview]
Message-ID: <CAJGKYO4qTPddn-Dyevgc5c3RgKmeTgDxMgBZZV0kSoExOLhyrg@mail.gmail.com> (raw)
In-Reply-To: <CAJGKYO4eZ=5eKt6CCKzfRF0XUNdbin+KwJ3ex0Dx0nQzsMgmhQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3062 bytes --]

Il giorno mer 5 ott 2022 alle ore 13:35 Roberto A. Foglietta
<roberto.foglietta@gmail.com> ha scritto:
>
> Dear all,
>
> I am proud to announce the v0.9.1 of an ISAR evaluation nVidia image
> generator based on Debian bullseye. I hardly believe that this project
> will surprise you because of the technology adopted nor its use but
> probably you will find this file interesting, in particular the
> rationale chapter.
>
> https://github.com/robang74/isar-nvidia-debian/blob/main/README.md

The README.md file is in attachment and this is the chapter suggested

Rationale
---------

An equivalent result can be obtained installing a Debian 11, adding the nVidia
repositories dedicated to the developers and the other one dedicated to the
docker runtime, then installing the 'cuda-demo-suite-11-7' and 'nvidia-docker2'
packages.

The most sensitive difference between these two approaches is that the ISAR
image contains the open-source driver while the apt installed the closed-source.

In fact, this project is a proof-of-concept that shows how to add the
open-source
nVidia driver in a Debian 11 system integrating it with the proprietary full
software stack without violating the licence and being able to redistribute
the image, at least for some usages allowed by the licences (\*).

- https://opensource.stackexchange.com/questions/10082/geforce-nvidia-driver-license-for-commerical-use

This project aims to provide a way to deliver a system with nVidia full stack
software installed which is legally distributable also for commercial uses.

- https://www.nvidia.com/en-us/drivers/unix

In fact, up today (515.76) the .run archive that contains the driver and the
CUDA libraries is licenced in a way for which two essential operations are not
permitted:

 - §2.1.2 does not allow the compilation essential for deliver a binary driver
 - §2.1.3 does not allow to repackage the .run content in many .deb packages

This project works around these limitations using the open-source driver

 - https://github.com/NVIDIA/open-gpu-kernel-modules

in order to not violate the §2.1.2 and installing the nVidia software from their
public repositories without changing the .deb packages content and removing just
few dependencies - which are just text fields into a .deb architecture and have
nothing to do with the content delivered aka package metadata, only - allows to
avoid installing the closed-source driver and the related packages.

This allows also to choose a complete different kernel version respect the
one delivered with the Debian 11 and compile it by an ISAR recipe applying
a custom configuration and patches like this one:

 - https://lore.kernel.org/lkml/20220921063638.2489-1-kprateek.nayak@amd.com

that unlock AMD Ryzen CPUs a more +51% of computation power lost due
to an old bug.

(\*) **Legal notes**

 - no any warranty is granted and further license changes might happen.
 - debian legal ml https://lists.debian.org/debian-legal/2022/10/msg00004.html

Cheers, R.

[-- Attachment #2: README.md --]
[-- Type: text/markdown, Size: 7917 bytes --]

ISAR debian image generator
===========================

Build with ISAR an evaluation image based on Debian 11 (bullseye) selecting from
nVidia GPU support (515.65.01) up to a graphic developing enviroment with the
full nVidia software stack (11.7) running a standard debian kernel


About
-----

The generated images run on x86 systems and the complete one includes a nVidia
full software stack for developing, debugging and tuning AI applications on the
top of the Debian 11 (bullseye) with a Gnome 3 and a dedicated Eclipse GUI:

 - EFI boot in a separate VFAT partition
 - Debian 11 operative system in EXT4 or BTRFS partition
 - application for networking, system maintainence and basic developing tools
 - CUDA libraries runtime and development, nVidia tuning and debuging tools
 - Gnome 3 desktop graphic enviroment with nVidia Eclipse devel interface

The size of the complete image is about 9.1 GB and it supposed to run on bare
hardware with a supported nVidia GPU dedicateid for computational tasks and an
integrate primary graphic card for visualisation.

The most interesting others 2 images that can be created with this project are:

    - build-me: the basic-os with the docker-ce for isar build
    - nvdocker: the basic-os with the nvidia-docker2 + driver

The build-me is an 1.1 GB image that installed into a 120GB SSD/USB device can
run the ISAR enviroment in order to build every image in the full list.
This images do not contains any software from nVidia but just the ISAR tools.

The nvdocker is an 1.3 GB image that installed into a 120GB SSD/UBB device can
run the AI applications into containers available in the nVidia catalog.


Rationale
---------

An equivalent result can be obtained installing a Debian 11, adding the nVidia
repositories dedicated to the developers and the other one dedicated to the
docker runtime, then installing the 'cuda-demo-suite-11-7' and 'nvidia-docker2'
packages.

The most sensitive difference between these two approaches is that the ISAR
image contains the open-source driver while the apt installed the closed-source.

In fact, this project is a prof-of-concept that shows how to add the open-source
nVidia driver in a Debian 11 system integrating it with the proprietary full
software stack without violating the licence and being able to redistribute
the image, at least for some usages allowed by the licences (\*).

- https://opensource.stackexchange.com/questions/10082/geforce-nvidia-driver-license-for-commerical-use

This project aims to provide a way to deliver a system with nVidia full stack
software installed which is legally distrubutable also for commercial usas.

- https://www.nvidia.com/en-us/drivers/unix

In fact, up today (515.76) the .run archive that contains the driver and the
CUDA libraries is licenced in a way for which two essential operations are not
permitted:

 - §2.1.2 does not allow the compilation essential for deliver a binry driver
 - §2.1.3 does not allow to repackage the .run content in many .deb packages

This project works around these limitations using the open-source driver

 - https://github.com/NVIDIA/open-gpu-kernel-modules

in order to not violate the §2.1.2 and installing the nVidia software from their
public repositories without changing the .deb packages content and removing just
few depenencies - which are just text fileds into a .deb architecture and have
nothing to do with the content deliverd aka package metadata, only - allows to
avoid installing the closed-source driver and the related packages.

This allows also to choose a complete different kernel version respect the
one delivered with the Debian 11 and compile it by an ISAR recipe applying
a custom configuration and patches like this one:

 - https://lore.kernel.org/lkml/20220921063638.2489-1-kprateek.nayak@amd.com

that unlock AMD Ryzen CPUs a more +51% of computation power lost due to old bug.

(\*) **Legal notes**

 - no any warranty is granted and further license change might happen. 
 - debian legal ml https://lists.debian.org/debian-legal/2022/10/msg00004.html


Virtual disk 'build me' download
--------------------------------

This Microsoft OneDrive link works with a WWW browser only:

 - https://1drv.ms/u/s!ArH4FO-H0Ihygk-BrBetq62wiAkq

and let everyone without any authentication to download a virtual machine:

 - isar-buildme-vm.ova.7z (229 MB)

which the integrity could be verified with these two hashes:

 - md5sum d7d6873f7f46658b2b6aa822ff29774a
 - sha256sum 88c39016c198d830daf298844089f2ca9530c7464c6c8598971d56bf90069b9f

and let every Microsoft Windows users to build its own image using a virtual
machine like Oracle VirtualBox. Please note that in the VM settings you should
activate the EUFI boot (Settings, System, Enable EFI (special OSes only).

The virtual machine is accessible also by SSH using every client:

 - ssh -p2022 -o StrictHostKeyChecking=no root@localhost (password root)

The first action to do is to change the passwords for users: root and debraf


Dependencies
------------

A GNU/Linux host with docker or podman installed

	sudo apt install docker.io |XOR| docker-ce |XOR| podman

User account with permissions to run docker

	sudo usermod -aG docker $USER && newgrp docker


Building and other commands
---------------------------

You can load the repositroy shell profile in this way:

	source .profile

to lod the git functions and local scripts aliases

	build, clean, wicinst, wicshell, wicqemu

Otherwise you can use this by command line:

	./build.sh [ $BBTARGET | $IMAGE ]

The Bitbake target could be any recipe.

However, to create an image you should choose one of these:

	./build.sh -h

It will show a list like this, in which the first field is the target:

    - basic-os: a debian 11 with some system/networking tools
    - build-me: the basic-os with the docker-ce for isar build
    - basicdev: the basic-os with the basic development tools
    - nvdocker: the basic-os with the nvidia-docker2 + driver
    - complete: the basicdev + nvdocker + Gnome3 + CUDA devel

The complete udpate images list lives in recipes-core/images/README.txt

After having created an image you can chroot into it running this command

	./wicshell.sh

Then you can clean the ISAR project with command

	./clean.sh isar


Installing
----------

You can find the image with this comamnd

    imgfile=$(find build/ -name eval-image-\*.wic 2>/dev/null)

and install it with one of these two

    sudo dd if=${imgfile} of=/dev/${USBDISK} bs=1M status=progress

or, if bmap-tools are installed,

    sudo bmaptool copy ${imgfile} /dev/${USBDISK}

or use this script

    sudo ./wicinst.sh /dev/${USBDISK}

With the script you can also trasform your image in a VMDK file:

    ./wicinst.sh vmdk:image.vmdk

this requires qemu-img installing the qemu-utils deb package


License
-------

Almost all the files are under MIT license and the other are in the public
domain due to their simplicity and/or standardisation like system configuration.
However the composition of these files is protected by the GPLv3 license.

This means that everyone can use a single MIT licensed file or a part of it
under the MIT license terms. Instead, using two of them or two parts of them
implies that you are using a subset of this collection. Thus a derived work of
this collection which is licensed under the GPLv3 also.

The GPLv3 licenses applies to the composition unless you are the original
copyright owner or the author of a specific unmodified file. This means that
everyone that can legally claims rights about the original files maintains its
rights, obviously. So, it should not need to complain with the GPLv3 license
applied to the composition. Unless, the composition is adopted for the part
which had not the rights, before.

For further information or requests, please write at the repository mainteiner:

 - Roberto A. Foglietta <roberto.foglietta@gmail.com>

Have fun! <3

  reply	other threads:[~2022-10-05 22:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 11:35 Roberto A. Foglietta
2022-10-05 22:01 ` Roberto A. Foglietta [this message]
2022-10-09 21:12 ` Roberto A. Foglietta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJGKYO4qTPddn-Dyevgc5c3RgKmeTgDxMgBZZV0kSoExOLhyrg@mail.gmail.com \
    --to=roberto.foglietta@gmail.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox