Объяснение ограничений работы OpenCL/GPU в сервисах MQL5 Cloud Network и удаленных агентов

 

Windows Session 0 Isolation Impact on GPU Computing
Tim Child, 1 June 20, 2011


1. Introduction

With the introduction of Windows Vista, Windows Server 2008, and recently Windows 7, GPU applications that run as Windows Service are impacted by Session 0 Isolation (S0I). For the GPU applications the impact is severe. S0I prevents any and all GPU applications, via CUDA, OpenCL or in thefuture Direct Compute/C++ AMP from running as a Windows service.

The S0I restrictions of a Windows Service are documented in a Microsoft document http://www.microsoft.com/whdc/system/sysinternals/Session0Changes.msp and "Application Compatibility: Session 0 Isolation" http://msdn.microsoft.com/en-us/library/bb756986.aspx.


2. Session 0 Isolation

Session 0 Isolation is Windows security feature that is designed to prevent inappropriate and unauthorized access, from service and drivers to O/S resources including the graphics sub-system.


3. Use Cases

Are there valid use cases for running GPU code as a service? Yes, there are many use cases where GPU code is best run as Service. Running as a Service serves several purposes. It allows for a background always present resource and it provides a single process that can be shared by multiple users or applications.

These include:

  • Folding At Home
  • Render Farms
  • GPU Accelerated databases
  • GPU Accelerated AI and Neural Network Systems, that background process
  • GPU Accelerated middleware include Web Servers and Application Servers


4. Microsoft Proposed Work Around

Microsoft has proposed several alternatives Services to access to the UI.

They are:

  • Use a client/server mechanism such as remote procedure call (RPC) or named pipes rather than window messages to communicate with applications.
  • Implement any necessary user interface for the service as follows: use the WTSSendMessage function to create a simple message box on the user’s desktop. This allows the service to give the user a notification and request a simple response.

For more complex interactions, developers should move their UI code into an agent that runs in the user’s session and handles all UI requirements. The agent communicates with the service through RPC or named pipes. If the user initiates the UI interaction by using Control Panel, Internet Explorer, or a similar UI experience, that UI experience should start the agent.

The agent then handles all UI interactions. If UI is required but is not initiated by the user, the service must request the agent to start any required UI,instead of attempting to launch that UI by itself. In the rare situation where the service must initiate a user interaction and the agent is not already running, the service should call the CreateProcessAsUser API to start the agent.

The agent can then initiate all UI interactions. It is important for developers to carefully review all possible usage scenarios and consider moving all UI code into an agent that runs in the user session.

These work-arounds are not satisfactory as they don’t provide access to the GPU.


5. User Work Arounds

There are a couple of work-arounds, the first is to create a batch script that runs at start-up time. This starts a process that isn’t service which can use GPU code running in a process. This is not very satisfactory as it creates a system administration burden. Restarting a user process cannot be done from the Service Manager console or via an API call.

The industry has another very simple but unfortunate remedy, it’s not to run on Windows, and run on Linux systems.


6. GPU Vendor Work-Arounds

I understand that for non-graphics GPUs such as the Nvidias’ Tesla, it’s possible to use a special driver or a driver patch that allows a Windows Service to access a GPU. This is a special case. Most GPU aren’t Teslas they are dual usage devices for graphics and compute.


7. Forum and Blog Posts

Below are links to blog and forum posts discussing the issue:


 
Renat:

Windows Session 0 Isolation Impact on GPU Computing
Tim Child, 1 June 20, 2011


Почему только на английском??? Можно ли перевисти на наш рускиий великий и могучий.... Очень инересно прочесть
 

Dear Renat ,

I think that I'm using NVIDIA Tesla in the Metatrader Strategy Tester .

I am so glad that you have worked on this case and interested .

It is possible that Metatrader Strategy Tester Agent is specially develop for use GPU ?


Thank You

 
GKS:
Почему только на английском??? Можно ли перевисти на наш рускиий великий и могучий.... Очень инересно прочесть
Перевод не лучший, но хоть что-то. (гугл рулит )) )
 
Hi Renat
We are interested in the GPU subject , while that  Mr. Biglari and fourozandeh. working in project and Our team is ready to cooperate in this case.
Thanks
www.softsys.net
 
mnn:

Hi Renat
We are interested in the GPU subject , while that  Mr. Biglari and fourozandeh. working in project and Our team is ready to cooperate in this case.
Thanks
www.softsys.net

Hi,

Before we need to solve main issue with OpenCL in service mode.

 
Renat:

Hi,

Before we need to solve main issue with OpenCL in service mode.

Hi ,

If using Windows HPC Server 2008 R2 can access GPU Driver in session 0 .

Enable HPC_CREATECONSOLE for GPGPU Jobs in Windows HPC Server 2008 R2,http://technet.microsoft.com/en-us/library/gg247477%28v=ws.10%29.aspx .


"NVIDIA Tesla Compute Cluster (TCC) drivers run in session 0, and they do not require GPGPU jobs to run in a console session.


Please check It ,

Thank you

Enable HPC_CREATECONSOLE for GPGPU Jobs in Windows HPC Server 2008 R2
  • technet.microsoft.com
To enable the create console functionality, a cluster administrator must add the following values in the registry on the compute nodes that will run GPGPU jobs: HpcConsoleSupport: This enables the HPC Node Manager Service to create a console session for the job owner. SoftwareSASGeneration: This enables the software to simulate the...
 

Hi renat

We're ready to do anything that requires
We're still waiting good news

Thank you majid


Причина обращения: