NVIDIA
Multi-Monitor Support
I have an application that I want to run in a VM with an M60, that application requires GPU accelerated displays. On bare metal hardware this application typically covers 4 Displays but in the VM I can only get one Desktop to show up in the NVIDIA Control Panel. How can I get multiple displays to show up in the NVIDIA Control Panel? Do I need to spoof EDID?
I have an application that I want to run in a VM with an M60, that application requires GPU accelerated displays. On bare metal hardware this application typically covers 4 Displays but in the VM I can only get one Desktop to show up in the NVIDIA Control Panel. How can I get multiple displays to show up in the NVIDIA Control Panel? Do I need to spoof EDID?

#1
Posted 07/26/2018 03:21 PM   
Technically, yes. The more monitors can be enabled with Nvidia NvAPI EDID upload (NvAPI_GPU_SetEDID()) upto vGPU profile monitor/displays limit count (NvAPI_GPU_GetAllDisplayIds()/NvAPI_GPU_GetConnectedDisplayIds()). Demo code to enable/disable secondary monitor/display with specified EDID: [code] NvAPI_Status ret; NvU32 nDisplayIds = 0; NvU32 physicalGpuCount = 0; NV_GPU_DISPLAYIDS pDisplayIds[NVAPI_MAX_DISPLAYS]; NvPhysicalGpuHandle hPhysicalGpu[NVAPI_MAX_PHYSICAL_GPUS]; NV_EDID edid; ret = NvAPI_Initialize(); if (ret != NVAPI_OK) return -1; // Enumerate the physical GPU handle and get the DisplayID ret = NvAPI_EnumPhysicalGPUs(hPhysicalGpu, &physicalGpuCount); if (ret != NVAPI_OK) return -1; // Query the total number of Display IDs printf("[b]physical GPUs[/b]: %d\n", physicalGpuCount); ret = NvAPI_GPU_GetAllDisplayIds(hPhysicalGpu[0], NULL, &nDisplayIds); if (ret != NVAPI_OK) return -1; printf("[b]displays on physical[0][/b]: %d\n", nDisplayIds); // Retrieve all of the Display IDs into pDisplayIDs pDisplayIds[0].version = NV_GPU_DISPLAYIDS_VER; ret = NvAPI_GPU_GetAllDisplayIds(hPhysicalGpu[0], pDisplayIds, &nDisplayIds); if (ret != NVAPI_OK) return -1; // set EDID memset(&edid, 0, sizeof(edid)); edid.version = NV_EDID_VER; memcpy(edid.EDID_Data, remoteEDID, sizeof(remoteEDID)); edid.sizeofEDID = sizeof(remoteEDID); // to set EDID to enable monitor (it is persistent between reboots) //edid.sizeofEDID = 0; // to remove EDID to disable monitor printf("[b]NvAPI_GPU_SetEDID for physical[0] display[1][/b]\n"); ret = NvAPI_GPU_SetEDID(hPhysicalGpu[0], pDisplayIds[1].displayId, &edid); if (ret != NVAPI_OK) return -1; [/code] You can make your own remoting VDI protocol ([url]https://gridforums.nvidia.com/default/topic/752/benchmarks/vdi-click-to-photon-with-raspberry-pi/[/url]) or use "VMware Horizon/PCoIP/Blast Extreme", "Citrix ICA/HDX" or "RedHat SPICE" (and many others [url]https://www.leostream.com/blog/making-vdi-work-choosing-a-display-protocol[/url]) that should scan EDID of attached monitor on remote VDI client and forward it back to VDI server, capture desktop (usually with NVidia Capture API), encode (usually with NVidia Codec API) and forward encoded screen to VDI client.
Technically, yes. The more monitors can be enabled with Nvidia NvAPI EDID upload (NvAPI_GPU_SetEDID()) upto vGPU profile monitor/displays limit count (NvAPI_GPU_GetAllDisplayIds()/NvAPI_GPU_GetConnectedDisplayIds()).
Demo code to enable/disable secondary monitor/display with specified EDID:
NvAPI_Status ret;
NvU32 nDisplayIds = 0;
NvU32 physicalGpuCount = 0;
NV_GPU_DISPLAYIDS pDisplayIds[NVAPI_MAX_DISPLAYS];
NvPhysicalGpuHandle hPhysicalGpu[NVAPI_MAX_PHYSICAL_GPUS];
NV_EDID edid;

ret = NvAPI_Initialize();
if (ret != NVAPI_OK) return -1;

// Enumerate the physical GPU handle and get the DisplayID
ret = NvAPI_EnumPhysicalGPUs(hPhysicalGpu, &physicalGpuCount);
if (ret != NVAPI_OK) return -1;

// Query the total number of Display IDs
printf("physical GPUs: %d\n", physicalGpuCount);
ret = NvAPI_GPU_GetAllDisplayIds(hPhysicalGpu[0], NULL, &nDisplayIds);
if (ret != NVAPI_OK) return -1;
printf("displays on physical[0]: %d\n", nDisplayIds);

// Retrieve all of the Display IDs into pDisplayIDs
pDisplayIds[0].version = NV_GPU_DISPLAYIDS_VER;
ret = NvAPI_GPU_GetAllDisplayIds(hPhysicalGpu[0], pDisplayIds, &nDisplayIds);
if (ret != NVAPI_OK) return -1;

// set EDID
memset(&edid, 0, sizeof(edid));
edid.version = NV_EDID_VER;
memcpy(edid.EDID_Data, remoteEDID, sizeof(remoteEDID));
edid.sizeofEDID = sizeof(remoteEDID); // to set EDID to enable monitor (it is persistent between reboots)
//edid.sizeofEDID = 0; // to remove EDID to disable monitor
printf("NvAPI_GPU_SetEDID for physical[0] display[1]\n");
ret = NvAPI_GPU_SetEDID(hPhysicalGpu[0], pDisplayIds[1].displayId, &edid);
if (ret != NVAPI_OK) return -1;

You can make your own remoting VDI protocol (https://gridforums.nvidia.com/default/topic/752/benchmarks/vdi-click-to-photon-with-raspberry-pi/) or use "VMware Horizon/PCoIP/Blast Extreme", "Citrix ICA/HDX" or "RedHat SPICE" (and many others https://www.leostream.com/blog/making-vdi-work-choosing-a-display-protocol) that should scan EDID of attached monitor on remote VDI client and forward it back to VDI server, capture desktop (usually with NVidia Capture API), encode (usually with NVidia Codec API) and forward encoded screen to VDI client.

#2
Posted 07/26/2018 04:06 PM   
My apologies for my ignorance, where can I find documentation on how to use this code?
My apologies for my ignorance, where can I find documentation on how to use this code?

#3
Posted 07/30/2018 03:20 PM   
The EDID upload code is for NvAPI - [url]https://developer.nvidia.com/nvapi[/url] and [url]https://devtalk.nvidia.com/default/board/77/nvapi/[/url]. As I wrote it is irrelevant if you are using some "professional" solution from VDI vendors that should include such a code. You should ask them for marketing jabbering, product portfolio and $$$ licensing fees and/or ask implementors from NGCA ([url]http://www.nvidia.com/object/vgpu-advisory-council.html[/url]) for example [b]the day after tomorrow[/b] @ [url]http://info.nvidia.com/vdi-panel-discussion-2018-aug-reg-page.html[/url].
The EDID upload code is for NvAPI - https://developer.nvidia.com/nvapi and https://devtalk.nvidia.com/default/board/77/nvapi/.
As I wrote it is irrelevant if you are using some "professional" solution from VDI vendors that should include such a code. You should ask them for marketing jabbering, product portfolio and $$$ licensing fees and/or ask implementors from NGCA (http://www.nvidia.com/object/vgpu-advisory-council.html) for example the day after tomorrow @ http://info.nvidia.com/vdi-panel-discussion-2018-aug-reg-page.html.

#4
Posted 07/30/2018 05:47 PM   
Scroll To Top

Add Reply