Skip to content

Issue with g4dn instances when running applications built using openGL

0

Hi, I have a number of services that use openGL which I run on g4dn EC2s. These process based services automatically runs, once the Windows (2022 svr) OS has booted and before logging into the machine, as this is required for the applications which use these services which do not necessary run on the same machine. The issue I have is, these processes fail to start with an exception about being unable to use openGL. If I RDP to the machine and start the process again it will launch and perform as expected. After some investigation it would seem the vGPU (Tesla T4) assigned to the g4dn is only used once I RDP to the machine, before I do this the Basic Display Adaptor is the only available resource. I have currently worked around this issue by disabling the Basic display adaptor and now the instance starts up and the vGPU is immediately available and and I do not have to log in to the machine to get things working as they should. I have been able to run the same test using equipment I have available on-prem, but this does not exhibit the same problems. However the testing was done without the use of a hypervisor.

asked a year ago507 views

2 Answers
1

For logon, you can use autologon to configure Windows to auto login to desktop on startup.

If you have not, install NVIDIA Grid (aka NVIDIA RTX Virtual Workstation) driver on your Windows 2022 EC2 instance.

Also, connect to your EC2 instance using Amazon DCV instead of RDP, as RDP uses a different display driver. You can verify from Computer Management, Device Manager, Display

You can install NVIDIA and DCV from official documentation, or refer to blog Building a high-performance Windows workstation on AWS for graphics intensive applications.

Below is a screenshot of G4dn with GRID driver installed, and DCV web browser client. It was created using CloudFormation template from GitHub repo mentioned in blog post.

Windows G4dN Grid

AWS
EXPERT

answered a year ago

0

The issue you're experiencing with OpenGL applications on g4dn instances is related to how Windows handles GPU resources before a user logs in. This is a common challenge when running GPU-dependent applications on remote Windows servers, especially in virtualized environments like EC2.

The behavior you've observed, where the NVIDIA Tesla T4 GPU is only available after RDP login, is due to how Windows manages display drivers and GPU resources in remote sessions. By default, Windows uses a basic display adapter until a user logs in, which can cause OpenGL-dependent applications to fail.

Your workaround of disabling the Basic Display Adapter is a valid approach to force Windows to use the NVIDIA GPU from startup. However, there are a few other potential solutions you could try:

  1. Use Windows autologon: Configure Windows to automatically log in a user account at startup. This ensures that the full GPU capabilities are available immediately.

  2. Install the latest NVIDIA GRID drivers: Ensure you have the most up-to-date NVIDIA GRID drivers installed, as these are optimized for virtualized GPU environments like EC2.

  3. Modify Windows display settings: Adjust Windows settings to maintain a consistent resolution and display configuration, regardless of RDP connection status. This may involve registry changes or group policy adjustments.

  4. Use a virtual display adapter: Install a virtual display adapter driver to create a persistent "fake" display that OpenGL can interact with, even when no user is logged in.

  5. Consider using NICE DCV: AWS NICE DCV is a remote visualization technology that may provide better GPU support in headless scenarios.

If these solutions don't fully resolve the issue, you may need to explore more advanced options or consider redesigning your application deployment to work within the constraints of remote Windows server environments on EC2. It's also worth noting that the behavior you're seeing is specific to virtualized environments, which explains why you didn't encounter the same issue in your on-premises testing without a hypervisor.

Remember to test any changes thoroughly in a non-production environment before implementing them in your production setup.
Sources
Unsupported OpenGL Version on Windows EC2 2019 Base Image - Used for Medical Imaging | AWS re:Post
windows server problem | AWS re:Post

answered a year ago

AWS
SUPPORT ENGINEER

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.