================================================================================================================================================================ =

I-SETUP

How to add autopkgtest for OpenCL software , using the DebianPackage:rocm-opencl-icd

Take the exemple of a package :

1. Place into /slix and /debian/tests

cd silx 

cd debian/tests

2. Open the control file in order to write into :

nano control

3. Copy and paste the part pocl in the same file to implement ROCm tests:

In the copied part of ontrol dedicated to ROCm test, replace all Pocl by rocm. Add in the section Depends of the new ROCm test the command :

pkg-rocm-tools

Add into the section Restrictions :

skippable

And then modify the following line :

Tests: opencl

Into : 

Test-Command:rocm-test-launcher opencl

And it may works !

Before implementation :

       Tests: no-opencl
        Depends:
         @,
         python3-all,
         python3-pytest,
         python3-pytest-mock,
         python3-pytest-xvfb,
         xauth,
         xvfb,
        Restrictions: allow-stderr

        Tests: opencl
        Depends:
        @,
        clinfo,
        pocl-opencl-icd,
        python3-all,
        python3-pytest,
        python3-pytest-mock,
        python3-pytest-xvfb,
        xauth,
        xvfb,
        Architecture: !i386
        Restrictions: allow-stderr
        
        Test-Command: xvfb-run -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" sh debian/tests/gui
        Depends:
         mesa-utils,
         silx,
         xauth,
         xvfb,
        Restrictions: allow-stderr

Implemented ROCm test ->

       Tests: no-opencl
        Depends:
         @,
         python3-all,
         python3-pytest,
         python3-pytest-mock,
         python3-pytest-xvfb,
         xauth,
         xvfb,
        Restrictions: allow-stderr

        Tests: opencl
        Depends:
        @,
        clinfo,
        pocl-opencl-icd,
        python3-all,
        python3-pytest,
        python3-pytest-mock,
        python3-pytest-xvfb,
        xauth,
        xvfb,
        Architecture: !i386
        Restrictions: allow-stderr
        
        Test-Command:rocm-test-launcher opencl
        Depends:
         @,
         clinfo,
         rocm-opencl-icd,
         pkg-rocm-tools,
         python3-all,
         python3-pytest,
         python3-pytest-mock,
         python3-pytest-xvfb,
         xauth,
         xvfb,
        Architecture: !i386
        Features: test-name=opencl-ROCm
        Restrictions: allow-stderr , skippable
        
        Test-Command: xvfb-run -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" sh debian/tests/gui
        Depends:
         mesa-utils,
         silx,
         xauth,
         xvfb,
        Restrictions: allow-stderr

So, run the test in /silx by using :

sbuild

Then, tests are truly passed : Add the repository to git

git add .
git commit -m "the name of the version"
git push

## to check the repository 
git log 

And so on for others :)

* setup Sbuild to run rocm tests

* Add a rocm autopkgtest to your package

For a package

How to launch autopkgtest with podman+rocm :

1.Create a container , an image by using :

$ sudo rocm-podman-create rocm/debian:unstable.img

##To check the image use : 
$ podman images 

##To check the container : 
$ podman ps

##Configure the system for GPU-in-container use
$ rocm-podman-setup -u <user>

##To run autopkgtest : 

# Run rocrand's autopkgtests (from the official archive) in that image
$ autopkgtest -B <pkg> -- podman+rocm rocm/debian:unstable.img

Commands for dgit -gbp sbuild :

1. To see if everything is clean:

git diff in longeac@grades-01:~/ufo-filters$

2. Clean up and start again:

 git clean -xdf
 git reset --hard
 dgit --gbp sbuild

3. Manual directory creation:

.config/sbuild/config.pl et déplacement .sbuildrc 

Writing the config.pl file :

$chroot_mode = "unshare";
$unshare_mmdebstrap_keep_tarball = 1;
$run_autopkgtest = 1;
$external_commands = {
  "chroot-update-failed-commands" => [ [ '%SBUILD_SHELL' ] ],
  "build-deps-failed-commands" => [ [ '%SBUILD_SHELL' ] ],
  "build-failed-commands" => [ [ '%SBUILD_SHELL' ] ],
};
$unshare_mmdebstrap_extra_args = [
  "*" => [ '--aptopt=Acquire::http { Proxy "http://195.221.0.35:8080"; }',
           '--aptopt=Acquire::https { Proxy "http://195.221.0.35:8080"; }',
           '--customize-hook=echo "export http_proxy=http://195.221.0.35:8080" > "$1"/etc/environment',
           '--customize-hook=echo "export https_proxy=http://195.221.0.35:8080" > "$1"/etc/environment',
]
];
$autopkgtest_opts=['--shell-fail', '--apt-upgrade', '--env=https_proxy=http://195.221.0.35:8080', '--', 'podman+rocm', 'localhost/rocm/debian:%r']

4. schroot Upgrade :

schroot -l sbuild-update -ud testing

5. New procedure for modifying sbuild

**SETUP

Install necessary packages:

sudo apt install sbuild mmdebstrap uidmap

Create a directory for the chroot tarball :

mkdir -p ~/.cache/sbuild

Create/Update the tarball :

mmdebstrap --include=ca-certificates --skip=output/dev --variant=buildd unstable ~/.cache/sbuild/unstable-amd64.tar.zst https://deb.debian.org/debian

Error results :

If you are using apt-cacher-ng, specify http:// instead of https:// and enable the apt-cacher-ng proxy using --aptopt='Acquire::http { Proxy "http://195.221.0.35:8080"; }'. You can use any tarball compression extension you prefer :

        mmdebstrap --skip=output/dev --variant=buildd unstable ~/.cache/sbuild/unstable-amd64.tar.gz http://deb.debian.org/debian --aptopt='Acquire::http { Proxy "http://195.221.0.35:8080"; }'

*** Validation check :

perl -c ~/.config/sbuild/config.pl

Result:

> longeac@grades-01:~$ perl -c ~/.config/sbuild/config.pl
/home/experiences/grades/longeac/.config/sbuild/config.pl syntax OK

6. Test and launch the command:

In the directory : longeac@grades-01: ~/ufo-filters

sbuild

And it works !!!!!

Commands for /usr/bin/autopkgtest -B ufo-filters --test-name=reconstruct -- unshare --release unstable --arch amd64 :

sudo apt install  mmdebstrap 

sudo nano /etc/subuid

longeac:100000:65536

sudo nano /etc/subuid

longeac:100000:65536

/usr/bin/autopkgtest -B ufo-filters --test-name=reconstruct -- unshare --release unstable --arch amd64

IPV6 deactivation if it causes errors

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1

sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

sudo apt-get -o Acquire::ForceIPv4=true update

sudo apt-get -o Acquire::ForceIPv4=true upgrade

Acquire::ForceIPv4 "true";

ping -4 deb.debian.org

echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4

sudo apt-get update

For very specific case

For the package Nabu, after the following implementation, it might be possible that Opencl's tests would be marked as SKIPPED for an unkown reason even if the test ran truly include Opencl. First, the SKIPPED mark , appears if we have no tests data or not enough. So that Pierre Paleo, maintainers of Nabu , suggest to proceed like this to takle the issue :

  apt update
  apt install python3 python3-venv
  apt install git g++
  apt install opencl-headers opencl-c-headers opencl-clhpp-headers ocl-icd-opencl-dev pocl-opencl-icd clinfo

  python3 -m venv /tmp/paleo/pydeb
  source /tmp/paleo/pydeb/bin/activate
  pip install --upgrade pip setuptools wheel
  pip install pyopencl
  pip install pyvkfft
  pip install nabu

 # check that (py)OpenCL works
  python -c "import pyopencl as cl; import pyopencl.array as parray; ctx = cl.create_some_context(); queue = cl.CommandQueue(ctx); d = parray.zeros(queue, 500, 'f'); d+= 1; print(d)"
 
# run nabu tests
  nabu-test -rs -v

II-List of packages implemented ( IN progress)

https://codesearch.debian.net/search?q=pocl-opencl-icd+path%3Adebian%2Ftests%2Fcontrol&literal=1&perpkg=1

https://codesearch.debian.net/search?q=path%3Adebian%2Ftests%2Fcontrol+pyopencl&literal=1

https://codesearch.debian.net/search?q=path%3Adebian%2Fcontrol+pocl-opencl-icd&literal=1&perpkg=1

https://codesearch.debian.net/search?q=path%3Adebian%2Fcontrol+pyopencl&literal=1

https://codesearch.debian.net/search?q=path%3Adebian%2Fcontrol+opencl&literal=1 -> TODO find interesting packages.

Package

OpenCL unit test

OpenCL autopkgtest

Rocm autopkgtest

Upstream

ufo-filters

pas de tests

Rocm autopkgtest

nabu

X

pynx

X

pocl

X

examl

X

clblast

X

X

clpeak

X

X

url du debci rocm

genx

X

X

haskell-futhark

X

X

X

sasmodels

X

X

hashcat

libhmsbeagle

pyopencl

X

X

compyle

pas de tests

gpyfft

pas d'opencl test ni de rocm

pyvkfft

X

pytools

pas de tests opencl ni rocm

python-dtcwt

/

xpra

pas de test

pysph

/

pyfai

X

silx

X

python-xrt

no tests

III-Other tests

Inventory of all other pkg tests

ufo-filters

Test files : test_swap_quadrants.py / test_memin.py / test_fft.py / check-gradient / check-multipage-readers / test-142.sh / test-149.sh / test-153.sh / test-161.sh / test-177.sh /test-core-149.sh /test-file-write-regression.sh /test-gradient.sh /test-multipage-readers.sh /test-nlm.sh /

nabu

Test files : testutils.py utils.py tests.py nabu/preproc/tests nabu/io/tests nabu/estimation/tests nabu/misc/tests nabu/pipeline/tests nabu/processing/tests nabu/reconstruction/tests nabu/resources/tests nabu/stitching/tests

pynx

Test files : master/debian/tests/nabu-pocl pynx/-/blob/master/.gitlab-ci.yml pynx/cdi/test pynx/holotomo/test pynx/processing_unit/test pynx/ptycho/test pynx/scattering/test pynx/scripts/pynx_test.py pynx/-/tree/master/pynx/test pynx/-/tree/master/pynx/utils/test pynx/-/tree/master/pynx/wavefront/test

pocl

Test files : pocl/-/tree/main/cmake pocl/-/tree/main/examples/PyOpenCL pocl/-/tree/main/examples/ViennaCL pocl/-/tree/main/examples/chipStar pocl/-/tree/main/examples/shoc pocl/-/tree/main/tests pocl/-/tree/main/tools/scripts pocl/-/tree/main/tools/docker pocl/-/tree/main/tools/data

examl

Test files : examl/-/tree/master/testData

clblast

Test files :clblast/-/tree/debian/sid/.github/workflows clblast/-/tree/debian/sid/test clblast/-/blob/debian/sid/doc/testing.md clblast/-/blob/debian/sid/scripts/generator/generator/routine.py clblast/-/blob/debian/sid/doc/testing.md

clpeak

Test files : clpeak/-/tree/main/android/app/src/androidTest

genx

Test files : genx/-/blob/debian/master/doc_source/source/_templates/test genx/-/tree/debian/master/genx/tests genx/genx/models/lib/testing.py genx/tests/data/test.conf genx/genx/plugins/add_ons/Test.py genx/genx/examples/widget_test.ipynb

haskell-futhark

sasmodels

Test files : .github/workflows/test.yml TESTS.txt explore/beta/testPolyDiseperseSphricalBeta.m sasmodels/model_test.py data_files/testPolydisperseGaussianSphere.dat explore/beta/data_files/testPolydisperseGaussianSphere2.dat pytest.ini conftest.py debian/patches/0005-Clean-up-model-files-from-tests.patch

hashcat

Test files : tools/test.pl tools/test.sh tools/test_rules.pl tools/rules-test-cases.yaml src/selftest.c include/selftest.h tools/test_modules tools/cl_tests tools/pdf_tests tools/tc_tests tools/vc_tests?ref_type=heads

libhmsbeagle

Test files : tests examples/swig_python/test.py examples/hmctest examples/matrixtest examples/complextest examples/tinytest examples/oddstatetest examples/synthetictest

pyopencl

Test files : test .test-conda-env-py3.yml

compyle

Test files : compyle/tests/test_jit.py .github/workflows/tests.yml

gpyfft

Test files : gpyfft/test debian/patches/0001-add-also-the-CPU-devices-for-tests.patch debian/tests/control

pyvkfft

Test files : /doc/source/scripts pyvkfft/test doc/source/api/testing.rst pyvkfft/scripts/pyvkfft_test_suite.py examples/pyvkfft-tests-CUDA.ipynb doc/source/examples/pyvkfft-tests-OpenCL.nblink

pytools

/

python-dtcwt

Test files : tests

xpra

/

pysph

Test files : pysph/base/tests pysph/sph/tests .github/workflows/tests.yml pysph/solver/tests pysph/parallel/tests pysph/tools/tests requirements-test.txt pysph/examples/tests/test_examples.py

pyfai

Test files : src/pyFAI/test

silx

Test files : src/silx/app/test_.py src/silx/test src/silx/gui/test src/silx/image/test/test_bb.py src/silx/io/test src/silx/utils/test src/silx/gui/plot3d/test/test_gl.py src/silx/gui/_glutils/test/test_gl.py src/silx/math/fft/test src/silx/math/test/test_combo.py src/silx/opencl/test/test_image.py

python-xrt

Test files : tests/raycing examples/withRaycing/_QookBeamlines/testGrating.xml examples/withRaycing/_QookBeamlines/testAlignment.xml

IV-Test launch for :

pynx without adding rocm or modifying ❌ ( in progress )

Upstream : Copy the path to the pyfai repository on :

https://salsa.debian.org/science-team/pynx

Execution of :

        git clone : https://salsa.debian.org/science-team/pynx.git

1. Placement in the pyfai directory:

        longeac@grades-01:~/pynx$

2. Test launch:

        git clean -xdf; git reset --hard; dgit --gbp sbuild

Result:

        autopkgtest [10:52:17]: test command1:  - - - - - - - - - - results - - - - - - - - - -
        command1             FLAKY non-zero exit status 1
        autopkgtest [10:52:17]: @@@@@@@@@@@@@@@@@@@@ summary
        command1             FLAKY non-zero exit status 1
        
        I: Autopkgtest run was successful.
        
        +------------------------------------------------------------------------------+
        | Cleanup                                      Fri, 16 May 2025 08:52:18 +0000 |
        +------------------------------------------------------------------------------+
        
        Purging /build/reproducible-path
        Not cleaning session: cloned chroot in use

        +------------------------------------------------------------------------------+
        | Summary                                      Fri, 16 May 2025 08:52:19 +0000 |
        +------------------------------------------------------------------------------+

        Autopkgtest: no tests
        Build Architecture: amd64
        Build Type: binary
        Build-Space: 196308
        Build-Time: 34
        Distribution: unstable
        Host Architecture: amd64
        Install-Time: 77
        Job: /home/experiences/grades/longeac/pynx_2025.1-2.dsc
        Lintian: fail
        Machine Architecture: amd64
        Package: pynx
        Package-Time: 122
        Piuparts: fail
        Source-Version: 2025.1-2
        Space: 196308
        Status: successful
        Version: 2025.1-2
        --------------------------------------------------------------------------------
        Finished at 2025-05-16T08:50:01Z
        Build needed 00:02:02, 196308k disk space
        dgit ok: build successful, results in pynx_2025.1-2_multi.changes

ufo-filters rocm added ✅

Upstream : Copy the path to the ufo-flters repository on :https://salsa.debian.org/science-team/ufo-flters

Execution of :

        git clone : https://salsa.debian.org/science-team/ufo-filters.git

1. Placement in the ufo-flters directory:

        longeac@grades-01:~/ufo-flters$

2. orig.tar file missing, so create file:

        origtargz

3. Test launch:

        git clean -xdf
        git reset --hard
        dgit --gbp sbuild

Result:

        no-ocl               PASS
        autopkgtest [11:14:18]: @@@@@@@@@@@@@@@@@@@@ summary
        reconstruct          FAIL non-zero exit status 128
        no-ocl               PASS
        
        E: Autopkgtest run failed.

        +------------------------------------------------------------------------------+
        | Cleanup                                      Fri, 16 May 2025 09:14:18 +0000 |
        +------------------------------------------------------------------------------+

        Purging /build/reproducible-path
        Not cleaning session: cloned chroot in use

        +------------------------------------------------------------------------------+
        | Summary                                      Fri, 16 May 2025 09:14:19 +0000 |
        +------------------------------------------------------------------------------+

        Autopkgtest: fail
        Build Architecture: amd64
        Build Type: binary
        Build-Space: 47400
        Build-Time: 12
        Distribution: unstable
        Host Architecture: amd64
        Install-Time: 30
        Job: /home/experiences/grades/longeac/ufo-filters_0.17.0.75.gcb0bd5a+dfsg1-1.dsc
        Lintian: fail
        Machine Architecture: amd64
        Package: ufo-filters
        Package-Time: 52
        Piuparts: fail
        Source-Version: 0.17.0.75.gcb0bd5a+dfsg1-1
        Space: 47400
        Status: successful
        Version: 0.17.0.75.gcb0bd5a+dfsg1-1
        --------------------------------------------------------------------------------
        Finished at 2025-05-16T09:10:46Z
        Build needed 00:00:52, 47400k disk space
        dgit ok: build successful, results in ufo-filters_0.17.0.75.gcb0bd5a+dfsg1-1_multi.change

Raison de l'échec de reconstruct :

+ FILE=ufo-testing/sino-bin-810x1562-4.raw
+ [ ! -f ufo-testing/sino-bin-810x1562-4.raw ]
+ echo Erreur : fichier d'entrée manquant : ufo-testing/sino-bin-810x1562-4.raw
+ exit 1
Erreur : fichier d'entrée manquant : ufo-testing/sino-bin-810x1562-4.raw
autopkgtest [15:00:04]: test reconstruct: -----------------------]

5.autopkgtest are run:

AUTOPKGTEST_TMP=/tmp debian/test/reconstruct

Access to the CNRS git is tested with this command :

git ls-remote https://plmlab.math.cnrs.fr/tomogroup/ufo-testing.git

longeac@grades-01:~/ufo-filters$ curl -I https://plmlab.math.cnrs.fr/tomogroup/ufo-testing.git
HTTP/1.1 200 Connection established

HTTP/2 302
server: nginx
date: Tue, 20 May 2025 12:14:05 GMT
content-type: text/html; charset=utf-8
content-length: 0
location: https://plmlab.math.cnrs.fr/tomogroup/ufo-testing
cache-control: no-cache
content-security-policy:
nel: {"max_age": 0}
permissions-policy: interest-cohort=()
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-gitlab-meta: {"correlation_id":"01JVPSV0XE3KK39SP9S0VCWX9F","version":"1"}
x-permitted-cross-domain-policies: none
x-request-id: 01JVPSV0XE3KK39SP9S0VCWX9F
x-runtime: 0.030057
x-ua-compatible: IE=edge
x-xss-protection: 1; mode=block
strict-transport-security: max-age=63072000
referrer-policy: strict-origin-when-cross-origin

The connection to plmlab.math.cnrs.fr is tested using :

ping plmlab.math.cnrs.fr

Pyfai , With OpenCL ✅ | With ROCm ✅

Upstream : Copy the path to the pyfai repository on : https://salsa.debian.org/science-team/pyfai

Execution of :

        git clone : https://salsa.debian.org/science-team/pyfai.git

1. Placement in the pyfai directory:

        longeac@grades-01:~/pyfai$

2. Execution of :

        git clean -xdf; git reset --hard; dgit --gbp sbuild

3. Launching tests without rocm

Results :

        autopkgtest [14:32:37]: test command1:  - - - - - - - - - - results - - - - - - - - - -
        command1             PASS
        autopkgtest [14:32:37]: @@@@@@@@@@@@@@@@@@@@ summary
        no-opencl            SKIP Test declares architecture as not supported: amd64
        no-opencl            SKIP Test declares architecture as not supported: amd64
        opencl               FLAKY timed out
        command1             PASS
        
        I: Autopkgtest run was successful.
        
        +------------------------------------------------------------------------------+
        | Cleanup                                      Tue, 20 May 2025 12:32:38 +0000 |
        +------------------------------------------------------------------------------+
        
        Purging /build/reproducible-path
        Not cleaning session: cloned chroot in use
                
        +------------------------------------------------------------------------------+
        | Summary                                      Tue, 20 May 2025 12:32:40 +0000 |
        +------------------------------------------------------------------------------+
        
        Autopkgtest: pass
        Build Architecture: amd64
        Build Type: full
        Build-Space: 1099504
        Build-Time: 172
        Distribution: unstable
        Host Architecture: amd64
        Install-Time: 70
        Job: /home/experiences/grades/longeac/pyfai_2025.03-1.dsc
        Lintian: fail
        Machine Architecture: amd64
        Package: pyfai
        Package-Time: 254
        Piuparts: fail
        Source-Version: 2025.03-1
        Space: 1099504
        Status: successful
        Version: 2025.03-1
        --------------------------------------------------------------------------------
        Finished at 2025-05-20T09:41:46Z
        Build needed 00:04:14, 1099504k disk space

Autopkgtest passes Without ROCm , With OpenCL ✅ BUT , the OpenCL test does not pass because it is Timed OUT .

3. Execution of the autopkgtest command:

autopkgtest -B . -- schroot unstable-amd64-sbuild

        command1             PASS
        autopkgtest [16:30:13]: @@@@@@@@@@@@@@@@@@@@ summary
        no-opencl            SKIP Test declares architecture as not supported: amd64
        no-opencl            SKIP Test declares architecture as not supported: amd64
        opencl               PASS       
        pyfai-rocm           PASS
        command1             PASS

Code for the pyfai-rocm file :

        #!/bin/sh -e

        # Test OpenCL using ROCm ICD (GPU)
        # This script assumes rocm-opencl-icd is installed and working
        # ROCm drivers must be correctly configured on the host system

        export PYFAI_OPENCL=True
        export PYOPENCL_COMPILER_OUTPUT=1

        # skip test
        # TestAzimHalfFrelon.test_medfilt1d

        cp bootstrap.py run_tests.py pyproject.toml version.py README.rst "$AUTOPKGTEST_TMP"

        for py in $(py3versions -s 2>/dev/null)
        do cd "$AUTOPKGTEST_TMP"
           echo "Testing with $py:"
           xvfb-run -a --server-args="-screen 0 1024x768x24" $py run_tests.py -v -m --low-mem --installed
        done

Control file code :

# tests that must pass

        Tests: no-opencl
        Architecture: !amd64 !arm64 !armel !armhf !i386
        Depends:
         bitshuffle,
         python3-all,
         python3-pyfai,
         python3-tk,
         xauth,
         xvfb,
        Restrictions: allow-stderr, skip-not-installable
        
        Tests: opencl
        Architecture: amd64 arm64 armel armhf i386
        Depends:
         bitshuffle,
         pocl-opencl-icd,
         python3-all,
         python3-pyfai,
         python3-tk,
         xauth,
         xvfb,
        Restrictions: allow-stderr, skip-not-installable, flaky
        
        Tests: pyfai-rocm
        Architecture: amd64 arm64 armel armhf i386
        Depends:
         bitshuffle,
         rocm-opencl-icd,
         python3-all,
         python3-pyfai,
         python3-tk,
         xauth,
         xvfb,
        Restrictions: allow-stderr, skip-not-installable, flaky
        
        Test-Command: xvfb-run -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" sh debian/tests/gui
        Depends:
         debhelper,
         mesa-utils,
         @,
         xauth,
         xvfb,
        Restrictions: allow-stderr

TEST OPENCL POCL + ROCM ✅

silx with Pocl + Rocm ✅

Upstream : Copy the path to the pyfai repository on : https://salsa.debian.org/science-team/silx

Execution of :

git clone : https://salsa.debian.org/science-team/silx.git

1. Placement in the silx directory:

longeac@grades-01:~/silx$

2. orig.tar file missing, so create file:

origtargz

3. Test launch:

git clean -xdf; git reset --hard; dgit --gbp sbuild

Result:

no-opencl            PASS
        opencl               PASS
        command1             FAIL non-zero exit status 1

        E: Autopkgtest run failed.

        +------------------------------------------------------------------------------+
        | Cleanup                                      Thu, 15 May 2025 14:28:58 +0000 |
        +------------------------------------------------------------------------------+

        Purging /build/reproducible-path
        Not cleaning session: cloned chroot in use

        +------------------------------------------------------------------------------+
        | Summary                                      Thu, 15 May 2025 14:28:59 +0000 |
        +------------------------------------------------------------------------------+

        Autopkgtest: fail
        Build Architecture: amd64
        Build Type: binary
        Build-Space: 422772
        Build-Time: 232
        Distribution: unstable
        Host Architecture: amd64
        Install-Time: 70
        Job: /home/experiences/grades/longeac/silx_2.2.1+dfsg-3.dsc
        Lintian: fail
        Machine Architecture: amd64
        Package: silx
        Package-Time: 312
        Piuparts: fail
        Source-Version: 2.2.1+dfsg-3
        Space: 422772
        Status: successful
        Version: 2.2.1+dfsg-3
        --------------------------------------------------------------------------------
        Finished at 2025-05-15T14:17:32Z
        Build needed 00:05:12, 422772k disk space
        dgit ok: build successful, results in silx_2.2.1+dfsg-3_multi.changes

There's a problem with the command1 test, which doesn't work when you run the command:

longeac@grades-01:~/silx/debian/tests$ xvfb-run -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" sh debian/tests/gui
        xvfb-run: error: Xvfb failed to start

The error comes from the :

longeac@grades-01:~$ glxinfo
                Error: unable to open display

To do this, install mesa-utils :

sudo apt install mesa-utils

4. Add code to /debian/tests/control and /debian/tests/rocm-silx

Control:

        Tests: no-opencl
        Depends:
         @,
         python3-all,
         python3-pytest,
         python3-pytest-mock,
         python3-pytest-xvfb,
         xauth,
         xvfb,
        Restrictions: allow-stderr

        Tests: opencl
        Depends:
        @,
        clinfo,
        pocl-opencl-icd,
        python3-all,
        python3-pytest,
        python3-pytest-mock,
        python3-pytest-xvfb,
        xauth,
        xvfb,
        Architecture: !i386
        Restrictions: allow-stderr
        
        Test-Command:rocm-test-launcher opencl
        Depends:
         @,
         clinfo,
         pkg-rocm-tools,
         rocm-opencl-icd,
         python3-all,
         python3-pytest,
         python3-pytest-mock,
         python3-pytest-xvfb,
         xauth,
         xvfb,
        Architecture: !i386
        Restrictions: allow-stderr, skippable

        Test-Command: xvfb-run -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" sh debian/tests/gui
        Depends:
         mesa-utils,
         silx,
         xauth,
         xvfb,
        Restrictions: allow-stderr

5. Run the tests with the command:

autopkgtest -B . -- schroot unstable-amd64-sbuild

Résultats uniquement avec Pocl :

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-longeac'
        trapped status 143 and return success
        autopkgtest [10:58:05]: test command1: -----------------------]
        autopkgtest [10:58:05]: test command1:  - - - - - - - - - - results - - - - - - - - - -
        command1             PASS
        autopkgtest [10:58:06]: @@@@@@@@@@@@@@@@@@@@ summary
        no-opencl            PASS
        opencl               PASS
        command1             PASS

Results with Rocm :

trapped status 143 and return success
        autopkgtest [11:55:58]: test command1: -----------------------]
        autopkgtest [11:55:59]: test command1:  - - - - - - - - - - results - - - - - - - - - -
        command1             PASS
        autopkgtest [11:56:01]: @@@@@@@@@@@@@@@@@@@@ summary
        no-opencl            PASS
        opencl               PASS
        opencl-ROCm          SKIP exit status 77 and marked as skippable
        command1             PASS

Autopkgtests are passed with pocl-opencl-icd + rocm-opencl-icd ✅

nabu OpenCL pocl-opencl-icd + test rocm-opencl-icd ✅

1. Placement in nabu's directory:

longeac@grades-01:~/nabu$

2. Checking the availability of pocl-opencl-icd

apt-cache show pocl-opencl-icd

Result:

        Package: pocl-opencl-icd
        Source: pocl
        Version: 6.0-6
        Installed-Size: 47
        Maintainer: Debian OpenCL Maintainers <pkg-opencl-devel@lists.alioth.debian.org>
        Architecture: amd64
        Provides: opencl-icd, opencl-icd-1.1-1, opencl-icd-1.2-1
        Depends: libpocl2t64 (= 6.0-6)
        Description-en: PoCL ICD
        Portable Computing Language is an open source implementation of the OpenCL
        standard which can be easily adapted for new targets. One of the goals of the
        project is improving performance portability of OpenCL programs, avoiding the
        need for target-dependent manual optimizations. A "native" target is included,
        which allows running OpenCL kernels on the host (CPU).
        .
        This package allows one to use PoCL as an installable client driver (ICD) for
        OpenCL.
        Description-md5: a2a9ed5c155c582d02308f5380e633cd
        Multi-Arch: same
        Homepage: http://portablecl.org
        Tag: role::shared-lib
        Section: libs
        Priority: optional
        Filename: pool/main/p/pocl/pocl-opencl-icd_6.0-6_amd64.deb
        Size: 27100
        MD5sum: 277a0ea37bf0be5d1b66886917be70fb
        SHA256: 75a364f99809f7134fe0fd1dde4cb8c9d690c89bae348abe53f8fec0e2c89297

3. Update of the chroot used by sbuild so that it downloads and recognizes pocl-opencl-icd in longeac@grades-01:~/ :

sudo sbuild-update -ud unstable-amd64-sbuild

4. Check the chroot if it is installed, by :

ls /srv/chroot/

Résultat :

bookworm-amd64-sbuild            experimental-amd64-sbuild  testing-amd64-sbuild  unstable-amd64-sbuild
        bookworm-backports-amd64-sbuild  haskell                    trixie-amd64-sbuild

5. Verification of schroot recognition:

schroot -l

Result:

        longeac@grades-01:~/nabu$ schroot -l
        chroot:UNRELEASED
        chroot:UNRELEASED-amd64-sbuild
        chroot:UNRELEASED-amd64-sbuild-source
        chroot:UNRELEASED-source
        chroot:bookworm-amd64-sbuild
        chroot:bookworm-backports-amd64-sbuild
        chroot:experimental-amd64-sbuild
        chroot:haskell
        chroot:sid
        chroot:sid-source
        chroot:testing-amd64-sbuild
        chroot:unstable-amd64-sbuild
        source:UNRELEASED
        source:UNRELEASED-amd64-sbuild
        source:bookworm-amd64-sbuild
        source:bookworm-backports-amd64-sbuild
        source:experimental-amd64-sbuild
        source:haskell
        source:sid
        source:testing-amd64-sbuild
        source:unstable-amd64-sbuild

6. Do :

dgit --gbp sbuild 

7. See the differences between the previous commits

git diff

8. If Error, do a clean and hard reset: /!\ This deletes all modifications, IMPORTANT to commit beforehand otherwise you lose everything!

git clean -xdf; git reset --hard; dgit --gbp sbuild

Result:

Autopkgtest: pass
        Build Architecture: amd64
        Build Type: binary
        Build-Space: 15428
        Build-Time: 20
        Distribution: unstable
        Host Architecture: amd64
        Install-Time: 62
        Job: /home/experiences/grades/longeac/nabu_2024.2.1-1.dsc
        Lintian: fail   
        Machine Architecture: amd64
        Package: nabu
        Package-Time: 92
        Piuparts: fail
        Source-Version: 2024.2.1-1
        Space: 15428
        Status: successful
        Version: 2024.2.1-1
        --------------------------------------------------------------------------------
        Finished at 2025-05-15T11:09:23Z
        Build needed 00:01:32, 15428k disk space
        dgit ok: build successful, results in nabu_2024.2.1-1_multi.changes

9. Change to the directory : longeac@grades-01:~/nabu/debian/tests , and modify the control file :

nano conrol

Modifying the control file :

Tests: nabu-pocl
        Depends:
         clinfo,
         pocl-opencl-icd,
         python3-all,
         python3-nabu,
        Architecture: amd64 arm64
        Restrictions: allow-stderr
        
        Tests: nabu-rocm
        Depends:
         clinfo,
         rocm-opencl-icd,
         python3-all,
         python3-nabu,
        Architecture: amd64 arm64
        Restrictions: allow-stderr

Creating the file: nabu-rocm

        set -efu

        # Check that OpenCL isn't totally broken (note that it isn't totally working either)
        # Uses device 0 platform 0, i.e. to use a real GPU manually install its opencl-icd before running this

        # Mark the test has flaky, the important part is the CPU computation.

        # display the OpenCL platform info

        export HOME="$AUTOPKGTEST_TMP"

        clinfo

        # display opencl devices seens via nabu.

        # some tests are expected to fail
        # so list tests to skip in array variable SKIP_TEST_LIST

        declare -a SKIP_TEST_LIST

        SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} \
                        test_2D_lossless \
                        test_2D_lossy \
                        test_3D \
                        test_halftomo_right_side[config1] \
                        test_opencl_unsharp)

        SKIP_TESTS=""
        list_initialised=0
        for t in ${SKIP_TEST_LIST[@]}; do
            if [ ${list_initialised} = 0 ]; then
                SKIP_TESTS=$t
                list_initialised=1
            else
                SKIP_TESTS="${SKIP_TESTS} or $t"
            fi
        done
        
        if [ "x${SKIP_TESTS}" != "x" ]; then
            SKIP_TESTS="not ( ${SKIP_TESTS} )"
        fi
        
        echo "skipping tests with SKIP_TEST_LIST=${SKIP_TEST_LIST[@]}"
        
        for py in $(py3versions -r 2>/dev/null)
        do cd "$AUTOPKGTEST_TMP"
           echo "Testing with $py:"
           $py -c "import sys; import nabu.opencl.utils; print(nabu.opencl.utils.get_opencl_devices('all')); sys.exit(0)" 2>&1
           echo "$py -m pytest --pyargs nabu -v -k ${SKIP_TESTS}"
           $py -m pytest --pyargs nabu -v -k "${SKIP_TESTS}"
        done

10. Run tests with dgit --gbp sbuild , but it doesn't work because it only accepts perfect things so it's not being modified :

sbuild --no-clean-source

11. ROCm test launches

nabu-rocm            PASS
        autopkgtest [16:54:05]: @@@@@@@@@@@@@@@@@@@@ summary
        nabu-pocl            PASS
        nabu-rocm            PASS

        I: Autopkgtest run was successful.

        +------------------------------------------------------------------------------+
        | Cleanup                                      Thu, 15 May 2025 14:54:06 +0000 |
        +------------------------------------------------------------------------------+

        Purging /build/reproducible-path
        Not cleaning session: cloned chroot in use

        +------------------------------------------------------------------------------+
        | Summary                                      Thu, 15 May 2025 14:54:07 +0000 |
        +------------------------------------------------------------------------------+

        Autopkgtest: pass
        Build Architecture: amd64
        Build Type: full
        Build-Space: 15936
        Build-Time: 21
        Distribution: unstable
        Host Architecture: amd64
        Install-Time: 62
        Job: /home/experiences/grades/longeac/nabu_2024.2.1-1.dsc
        Lintian: fail
        Machine Architecture: amd64
        Package: nabu
        Package-Time: 93
        Piuparts: fail
        Source-Version: 2024.2.1-1
        Space: 15936
        Status: successful
        Version: 2024.2.1-1
        --------------------------------------------------------------------------------
        Finished at 2025-05-15T13:46:43Z
        Build needed 00:01:33, 15936k disk space
        longeac@grades-01:~/nabu$ git branch
        * master
        longeac@grades-01:~/nabu$

Validation of autopkgtest passage on rocm ✅

LES MAILS

>Pour debian science ** Info for Rocm command add-on:

'''Subject: rocm test launcher modifications when there is other non-AMD GPU cards.'''

Dear Sir or Madame, 

We have several NVIDIA cards and one AMD and want to test only on one, the AMD Radeon RX 6400 using this command rocm-test-launcher /debian/test/opencl. We encounter a problem when we want to run the test only on the AMD. The command takes all available cards, including NVDIA and AMD. We were able to solve the problem by lacing this command: OCL_ICD_VENDORS=/etc/OpenCL/vendors/amdocl64.icd rocm-test-launcher debian/tests/script, we would have to hide NVIDIA in order to test only on AMD Radeon RX 6400 . Rather than making a specific command for testing on the AMD or a specific card, would it be possible to add an option to the rocm-test-launcher /debian/test/opencl command, allowing specific selection of one or more cards for the test phases? Should we select the specific card we're interested in? 

Best regards, 
Clément LONGEAC

> Discussion of debian tags to add bugs for rocm

'''Subject: Debian tag proposal for ROCm bug tracking'''

Hello, 

I'am working on an overview of code compatibility with various AMD graphics cards, the codes on all the AMD boards available in the CI rocm. To equip the rocm package, I'm going to use the rocm-test-launcher script to enable installation/uninstallation tests on a blank virtual machine, the autopkgtest.A GSOC on the subjetc and the project was created by a confirmed Mentor: Cordell Bloorand and I'd like to know how to coordinate so as not to duplicate work. 

I propose introducing a specific Debian tag to make it easier to track ROCm-related bugs, especially for packages that use OpenCL and autopkgtest.

I propose the tag: rocm-compat or rocm-testing

This would make it easier to coordinate efforts on ROCm support and to identify specific compatibility issues, ROCm-related bugs and missing or failed tests (OpenCl , autopkgtest).

Does this type of tag seem relevant to you? Is there a previous tag?

Best regards,
Clément LONGEAC

TODO...

 * introduce yourself and the purpose of the internship on [[https://lists.debian.org/debian-science/|debian-science]] '''''FAIT'''''
 * prepare an email explaining the problem of machines with multiple graphics cards, and whether it was possible to hide them via the rocm-test-launcher.'''''FAIT''''' launch script
 * discuss on debian-science a debian tag to add bugs for rocm. '''''The mail is prepared about the tag'''''
 * find OpenCL tests if there are any. '''''FAIT'''''
 * if the upstream uses OpenCL but has no OpenCL tests, send a bug report to the upstream so that it can provide them. '''''Current''''' [[https://www.debian.org/Bugs/Reporting|BugReport]]

 * Add this bug/url report in an upstream column.
 * If unit tests are found, add a Debian bug report with the correct tag.
 * play the tests locally and report the bugs...

pytools, compyle, gpyfft, pyvkfft, python-dtcwt, xpra, pysph, pynx, pyfai, sasmodels, silx, python-xrt

* running test via command line

AUTOPKGTEST_TMP=/tmp OCL_ICD_VENDORS=/etc/OpenCL/vendors/amdocl64.icd rocm-test-launcher debian/tests/script 

* autopkgtest setup

try this https://salsa.debian.org/rocm-team/pkg-rocm-tools