@@ -246,23 +246,23 @@ public Map<AgentResourceBase, Map<String, String>> createServerResources(Map<Str
246246 private void createPhysicalGpuDevices (long hostId ) {
247247 // 1. Create passthrough-only GPU devices across different NUMA nodes and PCI roots
248248 createPassthroughGpu (hostId , "00:01.0" , "1234" , "5678" , "Apache CloudStack Simulator" ,
249- "Simulated Graphics Card Pro" , 0 , "pci0000:00" );
249+ "Simulated Graphics Card Pro" , 0 , "pci0000:00" , 8192L , 4096L , 2160L , 1L );
250250 createPassthroughGpu (hostId , "00:02.0" , "1234" , "5678" , "Apache CloudStack Simulator" ,
251- "Simulated Graphics Card Pro" , 0 , "pci0000:00" );
251+ "Simulated Graphics Card Pro" , 0 , "pci0000:00" , 8192L , 4096L , 2160L , 1L );
252252 createPassthroughGpu (hostId , "00:03.0" , "1234" , "6789" , "Apache CloudStack Simulator" ,
253- "Simulated Graphics Card Basic" , 1 , "pci0000:00" );
253+ "Simulated Graphics Card Basic" , 1 , "pci0000:00" , 4096L , 1920L , 1080L , 2L );
254254 createPassthroughGpu (hostId , "00:04.0" , "1234" , "6789" , "Apache CloudStack Simulator" ,
255- "Simulated Graphics Card Basic" , 1 , "pci0000:00" );
255+ "Simulated Graphics Card Basic" , 1 , "pci0000:00" , 4096L , 1920L , 1080L , 2L );
256256
257257 // Additional passthrough GPUs on different PCI roots
258258 createPassthroughGpu (hostId , "17:00.0" , "1234" , "5678" , "Apache CloudStack Simulator" ,
259- "Simulated Graphics Card Pro" , 2 , "pci0000:17" );
259+ "Simulated Graphics Card Pro" , 2 , "pci0000:17" , 8192L , 4096L , 2160L , 1L );
260260 createPassthroughGpu (hostId , "3a:00.0" , "1234" , "6789" , "Apache CloudStack Simulator" ,
261- "Simulated Graphics Card Basic" , 3 , "pci0000:3a" );
261+ "Simulated Graphics Card Basic" , 3 , "pci0000:3a" , 4096L , 1920L , 1080L , 2L );
262262 createPassthroughGpu (hostId , "5d:00.0" , "1234" , "5678" , "Apache CloudStack Simulator" ,
263- "Simulated Graphics Card Pro" , 2 , "pci0000:5d" );
263+ "Simulated Graphics Card Pro" , 2 , "pci0000:5d" , 8192L , 4096L , 2160L , 1L );
264264 createPassthroughGpu (hostId , "80:00.0" , "1234" , "6789" , "Apache CloudStack Simulator" ,
265- "Simulated Graphics Card Basic" , 3 , "pci0000:80" );
265+ "Simulated Graphics Card Basic" , 3 , "pci0000:80" , 4096L , 1920L , 1080L , 2L );
266266
267267 // 2. Create GPUs with Virtual Functions support on different NUMA nodes
268268 MockGpuDeviceVO vfParentDevice1 = createVfCapableGpu (hostId , "00:05.0" , "1234" , "789a" , "Apache CloudStack Simulator" ,
@@ -311,7 +311,7 @@ private void createPhysicalGpuDevices(long hostId) {
311311 * Creates a basic passthrough-only GPU device
312312 */
313313 private void createPassthroughGpu (long hostId , String busAddress , String vendorId , String deviceId ,
314- String vendorName , String deviceName , Integer numaNode , String pciRoot ) {
314+ String vendorName , String deviceName , Integer numaNode , String pciRoot , Long videoRam , Long resolutionX , Long resolutionY , Long maxHeads ) {
315315 MockGpuDeviceVO device = new MockGpuDeviceVO ();
316316 device .setBusAddress (busAddress );
317317 device .setVendorId (vendorId );
@@ -325,6 +325,10 @@ private void createPassthroughGpu(long hostId, String busAddress, String vendorI
325325 device .setPassthroughEnabled (true );
326326 device .setNumaNode (numaNode );
327327 device .setPciRoot (pciRoot );
328+ device .setVideoRam (videoRam );
329+ device .setMaxResolutionX (resolutionX );
330+ device .setMaxResolutionY (resolutionY );
331+ device .setMaxHeads (maxHeads );
328332 _mockGpuDeviceDao .persist (device );
329333 }
330334
@@ -359,6 +363,10 @@ private void createVirtualFunctions(long hostId, MockGpuDeviceVO parentDevice) {
359363 Long [] maxVgpuPerGpu = {2L , 4L , 4L };
360364 String parentBussAdressPrefix = parentDevice .getBusAddress ().substring (0 , parentDevice .getBusAddress ().length () - 1 );
361365 String [] vfAddresses = {parentBussAdressPrefix + "1" , parentBussAdressPrefix + "2" , parentBussAdressPrefix + "3" };
366+ Long [] videoRam = {8192L , 4096L , 4096L };
367+ Long [] resoultionX = {4096L , 1920L , 1920L };
368+ Long [] resoultionY = {2160L , 1080L , 1080L };
369+ Long [] maxHeads = {1L , 2L , 2L };
362370
363371 for (int i = 0 ; i < vfAddresses .length ; i ++) {
364372 MockGpuDeviceVO vfDevice = new MockGpuDeviceVO ();
@@ -374,6 +382,10 @@ private void createVirtualFunctions(long hostId, MockGpuDeviceVO parentDevice) {
374382 vfDevice .setProfileName (vfProfiles [i ]);
375383 vfDevice .setPassthroughEnabled (true );
376384 vfDevice .setMaxVgpuPerPgpu (maxVgpuPerGpu [i ]);
385+ vfDevice .setVideoRam (videoRam [i ]);
386+ vfDevice .setMaxResolutionX (resoultionX [i ]);
387+ vfDevice .setMaxResolutionY (resoultionY [i ]);
388+ vfDevice .setMaxHeads (maxHeads [i ]);
377389 // VF devices inherit NUMA node and PCI root from parent
378390 vfDevice .setNumaNode (parentDevice .getNumaNode ());
379391 vfDevice .setPciRoot (parentDevice .getPciRoot ());
@@ -411,7 +423,11 @@ private void createMdevDevices(long hostId, MockGpuDeviceVO parentDevice) {
411423 String [] mdevProfiles = { "sim-8q" , "sim-4q" , "sim-2q" , "sim-1q" , "sim-1q" };
412424 String [] mdevUuids = {UUID .randomUUID ().toString (), UUID .randomUUID ().toString (), UUID .randomUUID ().toString (),
413425 UUID .randomUUID ().toString (), UUID .randomUUID ().toString ()};
426+ Long [] videoRam = {8192L , 4096L , 2048L , 1024L , 1024L };
427+ Long [] resoultionX = {4096L , 1920L , 1920L , 1920L , 1920L };
428+ Long [] resoultionY = {2160L , 1080L , 1080L , 1080L , 1080L };
414429 Long [] maxVgpuPerGpu = {2L , 4L , 8L , 16L , 16L };
430+ Long [] maxHeads = {1L , 2L , 4L , 8L , 8L };
415431
416432 for (int i = 0 ; i < mdevProfiles .length ; i ++) {
417433 MockGpuDeviceVO mdevDevice = new MockGpuDeviceVO ();
@@ -427,6 +443,10 @@ private void createMdevDevices(long hostId, MockGpuDeviceVO parentDevice) {
427443 mdevDevice .setProfileName (mdevProfiles [i ]);
428444 mdevDevice .setPassthroughEnabled (true ); // MDEV devices don't use passthrough
429445 mdevDevice .setMaxVgpuPerPgpu (maxVgpuPerGpu [i ]);
446+ mdevDevice .setVideoRam (videoRam [i ]);
447+ mdevDevice .setMaxResolutionX (resoultionX [i ]);
448+ mdevDevice .setMaxResolutionY (resoultionY [i ]);
449+ mdevDevice .setMaxHeads (maxHeads [i ]);
430450 // MDEV devices inherit NUMA node and PCI root from parent
431451 mdevDevice .setNumaNode (parentDevice .getNumaNode ());
432452 mdevDevice .setPciRoot (parentDevice .getPciRoot ());
@@ -721,6 +741,10 @@ public List<VgpuTypesInfo> getGPUDevices(long hostId) {
721741 deviceId , deviceName , numaNode .toString (), pciRoot );
722742 vgpuTypesInfo .setPassthroughEnabled (isPassthrough );
723743 vgpuTypesInfo .setMaxVgpuPerGpu (maxVgpuPerGpu );
744+ vgpuTypesInfo .setVideoRam (mockGpuDevice .getVideoRam ());
745+ vgpuTypesInfo .setMaxResolutionX (mockGpuDevice .getMaxResolutionX ());
746+ vgpuTypesInfo .setMaxResolutionY (mockGpuDevice .getMaxResolutionY ());
747+ vgpuTypesInfo .setMaxHeads (mockGpuDevice .getMaxHeads ());
724748
725749 if (mockGpuDevice .getVmId () != null ) {
726750 MockVMVO mockVm = _mockVmDao .findById (mockGpuDevice .getVmId ());
0 commit comments