Pytorch >= 2.1 is no more able to use my GPU :(

It was indeed an incompatibility with Windows 7.
If someone ever has the same problem, here is how I fixed it:

Don’t replace the embed python with pythonwin7, it’s not necessary. Don’t replace any dll either.
If you copied “api-ms-win-security-systemfunctions-l1-1-0.dll” to “system32”, remove it.

Install VxKex (the original repo is dead, I don’t know which new source is safe to download it from: i486/VxKex / Blaukovitch/VxKex)
In VxKex settings, add Forge’s “system/python/python.exe”

Uninstall pytorch and reinstall a compatible version, without torchaudio.

python -m pip uninstall Torch Torchvision Torchaudio
python -m pip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cu118

“LIBOMP140.X86_64.DLL” will be missing, it’s a known bug for pytorch 2.4.0. Download it, unzip and copy the dll in system32.
https://www.dllme.com/dll/files/libomp140_x86_64/00637fe34a6043031c9ae4c6cf0a891d

Voila.