locked
C++ Amp on server RRS feed

  • Question

  • Hi

    I have some server apps doing a lot of math computations on floats and over a lot of data (arrays of millions). Using PPL I already get very good results but, reading about amp it seems that I can get even better performance. Here are a few questions:

    1. Are there any docs talking about amp on servers?

    2. Can I just add a powerful graphics card on a server and then take advantage of amp? Maybe there are some GPU extension cards to be used on servers?

    Thanks,

    G.

    Sunday, September 25, 2011 3:03 PM

Answers

  • Hi G

    Thank you for your investment in PPL and your interest in C++ AMP – you are at the right forum :-)

    Yes you can absolutely use C++ AMP on Windows Server 2008 R2 and code name Windows Server 8 (whenever that is released).

    We don’t have any dedicated documents for this scenario because the usage is largely the same as it is between client and server. There is only one gotcha that applies equally to client and server, hence it is not a Server-specific issue - by the time we release C++ AMP, the gotcha will be documented. The gotcha is around running your code under session 0, common for code running in a Windows service.

    As you know, our current implementation of C++ AMP is based on DirectX (and specifically the DirectCompute subset). Unfortunately, DirectX is not officially supported under session 0 for Windows 7 and Windows Server 2008 R2. Having said that, there is a difference between “it is not supported” and “it doesn’t work” ;-)

    We know of many customers who are successfully using DirectCompute under session 0. The fact that it is not supported means that it hasn’t been tested, so there may be quirky bugs or some DX APIs that fail. My quick test of a C++ AMP workload under session 0 (+ headless, with no other user logged on) worked fine; again, this is not an officially supported scenario so you are on your own if you go down that path. You may want to just try it and see how it behaves for your workload.

    If you want to stay within the supported realm of things, then you can refactor your code so there is still a portion running under session 0, which communicates to another code portion (the one that uses C++ AMP) that runs under an interactive session. Depending on the rest of your environment, you may need to enable auto-logon to an interactive session on your machine. Commercial customers of DirectCompute are using that supported approach already.

    The final option is to deploy Windows 8 or Windows Server 8 – the restriction does not exist in the latest OS, so you can run under session 0 in a fully supported manner without having to refactor your code. To learn more about this and many other enhancements to Windows Server 8 in the DirectX space, please watch this BUILD session:
    http://channel9.msdn.com/events/BUILD/BUILD2011/SAC-217T
    (ffw to 36:26 and watch 5 minutes for this particular topic, but the whole session has info you won’t find anywhere else today)

    In summary:
    - C++ AMP works on Server and client operating systems
    - Running under session 0 is not supported on Windows 7/Windows Server 2008 R2, but it may work for you
    - The supported way for the session 0 limitation is to refactor your code so that it uses a component that runs under an interactive session, and have that component use the GPU
    - Windows 8 and Windows Server 8 remove this limitation, based on customer feedback

    Cheers
    Daniel


    http://www.danielmoth.com/Blog/
    Tuesday, October 18, 2011 3:19 AM
  • Hi G

    So I think the question is if you can run C++ AMP (i.e. DirectCompute) code from within a remote desktop session, on Windows 7 or later, when the target machine does not have a display attached (headless).

    Yes, you can.

    Cheers

    Daniel


    http://www.danielmoth.com/Blog/
    • Marked as answer by GT227 Thursday, October 20, 2011 1:07 AM
    Wednesday, October 19, 2011 9:50 PM
  • Hi G

    If these replies are helping you, please mark them as answers so they appear at the top of this very long thread (it may also be a good idea to start a different topic per question).

     

    So your new question is about TDR. Here are two links that I found with my favorite search engine:

    HTH 

    Cheers

    Daniel


    http://www.danielmoth.com/Blog/
    • Marked as answer by GT227 Thursday, October 20, 2011 1:07 AM
    Thursday, October 20, 2011 12:34 AM

All replies

  • Hi,

    You can use C++ AMP on a server, but please be aware that Windows 7 and DirectX have some limitations, notably around headless (without display) servers.  These will be addressed in Windows 8, but I believe the upshot of this is that Windows 7 must have a display attached the GPU in order to use it.

    Thanks.


    ++don;
    Monday, September 26, 2011 5:30 PM
  • Ok but on our servers we have Windows server 2008 R2. We can add a GPU card (or so I was told by our data center people). I have even seen some prices and they seems ok (talking in server costs!).

    The other question is this: from the talks about amp and the samples I saw, it seems that all the data must be copied from the general purpose memory to the gpu memory. What happens if I want to process say an array which does not fit totally in the GPU memory?

    I guess I am still unclear whether AMP is a technology mostly applicable to workstations doing heavy graphics or can it really be used as a general purpose number cruncher?

    Thanks,

    G.

     

     

     

     

    Monday, September 26, 2011 7:54 PM
  • What I said about Windows 7 also applies to Windows 2008 R2.

    On your other question, if your data and/or problem size is too big to fit on the GPU, you'll have to split your problem into smaller chunks.

    Thanks.


    ++don;
    Monday, September 26, 2011 9:18 PM
  • What I said about Windows 7 also applies to Windows 2008 R2.

    Thanks.


    ++don;


    Ok here is a quote from your message about w7:

    ......

    I believe the upshot of this is that Windows 7 must have a display attached the GPU in order to use it.

    .....

    Does this really means that in the data center, in order to use C++ Amp based on DirectX I need a monitor attached?!

    Thanks,

    G.

     

    Monday, September 26, 2011 10:48 PM
  • Yes, unfortunately that's true.  It's a limitation of DirectCompute and we're working to address it in Windows 8.
    ++don;
    Monday, September 26, 2011 11:02 PM
  • Ok thanks. One more question: You say that it will be fixed on Windows 8 but for now I saw only Windows 8 on desktops. Is there a Windows 8 Server or something like that? if so do you have a target release date?

    Thanks,

    G

    Tuesday, September 27, 2011 3:43 AM
  • Hello again.  Unfortunately I can't discuss release dates for future and/or unannounced products. Let's just say that historically, each previous release of Windows has been followed by a subsequent server version of that release. :-)
    ++don;
    Tuesday, September 27, 2011 4:10 AM
  • Hi G

    Thank you for your investment in PPL and your interest in C++ AMP – you are at the right forum :-)

    Yes you can absolutely use C++ AMP on Windows Server 2008 R2 and code name Windows Server 8 (whenever that is released).

    We don’t have any dedicated documents for this scenario because the usage is largely the same as it is between client and server. There is only one gotcha that applies equally to client and server, hence it is not a Server-specific issue - by the time we release C++ AMP, the gotcha will be documented. The gotcha is around running your code under session 0, common for code running in a Windows service.

    As you know, our current implementation of C++ AMP is based on DirectX (and specifically the DirectCompute subset). Unfortunately, DirectX is not officially supported under session 0 for Windows 7 and Windows Server 2008 R2. Having said that, there is a difference between “it is not supported” and “it doesn’t work” ;-)

    We know of many customers who are successfully using DirectCompute under session 0. The fact that it is not supported means that it hasn’t been tested, so there may be quirky bugs or some DX APIs that fail. My quick test of a C++ AMP workload under session 0 (+ headless, with no other user logged on) worked fine; again, this is not an officially supported scenario so you are on your own if you go down that path. You may want to just try it and see how it behaves for your workload.

    If you want to stay within the supported realm of things, then you can refactor your code so there is still a portion running under session 0, which communicates to another code portion (the one that uses C++ AMP) that runs under an interactive session. Depending on the rest of your environment, you may need to enable auto-logon to an interactive session on your machine. Commercial customers of DirectCompute are using that supported approach already.

    The final option is to deploy Windows 8 or Windows Server 8 – the restriction does not exist in the latest OS, so you can run under session 0 in a fully supported manner without having to refactor your code. To learn more about this and many other enhancements to Windows Server 8 in the DirectX space, please watch this BUILD session:
    http://channel9.msdn.com/events/BUILD/BUILD2011/SAC-217T
    (ffw to 36:26 and watch 5 minutes for this particular topic, but the whole session has info you won’t find anywhere else today)

    In summary:
    - C++ AMP works on Server and client operating systems
    - Running under session 0 is not supported on Windows 7/Windows Server 2008 R2, but it may work for you
    - The supported way for the session 0 limitation is to refactor your code so that it uses a component that runs under an interactive session, and have that component use the GPU
    - Windows 8 and Windows Server 8 remove this limitation, based on customer feedback

    Cheers
    Daniel


    http://www.danielmoth.com/Blog/
    Tuesday, October 18, 2011 3:19 AM
  • Hi Daniel,

    Thanks much for this posting!! As you can see from this thread, there is a replay stating that I need a a session opened on the server in order to use C++ Amp.

    A confusion goes a long way to create other confusions :)... and today on a call with Amd I told them that I cannot use their GPUs with C++ Amp.

    Ok so let's recap: I get a GPU card supporting DX 11 and I put it in one of our servers. There are no monitors attached and no user logged on. One of the two things will happen:

    1. My server service may just happen to work ok with no user logged on or,

    2. I need to open an interactive session and have that session use the GPU. Actually, if I use Remote Desktop to log on, I can run in that session C++ Amp ok? Is this true? (I hope there isn't a need to have a physical monitor attached is it?!)

    Thanks,

    G.

     

     

     

     

    Tuesday, October 18, 2011 7:02 PM
  • Hi G

    So I think the question is if you can run C++ AMP (i.e. DirectCompute) code from within a remote desktop session, on Windows 7 or later, when the target machine does not have a display attached (headless).

    Yes, you can.

    Cheers

    Daniel


    http://www.danielmoth.com/Blog/
    • Marked as answer by GT227 Thursday, October 20, 2011 1:07 AM
    Wednesday, October 19, 2011 9:50 PM
  • .....

    when the target machine does not have a display attached (headless).

    Yes, you can.

    ........

    Ok good so this is a supported way of running C++ Amp on Windows Server 2008 R2 (no need to wait for server 8 or whatever will be called).

    Regarding TDR: I checked the NVidia control panel on my laptop and there is no option to change or disable this. Maybe this is normal in the laptop but, on the server I want the GPU to be used exclusively for computing.

    What is the preferred way of turning off the TDR? is there an OS option somewhere (Server 2008 R2)?

    Thank you very much,

    G.

    Wednesday, October 19, 2011 10:25 PM
  • Hi G

    If these replies are helping you, please mark them as answers so they appear at the top of this very long thread (it may also be a good idea to start a different topic per question).

     

    So your new question is about TDR. Here are two links that I found with my favorite search engine:

    HTH 

    Cheers

    Daniel


    http://www.danielmoth.com/Blog/
    • Marked as answer by GT227 Thursday, October 20, 2011 1:07 AM
    Thursday, October 20, 2011 12:34 AM
  • Hi Daniel,

    I marked the questions as answered.

    At this point I think I still have a few more questions but, I have a good idea of what I need to do to start testing C++ Amp on a 2008 R2 server. I will get a GPU card, install it and see how it goes. Hopefully after disabling the TDR there will be really no issues.

     

    Thanks again,

    G.

     

    Thursday, October 20, 2011 1:15 AM