Ubuntu 24 : Stable diffusion : Problème avec Python 3.12 & torch

Avec Python 3.12.3 :

Python 3.12.3 (main, Feb  4 2025, 14:48:35) [GCC 13.3.0]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
ERROR: Could not find a version that satisfies the requirement torch==2.1.2 
(from versions: 2.2.0, 2.2.0+cu121, 2.2.1, 2.2.1+cu121, 2.2.2, 2.2.2+cu121, 
2.3.0, 2.3.0+cu121, 2.3.1, 2.3.1+cu121, 2.4.0, 2.4.0+cu121, 2.4.1, 
2.4.1+cu121, 2.5.0, 2.5.0+cu121, 2.5.1, 2.5.1+cu121, 2.6.0, 2.7.0)
ERROR: No matching distribution found for torch==2.1.2

Donc j’utilise Python 3.11 :

# apt-get install python3-setuptools
# apt-get install python3-build
# python3.11 -m pip install --upgrade pip setuptools wheel
# virtualenv -p /usr/bin/python3.11 venv
created virtual environment CPython3.11.12.final.0-64 in 1366ms
  creator CPython3Posix(dest=/home/XXXX/stable-diffusion-webui/venv, clear=False, 
no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, 
via=copy, app_data_dir=/home/XXXX/.local/share/virtualenv)
    added seed packages: pip==24.0, setuptools==68.1.2, wheel==0.42.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
$ source venv/bin/activate
$ python3.11 -m pip install --upgrade pip setuptools wheel
$ bash webui.sh --api --listen

Proxmox / Ollama / Open WebUI : Migration OS de la VM

Je suis passé en version « Ubuntu 24.04.2 LTS » (le kernel est 6.8.0-60-generic)

Migration :

  • Ubuntu 22.04.5 LTS ( kernel : 5.15.0-140-generic ) => Ubuntu 24.04.2 LTS (kernel est 6.8.0-60-generic)
  • CUDA : 12.8.93 => 12.9
  • Python : 3.11 => 3.12

Les cartes NVIDIA sont toujours visibles :

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 575.51.03              Driver Version: 575.51.03      CUDA Version: 12.9     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  Quadro M5000                   Off |   00000000:00:10.0 Off |                  Off |
| 39%   44C    P8             14W /  150W |       5MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  Quadro M4000                   Off |   00000000:00:11.0 Off |                  N/A |
| 49%   48C    P8             14W /  120W |       5MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

J’ai refait un benchmark :

 llm_benchmark run
-------Linux----------
{'id': '0', 'name': 'Quadro M5000', 'driver': '575.51.03', 
'gpu_memory_total': '8192.0 MB', 'gpu_memory_free': '8110.0 MB', 
'gpu_memory_used': '5.0 MB', 'gpu_load': '0.0%', 'gpu_temperature': '44.0°C'}
{'id': '1', 'name': 'Quadro M4000', 'driver': '575.51.03', 
'gpu_memory_total': '8192.0 MB', 'gpu_memory_free': '8110.0 MB', 
'gpu_memory_used': '5.0 MB', 'gpu_load': '0.0%', 'gpu_temperature': '48.0°C'}
At least two GPU cards
Total memory size : 119.03 GB
cpu_info: Intel(R) Xeon(R) CPU E5-2450 v2 @ 2.50GHz
gpu_info: Quadro M5000
Quadro M4000
os_version: Ubuntu 24.04.2 LTS
ollama_version: 0.9.0
----------
...
At least two GPU cards
{
    "phi4:14b": "6.75",
    "deepseek-r1:14b": "6.19",
    "deepseek-r1:32b": "0.43",
    "uuid": "2a3d3de2-5e53-5b28-a909-62559c5a817c",
    "ollama_version": "0.9.0"
}
-------

Maintenant les grands modèles (deepseek-r1:32b) ne font plus planter le test …. qui dure 4 heures.

Misère.

Tuxedo : Migration vers Ubuntu 24.04.2 LTS et galère …

En passant

J’ai pas la liste complete des actions que j’ai du faire.

Mais j’ai du supprimer « douane » :

dkms remove douane/0.8.2 --all

Sinon j’avais une erreur :

make -j8 KERNELRELEASE=6.8.0-53-generic -C /lib/modules/6.8.0-53-generic/build M=/var/lib/dkms/douane/0.8.2/build...(bad exit status: 2)
ERROR (dkms apport): binary package for douane: 0.8.2 not found
Error! Bad return status for module build on kernel: 6.8.0-53-generic (x86_64)
Consult /var/lib/dkms/douane/0.8.2/build/make.log for more information.
dkms autoinstall on 6.8.0-53-generic/x86_64 succeeded for tuxedo-keyboard virtualbox
dkms autoinstall on 6.8.0-53-generic/x86_64 failed for douane(10)
Error! One or more modules failed to install during autoinstall.

J’ai du supprimer aussi « tuxedo-cc-wmi », pareil sinon j’avais une erreur :

apt-get remove tuxedo-cc-wmi

L’erreur :

make -j8 KERNELRELEASE=6.8.0-53-generic -C . KDIR=/lib/modules/6.8.0-53-generic/build...(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/tuxedo-cc-wmi.0.crash'
Error! Bad return status for module build on kernel: 6.8.0-53-generic (x86_64)
Consult /var/lib/dkms/tuxedo-cc-wmi/0.1.7/build/make.log for more information.

Pour l’instant je suis stable avec le kernel :

# uname -a
Linux CYBERNEURONES 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.2 LTS
Release:    24.04
Codename:   noble

Mais pas possible de lancer le kernel : « 6.8.0-53-generic ».

Avant ceci j’ai eu beaucoup de problème avec Xorg :

sudo apt-add-repository universe 
sudo apt-get update
sudo apt-get install i965-va-driver intel-media-va-driver

sudo adduser $USER video

Misère …

Mise à jours de Grafana sous Ubuntu

J’ai une version Grafana : v6.7.4 (June 3, 2020) sous Ubuntu. J’ai donc fait une mise à jours vers la version v10.3.3 .

En fait le « apt upgrade » ne fonctionnait pas.

 Le fichier configuré « main/binary-i386/Packages » ne sera pas pris en compte 
car le dépôt « https://apt.grafana.com stable InRelease » 
ne prend pas en charge l'architecture « i386 »

J’ai donc fait :

# apt-get install -y adduser libfontconfig1 musl
# wget https://dl.grafana.com/enterprise/release/grafana-enterprise_10.3.3_amd64.deb
# cp /var/lib/grafana/grafana.db .
# apt-get remove grafana
# sudo snap remove grafana
# sudo dpkg -i grafana-enterprise_10.3.3_amd64.deb
# sudo /bin/systemctl daemon-reload
# sudo /bin/systemctl enable grafana-server
# updatedb
# cp /var/lib/grafana/grafana.db /var/lib/grafana/grafana.db.backup
# cp /root/grafana.db /var/lib/grafana/grafana.db

Je suis passé du port 3000 au port 3001.
Le backup de la configuration ( grafana.db )  n’a pas fonctionné …

Misère.