there's many kinds of virtual machines in the cloud today anything from
general-purpose to those optimized for compute memory storage high-performance
computing workloads and also graphics we want to focus in on graphics a little
bit and that could be anything from simulation work AI deep learning and
then there's the workloads that are optimized for graphics work that could
be anything from streaming gaming encoding or using some kind of computer
assisted design software like SolidWorks or AutoCAD and this brings us to the NC
Riis virtual machines and depending on the VM that you select in that series
you might get a full single GPU all to yourself
multiple GPUs or just fractions of a GPU so there's lots of options based on the
kind of work that you need to do now what does this have to do with Windows
virtual desktop well wvd can take advantage of any kind
of virtual machine in the cloud we don't have any kind of limits there so that
means that if you have a graphic intensive workload or one that would
benefit from having a GPU to do some heavy processing then you should take a
look at the end Series VMs and there's some tips and tricks that we can show
you today and how to get this up and running as easy as possible so come with
us for the next few minutes as we unlock the potential of GPU accelerated VMs in
Windows virtual desktop
I'm Dean Cefola and this is the Azure Academy of course the use case for GPU
acceleration in VMs goes beyond Windows virtual desktop as we already had
mentioned but because this is a video and we have to show rather than tell you
about stuff we're gonna focus in on the graphics acceleration portion today
let's go over to the azure documentation and here we're gonna go right down to
Windows virtual desktop and then over on the left in our filter we're gonna type
GPU and then we'll click the link to deploy a GPU based session host the
first thing we're gonna need to do is to create a VM that is GPU accelerated and
for that we need the appropriate version of windows either windows 10 at 15 11 or
greater or Windows Server 2016 or greater then we're gonna need to install
the graphics driver and that could be either for AMD or for Nvidia whichever
one you want to use and there's different skews of the end series for
either of those then we'll show you how to configure the GPU for app rendering
or frame encoding whichever one suits you best then we're gonna test this with
several graphics benchmarks maybe throw in a little bit of a CAD software and if
we have some time we'll play a game of destiny but with that let's jump right
over to the azure portal and we're gonna go into our wvd admin portal and we'll
start off by creating a new host pool and we've given our host pool a name and
we'll store this in the east us then we come down to the host pool type now
depending on the kind of graphics work you are doing it may make more sense to
have a personal host pool rather than a pooled one we can leverage either one in
wvd for graphics acceleration it just depends on what your application is I'll
choose pooled for this with a max of two users per VM and I'll be setting my load
balancer type to depth mode and that means that two users will have to log on
to the first VM before anybody can log on to another one we'll click Next and
we're going to add a virtual machine here and we'll put it in the same
resource group as our host pool we have to change our VM size and we'll just
clear all filters at the top and then in the search box will type in
V and these are the current gpu-accelerated VMs that I have access
to in this subscription I'll be building on the N v6
SKU this is one that's made for more graphics rendering rather than doing
compute work and we'll hit select right now we'll just deploy one VM and we'll
name it with a prefix of GPU - wvd and we'll scroll down for our image we've
already got one in the shared image gallery so we'll be using that existing
image and if you missed our video on the shared image gallery go check that out
in the top right it'll help you deploy your VMs from an updated image every
single time we use a standard SSD for this VM and we'll scroll down for our
network stuff in a building on top of an existing network with no public IP
address for better security however we're not using a network security group
and that's because I already have one attached to my subnet and I've entered
my domain and owe you information as well as I'm using my AV join account
we'll click Next and we'll add a new workspace and we'll call that GPU
workloads and hit next and I've added the appropriate tag and we'll hit the
review and create button and our validation is passed so let's create now
that our builds done let's open up our client and then we'll go to login to our
new GPU enabled BM now that we're logged in we've got several different tests to
run to make sure that everything works correctly so the first one that we'll
run here is called fur mark this is a GPU stress test we're gonna use the
preset for 1080 here and be sure that you read through the warning we'll hit
go oh we've got a problem can't find our GPU let's try another test here this is
a test to see if your browser supports WebGL and you see the spinning box which
it does then we'll go to our web GL aquarium and that's not looking so hot I
wonder what the problem is well if we right click on start and then we go to
the device manager oh that's the problem our graphics driver isn't installed so
when you go and deploy a brand new n-series vm you have the hardware but
like any normal computer you need to setup the drivers now thankfully there
is a very easy way that we can do this and we're here
inside the VM in Azure we want to go on the left in the blade here two
extensions we want to go to add a new extension and there's two extensions
that we need to take note of and that's based on which n series VM you're using
so we'll scroll down a little bit here and you can see the NVIDIA GPU extension
and down here is the AMD GPU extension and the process is the same we just
click on it and click create and then you can read through the details if you
like here and we'll just hit OK to add that extension and back in our VM you
can see that our Tesla GPU has now been set up and it is going to force us to do
a reboot here but it's usually a good practice anyway and the extension
installation has been completed and our driver looks good now there's a few
different ways you can get some info about that new graphics card and we'll
just right click on start and go to run multi DX diag this is the DirectX
Diagnostics tool and this will be able to tell you a lot about your system
including your graphics card but we do have another issue our graphics card
here is showing up as unknown now why would that be when you have a Tesla
based GPU in your system they can show up in TCC mode which is headless that's
when you want to do all that number crunching and a eye deep learning etc or
they can be in WDDM mode which is the Windows display driver mode and that's
when we can use the card for graphics acceleration so now if we go back to fer
mark and we run our preset at 1080 and it actually does run now so we're seeing
47 49 frames a second here and I'll just cancel that and if we go back to our web
GL aquarium it looks a little bit better but we're still only getting four frames
a second and there's nothing actually wrong with the system
it just isn't set up yet for graphics acceleration so there's a few other
things to do here I've opened the local group policy editor on the system and of
course once this all works you can then move it up to ad group policy and what
we're gonna want is under the computer configuration admin templates windows
components Remote Desktop Services Desktop session host and then we go to
remote session environment so at the bottom here we'll want to enable use
hardware graphics adapter for remote desktop sessions will open that policy
and switch to enabled hit OK and then if you need to enable accelerated frame
encoding then you also want to turn on prioritize h.264 that will switch that
to enabled and then there is also configure h.264 and we'll turn that to
enabled as well so now that that's done we'll close out of the editor and from
an admin command prompt will run a GP update with the slash force flag there's
one more thing that we need to do and this is going to be a command line tool
for Nvidia that we've got to look up so we'll switch directories to see program
files and video corporation NV SMI and we want to run the Nvidia - SMI tool
with the - capital L parameter and that'll tell us all about our graphics
card and we see that this is listed as GPU 0 and if we run it with the -
lowercase L then this will give us a tail log of all the different
executables that are being used in the graphics card and we'll just break out
of that tail log for a moment and I want you to take notice of what we've got
here the GPU here can be run in TCC or WDDM mode and you can change that right
from inside this tool so if we run the nvidia - SMI tool again this time with
the FDM parameter that will force the graphics mode into mode 0 which is for
WDDM and then the - g flag tells us which GPU instance we're going to use in
case you have multiple GPUs we'll run that command and now that that's done we
do need to reboot the computer alright now that we're logged back in let's
reopen fer mark and we'll run our GPU stress test and we are pulling over 50
frames a second now and this is of course a very high intensive workload so
I'll just cancel that and then if we go back to our web GL page web GL works and
we'll reopen the aquarium and now we're pulling around 30 frames a second with
5,000 fish I've got another link here on my desktop and this is to run a test for
fluid particle this is another WebGL test I'll pick
this second example here and we'll just click start and as the particles all
fall in together you can see they react in a natural fluid dynamics way and I
can also interact with them with the mouse and make them move and do stuff
that's kind of cool let's go back to the edit button here that was at 35,000
particles but what happens if we kick it up to over 200,000 I'll hit start and
all the particles drop in and it responds still in a fluid manner any of
these kinds of tests that you could do on a WebGL level and there are several
of them well I'll show you how things can perform let's take a look at another
example so this is an unreal benchmark tool called the heav'n benchmark and
we'll just run this in the default configuration and even notice that
there's a little bit of audio in the background and we're over 80 frames a
second here and you can also interact with this by doing some of the function
keys we can see the wireframes that are going on we can also change our camera
angles we can look around if we want to and then we can move throughout the
system
right and we are easily pulling over a hundred frames a second
though things are very clearly working for us now and even DirectX diagnostics
here comes back with the proper video card information so at this point we are
good to go now the question is what can we do with this besides just running
cool little graphics tests so here I've got a software that's called Solid Edge
and this is from the SolidWorks series of CAD software and I'll just go to the
Browse here and go to the F Drive where I've got some Solid Edge files and I'll
pull up this representation of a LG refrigerator and I am certainly by no
means a CAD expert or Solid Edge or otherwise but I just want to show you
that yes then the objects are here and we can render them we can manipulate
them in real time in three dimensions thanks to our graphics card enabling us
and here's another example of a bulldozer that we can render and of
course there's more to doing autocad work than just spinning around 3d
designs but this is the extent of my knowledge so I'm sure someone else will
know much better how to leverage this but you can see that the graphics
acceleration is there and that makes workloads like this possible so now that
we've got everything set up tested and working what we want to do is we want to
make this now part of our wvb environment and that means we have to
capture this system as an image so to do that I need to flip over real quick to
an admin login Ameren see windows system32 sysprep and we will right click
and run assist prep as administrator we want to generalize and then choose the
shutdown option and hit OK this will take a couple minutes and if you missed
our video on how to create images with the shared image gallery go check that
out up here at the top because that's the process we're about to follow back
in the azure portal we'll click our capture button on our VM will give our
image a name store it in our WD management resource group check the box
to automatically delete the VM at once the image is created and we will click
create now that our image is finished being
created we can see inside it we have an OS disk and a data disc that I had
attached to that VM and that also means back in the resource group where the VM
was created that we do have some artifacts left over and that would be
the original discs and the NIC card from the VM which we can of course delete
just to keep things clean and while that's going on we'll go to the search
bar at the top and type in shared and then open the shared image gallery and
I'm gonna add this as a new image version to my existing definition
because I built it off of the same image and you could choose to import this as a
separate image if you wanted to it's totally up to you and I'll store this
version in the east us we'll call it version two pulling our GPU wvd VM image
as our source make sure that you do not exclude from the latest otherwise you
will not be able to use it to update your WVD host pools I've set a
end-of-life date for this version and we're just going to use one replicas so
we'll hit next and the default encryption is fine with me and I've
added the appropriate tags and we'll click Next and everything looks good so
let's create now that our imaging process is complete let's build
ourselves another VM based on that image will go into our session hosts and we'll
go to click Add and we'll click Next and since we've already built our first VM a
lot of this information is filled in for us will be provisioning in the Eastview
s our size is already set and we're provisioning one virtual machine and
since we just finished capturing our wvd image in the shared image gallery that's
the one that it's going to deploy and then we've got our regular network
settings as well as our ad joint account so we'll hit next and we've added all
the appropriate tags and we'll hit the review and create button everything
looks good so we'll create now that our builds complete we'll log
back in there's the WebGL aquarium with 5,000 fish running over 30 frames/second
and the fluid particle test mark running in 1080 over 50 frames a second and you
can see the same heav'n benchmark running peeking out at over 200 frames a
second alright so after all of that work how about we end with a little bit of
fun so in case you're not familiar with it this is a game called destiny and you
get to run around all different kinds of weapons and a set in a sci-fi dystopian
future
and the key takeaway here is not whether I'm good or not in playing destiny but
rather that our GPUs in Azure are able to handle everything from a graphic
intensive workload like SolidWorks all the way up to something
like a first-person video game and pretty much everything else in between
so hope that you've enjoyed looking at what a graphics power 2 BM can do for
you in a sure and of course how it can work inside
Windows virtual desktop and it'll help you to expand what you can already do
with a general-purpose VM into some fairly specific workloads and then of
course enable that at hyper scale so if you thought that this video was good or
learn something new please go ahead and hit that thumbs up and like the video
and if you're not currently subscribed to the Azure Academy why don't you
consider pressing that button and joining us here at the Azure Academy
where we're all just helping each other learn more about Azure if you have any
questions or comments please put them down below and I'll get to them as soon
as possible if you have an idea for another video that we can do please go
ahead and leave me that comment as well always looking for things that the
community is interested in and if you'd like to get an email notifying you when
our latest videos come out which is roughly once a week you can go ahead and
hit that notification bell as well and please feel free to share these videos
with anybody else who's interested in learning about Azure that's why we're
here and if you're looking for something more over here on the top right we've
got our latest video on the Azure Academy as well as one that we've
selected just for you down here on the bottom so that you can keep on learning
as much as you would like thanks very much for joining us today and we will
catch you in the next video happy learning