How to set md arguments for nvidia GPUs and AMD CPU

GROMACS version: 2024.1
GROMACS modification: No
My computer has two GPUs 3090 and two AMDs 9654. But I don’t know how to set them to get higher performance. This is my MD code:
gmx mdrun -v -deffnm md -nb gpu -pme gpu -npme 1 -ntmpi 16 -ntomp 4 -pin on -pinoffset 0
please help me!

With 2 AMD 9654 CPUs (192 hardware cores, 284 threads) I would try:
gmx mdrun -v -deffnm md -nb gpu -pme gpu -npme 1 -ntmpi 16 -ntomp 8
or
gmx mdrun -v -deffnm md -nb gpu -pme gpu -npme 1 -ntmpi 16 -ntomp 16

Sometimes I’ve found that it is more efficient to run just on one GPU (per simulation - and run multiple simulations in parallel), so it might be worth trying:
gmx mdrun -v -deffnm md -nb gpu -pme gpu -npme 1 -ntmpi 16 -ntomp 16 -gpu_id 0