@@ -819,12 +819,13 @@ public HashMap<String, HashMap<String, VgpuTypesInfo>> getGpuGroupDetailsFromGpu
819819 for (final GpuDeviceVO device : gpuDevices ) {
820820 // Calculate GPU capacity and update gpuGroupDetails
821821 GpuCardVO card = gpuCardDao .findById (device .getCardId ());
822- if (!gpuGroupDetails .containsKey (card .getDeviceName ())) {
823- gpuGroupDetails .put (card .getDeviceName (), new HashMap <>());
822+ String groupName = card .getName ();
823+ if (!gpuGroupDetails .containsKey (groupName )) {
824+ gpuGroupDetails .put (groupName , new HashMap <>());
824825 }
825826 VgpuProfileVO vgpuProfile = vgpuProfileDao .findById (device .getVgpuProfileId ());
826827
827- VgpuTypesInfo gpuDeviceInfo = gpuGroupDetails .get (card . getDeviceName () ).get (vgpuProfile .getName ());
828+ VgpuTypesInfo gpuDeviceInfo = gpuGroupDetails .get (groupName ).get (vgpuProfile .getName ());
828829 long remainingCapacity = 0L ;
829830 long maxCapacity = 1L ;
830831 if (GpuDevice .State .Free .equals (device .getState ()) && GpuDevice .ManagedState .Managed .equals (
@@ -836,9 +837,14 @@ public HashMap<String, HashMap<String, VgpuTypesInfo>> getGpuGroupDetailsFromGpu
836837 remainingCapacity = 0L ;
837838 }
838839 if (gpuDeviceInfo == null ) {
839- gpuDeviceInfo = new VgpuTypesInfo (card .getName (), vgpuProfile .getName (), null , null , null , null ,
840+ gpuDeviceInfo = new VgpuTypesInfo (card .getName (), vgpuProfile .getName (), vgpuProfile .getVideoRam (), vgpuProfile .getMaxHeads (),
841+ vgpuProfile .getMaxResolutionX (), vgpuProfile .getMaxResolutionY (),
840842 vgpuProfile .getMaxVgpuPerPgpu (), remainingCapacity , maxCapacity );
841- gpuGroupDetails .get (card .getDeviceName ()).put (vgpuProfile .getName (), gpuDeviceInfo );
843+ gpuDeviceInfo .setDeviceName (card .getDeviceName ());
844+ gpuDeviceInfo .setVendorId (card .getVendorId ());
845+ gpuDeviceInfo .setVendorName (card .getVendorName ());
846+ gpuDeviceInfo .setDeviceId (card .getDeviceId ());
847+ gpuGroupDetails .get (groupName ).put (vgpuProfile .getName (), gpuDeviceInfo );
842848 } else {
843849 // Update the existing VgpuTypesInfo with the new device's information
844850 gpuDeviceInfo .setRemainingCapacity (gpuDeviceInfo .getRemainingCapacity () + remainingCapacity );
0 commit comments