Hard-IRQ time per interrupt grows with the number of timeline semaphores an application keeps alive (620.73.04)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 12/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- c, linux
- Domaine
- operating-systems, performance
Piste de recherche
Start in src/nvidia/src/kernel/rmapi/event_notification.c at _gpuEngineEventNotificationListNotify, which the ISR calls and which walks the per-engine listener list. Then read _semsurfRegisterCallback and _semsurfEventCallback in src/nvidia/src/kernel/gpu/mem_mgr/sem_surf.c to see how each semaphore adds a nonstall listener. Done means per-interrupt cost no longer grows with the number of live semaphores, which the reporter's measurements would need to confirm.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
While a Vulkan application that keeps one timeline semaphore alive per texture is running, a GPU interrupt costs 2.5 to 5 ms of hard-IRQ time, and the CPU that takes the interrupt is 84 to 96% busy in hard-IRQ context. With the same application changed to stop creating those semaphores, the same workload costs 0.09 ms per interrupt.
System
- RTX 3080 (GA102), one MSI interrupt
- NVIDIA open kernel module 620.73.04
- Linux 7.3.5 (zen), x86-64, KDE Plasma on Wayland
What the application does
It is a Metal-to-Vulkan layer (Indium, used by Darling) running a game. It created one timeline semaphore for every texture, texture view and drawable, and each queue submission waited on and signalled the semaphore of every texture it used. The number of live semaphores therefore grows as the game loads textures.
Measurements
Hard-IRQ time is the irq column of /proc/stat for the CPU that takes the GPU interrupt, divided by that CPU's count on the nvidia line of /proc/interrupts, sampled once a second.
| one semaphore per texture | no per-texture semaphores | |
|---|---|---|
| hard-IRQ time per GPU interrupt | 2.5 to 5 ms | 0.09 ms |
| CPU taking the interrupt | 84 to 96% in hard-IRQ | 9% |
| GPU interrupts handled per second | about 250 | about 1000 |
| frame rate | about 75 FPS | median 169 FPS |
At each of five starts of the application the cost per interrupt climbed steadily over about 40 seconds while it loaded textures, before it rendered a scene: 0.13 ms, then 0.4, 1.4, 2.4, and 3 to 5 ms. It returned to 0.1 ms the moment the process exited. Audio in unrelated applications dropped out while the handler was saturated and stopped doing so once the semaphores were gone.
Where the time goes in the source
In the 620.73.04 tree:
_gpuEngineEventNotificationListNotifyinsrc/nvidia/src/kernel/rmapi/event_notification.cis called from the ISR on Linux. It takes the per-engine list spinlock, visits every node on the list, and then callsosNotifyEventfor each one.semsurfCtrlCmdBindChannel_IMPLinsrc/nvidia/src/kernel/gpu/mem_mgr/sem_surf.ccalls_semsurfRegisterCallback, which allocates anNV01_EVENT_KERNEL_CALLBACK_EXwithNV01_EVENT_NONSTALL_INTRfor each semaphore surface and notify index. Those events are inserted into the same per-engine list, and_semsurfEventCallbackruns for each of them on every non-stall interrupt, including when it has no waiters._gpuEngineEventNotificationListLockPreemptiblespins while a notify pass is active, so adding or removing a listener waits for the handler.
The per-interrupt work is linear in the length of that list. The measured cost followed the number of textures the application had loaded, each owning one timeline semaphore, and it went away when the application stopped creating them.
Workaround
The layer is being changed to create no per-texture semaphores on NVIDIA.
- Langage dominant
- C
- Étoiles
- 17.7k
- Forks
- 2k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de NVIDIA/open-gpu-kernel-modules
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Les mainteneurs répondent en général sous 1 jour
-
nvidia-drm: NULL dereference in nv_drm_create_sync_file() when sync_file_create() fails (kernel oops when fs.file-max is exhausted)Peut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
NVIDIA/open-gpu-kernel-modules#1601 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
NVIDIA/open-gpu-kernel-modules#1479 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
PlatformRequestHandler: missing !bInit guard on bSystemParamLimitUpdate causes NV_ERR_INVALID_DATA at bootPeut-être pris @SammyTourani l’a pris il y a 69 jours. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
NVIDIA/open-gpu-kernel-modules#1360 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NVIDIA/open-gpu-kernel-modules#1343 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de NVIDIA/open-gpu-kernel-modules
Issues similaires
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameOuvertegame: 010065A014024000 ios
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
seedds/nxnative#3714 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
area/docdb kind/enhancement mvu-pg15-pg19 priority/low
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
yugabyte/yugabyte-db#40355 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Jstar269/nakagawa-recomp#3753 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
ly05010419/MacNativeGames#2474 ·
Les mainteneurs répondent en général sous 1 jour