GTC18 Session S8483 – Empowering CUDA Developers with Virtual Desktops

S8483 - Empowering CUDA Developers with Virtual Desktops - Slide Deck

Thank you to all attendees who started GTC18 at this session. I hope it was helpful for you. When recordings are available I will add them to this post as well.

For your enjoyment, here are the slides from my GTC18 session, S8483, Empowering CUDA Developers with Virtual Desktops.

If you are interested in the results I obtained on VMs with the various profiles they are as follows:

You can look at these and see point in time runs of CUDA sample applications running in a virtual machine (VM). Realize these aren’t indicative of actual performance and your results may vary substantially.  The only purpose of these results is to show that the VMs are able to run CUDA workloads.

If you are interested in links to all the session resources you can gain access to them all on my links page for the session. (I will activate this page about 40 minutes into the session.)

Permanent link to this article: https://www.wondernerd.net/gtc18-session-s8483/

Happy Day After Yesterday

Happy day after yesterday y’all,

You may or may not have noticed that many of the emails or calls with me start out with “Happy <day>” (Monday, Tuesday, Wednesday, Thursday, Friday, etc.). Every so often I get the question why are you always so happy? People want to figure out my trick…

This is a trick I learned from my father many years ago, when he was a manager at a lumber yard. As a child, from time to time, I would get to go to work with him. As long as I can remember he answered the phone with “Happy <Day>” He would do this consistently, whether he was busy, having a bad day,or a great day.

It didn’t hit me till probably my junior year in college, my dad is manipulating both of self and others. This “happy <day>” is a “Jedi Mind Trick” that has an impact on recipients and the barer of the tiding.

Happy Day After Yesterday in blue text with a gray and wite spiral.You’re probably wondering what the mind trick is and how it works. For the recipients, its a disarming phrase. If someone is in a good mood it typically makes them smile. If they are in a bad mood it will help them move towards a neutral to a good mood. It gives the barer, the ability to control someone else’s mood. How, cool is that to be able to change someone’s mood, it’s one of my disarming tactics.

For the barer, it has a couple results as well. One is a fake it till you make it result. Even if you are in a bad mood and say this, the recipients don’t know you’re in a bad mood and often reciprocate the tiding. From my experience, this  results in the same effect as above and moves you towards a better mood.

It also gives you control over the situation. Assuming, as Steve Rizzo states, “You create the next moment out of this moment. Didn’t think you were that powerful, did you?” Why not create a positive moment for you and whoever you are communicating with? From my personal perspective I would much rather have more positive moments in my life.

I owe more thanks than I can imagine to my dad for teaching me this powerful trick.

I hope everyone has a happy day after yesterday!

Permanent link to this article: https://www.wondernerd.net/happy-day-after-yesterday/

Info on Speculative Side Channels

CPU Side Channel GraphicI’ve been watching much of the Speculative Side Channel issues (AKA Specter and Meltdown) that have arisen as of late with processors such as Intel (INTC), AMD (AMD), and ARM. I wanted to make it easy for everyone (and myself) to find information that’s been helpful since this bug was announced. Many of the links below come from the first Dell Technologies link below.

Before I share links I want to note that I Work for Dell Technologies and am a member of social media advocacy programs at Dell Technologies, VMware (VMW), and NVIDIA (NVDA). With that fully disclosed let me share some links.

Dell Technologies:

VMware:

Citrix:

NVIDIA:

Others:

Other References:

Please follow up with your individual vendors for further details.

 

Permanent link to this article: https://www.wondernerd.net/info-on-speculative-side-channels/

Join me at GTC18

Join Me at GTC18, March 26-29Do you need another reason to attend the GPU Tech Conference this March? How about this… I’ll be there and I’ll be presenting on something I’m sure you want to know about. I’ll be presenting session is S8483, “Empowering CUDA Developers with Virtual Desktops.” (I’ll update the post when the time and day are scheduled, you can also check the session catalog.)

You’re probably saying to yourself, “My development team is fine and they’ll get upset if I move them to a virtual desktop, besides you can’t develop modern applications, like block chain in a virtual desktop…” OR “our IT team wouldn’t ‘dare’ force us to develop code on a lousy virtual desktop, they don’t even have GPUs.” In my session we are going to address both sets of concerns. We’ll talk about what can be done with virtual desktops today (it’s no longer just for Bob in accounting) and how you actually get there.

If you want to get started before you get to GTC, you can ready my three part blog series on building CUDA enabled developer desktops (Part 1, Part 2, and Part 3). These are the basis for my session… Eventually I hope to do testing with it on some newer hardware to show what both a P4 and P40 can do for CUDA developers. Till then it’s just the results I have from my home lab.

We’ll also get into how the GPU is sliced and how performance will get carved up among the virtual workspaces. This tends to be the first question I get asked about when I show folks what I’m doing. The second question which is closely related to the first question is about performance, not of the VM but of the GPU. I  share what my designs have been able to deliver, but as always mileage may very depending on what you are trying to do. I even have some early results from my initial testing.

GTC18 Register Now ButtonYou’re probably going “this is great, how do I sign up to attend GTC so I can experience all the awesome sauce of GTC?” That’s really simple to do. You should go to the GPU Tech Conference website and click the “Register Now” link in the top right corner.  You can then see the different options for registering. If you do it soon you can get early bird pricing on registration too!

I can even make attending GTC better for you or your organizations bottom line (did I mention I work in technical marketing and you have to have the, “but wait there’s more!”).  The GTC folks thought it was a good idea and gave me a 20% discount code to share with my friends who are thinking about attending…

The discount code is: RFVGPUTF

This is a great opportunity to attend GTC and learn even more than CUDA enabled virtual desktops (even though we all know that’s the main reason everyone wants to attend, right?). You get to meet a lot of aspiring students who are doing absolutely amazing work with GPUs, that and the networking opportunities are out of this world (literally, I’ve meet folks from NASA at GTC).

So what are you waiting for, go register now with the early bird pricing (ends 2-16-2018), stack the discount code I provided earlier, and come join me at the GPU Tech Conference March 26 through the 29th.

And if you can’t make it or maybe you found my session, S8483, so amazingly interesting that you want to see it again and a again. Don’t worry they do record them and you can catch it at a later date.

I hope to see you there

Permanent link to this article: https://www.wondernerd.net/join-me-at-gtc18/

2018 NVIDIA vGPU Community Advisor Program Member

On December 14th the members of the 2018 NVIDIA vGPU Community Advisors (NGCA) were announced. I can’t tell you how excited I am to be part of this distinguished group of community members.

The announcement listing all the outstanding thought leaders who have been selected as community advisors can be found here: https://blogs.nvidia.com/blog/2017/12/14/introducing-new-ngca-members/

Each member of this community is doing exceptional work in virtualization and virtual GPUs. For my part I’ve been working on building advanced Linux VMs with vGPU capabilities. As part of this I’ve presented at GTC17 as well as a vBrownbag Tech Talk at VMworld. In the months ahead I will also be presenting at GTC18 about deploying CUDA in a virtual environment, but that’s a post for another time. All of the community members are working on similar things that are pushing the bounds of how GPUs are being used in virtual environments.

In my opinion one of the best parts of the NGCA is the diversity of the group. Some are deeply involved with  VMware virtualization technologies, others Citrix virtualization technologies, and we all have our different areas where we provide unique perspectives on vGPU technology and the industry.

If I could make one recommendation, you should follow the members of the NGCA on social media, be it LinkedIn, Twitter, or other social media platform. You’ll have the opportunity to discover lots of great knowledge.

Again it’s an absolute honor to be selected as part of the 2018 NVIDIA vGPU Community Advisors and I’m looking forward to 2018.

 

Permanent link to this article: https://www.wondernerd.net/2018-nvidia-vgpu-community-advisor-program-member/

Thunderbird Email – Cannot Connect to SMTP Server

I had an interesting problem I discovered this afternoon. I get email in a host of different ways, one of which is in Thunderbird, on one of my desktops. I went to send a friend an email and got an error saying “The mail server sent an incorrect greeting: cannot connect to SMTP server [long sting of numbers and colons], connect error 10060” And this is what the picture of what the error looks like.

Thunderbird IPv6 error messageI googled all over the place and couldn’t find anything of use on this error. I went in and checked all the settings for both my POP and SMTP servers. They all looked good. I checked my firewall logs to see if AVG was blocking Thunderbird’s attempts to send or receive  emails.  It wasn’t everything looked good.

That’s when I got to studying the numbers a bit more. They look like they form an IPv6 number. Guess what they are… and here is the simple fix if you run into this problem. (Do this at your own risk as it may cause other problems, especially if you use IPv6.)

On Windows 10:

  1. Type in ethernet on the start menu (change ethernet settings should appear)
  2. Click “Change adapter options“
  3. That brings up your network adapters, right click on the network adapter and choose properties
  4. Uncheck Internet Protocol Version 6 (TCP/IPv6)
  5. Click OK
  6. Now try and see if your email is working

Network Settings, uncheck IPv6

Note: Do this at your own risk and if you are using IPv6 this will cause it not to work.

Permanent link to this article: https://www.wondernerd.net/thunderbird-email-cannot-connect-to-smtp-server/

Empowering CUDA Developers with Virtual Desktops (Part3)

Woot!!! You’ve made it this far, or maybe you started here. In Part1 of this blog we looked at the problem of installing the NVIDIA CUDA Toolkit on a virtual machine (VM). In Part2 we looked at how to install the CUDA Toolkit on a VM. This post covers why installing the NVIDIA CUDA Toolkit on a Virtual Machine (VM) is a big deal for users and organizations. We’re going to let the genie out of the bottle to give us our wishes! This blog post answers the, “why would you want to do something like that?” question.

To answer the first part of that question about why I would do something like this is really simple. I like trying out new technology, but I don’t want to build everything out of physical architecture, that gets really expensive. Even if I have a single box where I multi-boot I wind up with several different hard drives and I can only run one thing at a time.

That’s where virtualization makes trying things like this out so very awesome. With virtualization, I get my wishes granted.

  1. I get the ability to have multiple types of projects running in my environment, for example I can run the same project in both Linux and Windows to see which I like better.
  2. I have mistake protection, since often times I’m fiddling with the Kernel when slipped keystroke and I can destroy my whole OS. I get this protection with VM snapshots. That means I can snapshot and roll back when I fat finger something.
  3. Lastly I can transport and share what I am able to create. Since a VM is just a set of files, I can export it and move it to a new system or even share it with someone else who wants to look at what I’ve created (its great for troubleshooting).

All three of these things are really easy to do with VM’s not so much with hardware. So I get my 3 wishes!

Genie from Aladdin holding up 3 fingers saying you get 3 wishes

Now the second part of that why would you want to virtualize the NVIDIA CUDA Toolkit or for that matter most GPU based computational workloads. I’m going to address this for both individuals and for organizations.

We should first address why individual users ought want virtualized GPU environments.

Developer Happiness

First off by going virtual it becomes super simple to keep up with new technology as its released. For example NVIDIA releases a new GPU. Wouldn’t it be awesome to be able to have that new GPU in your system with out having to rebuild the entire host? You can, its pretty straight forward. If NVIDIA supports it in virtualized environments (the Volta GPUs are the only class of enterprise GPUs that are not currently supported) and VMware has it on it’s HCL then move the VM to a new host with the new GPU, change its vGPU profile, and if necessary update the driver in the VM. That’s it, no reason to start from scratch and reset everything.

Speaking of new VMs. Any developers out there wish they could have multiple development environments so they could work on one project per desktop, but can’t get approval for multiple systems, oh and they don’t want all those systems stacked up under their desk? Virtualization can address this in a few different ways. First if there is an unlimited budget (I’ve yet to find anyone with that) you can spin up as many identical development systems as you want and just move between them like tabs on your desktop. The second and more realistic way to do this is to be able to support one or two running development environments. When you are done with one shut it down, and that releases the resources back to the pool where they can be used to run other environments. This could be thought of as multi-booting a single box on steroids.

Four Computers

It’s great having access to all these extra VMs, but what happens when I’m done with a project, does the VM just vanish? Well it can if you want. Or, wouldn’t it be great if you could archive the desktop and save it like you do project files? You can do that! Since VMs are files, they can be archived, which means you can save a development environment for a given project. It’s no longer necessary to loose time rebuilding an environment  when you revisit an old project.

Wouldn’t that be cool to have versioning of your development environment, not just a version of code but the actual environment? Virtualizing a workstation can allow this with snapshots (note you cant snapshot a running VM with a vGPU in it at this time). Having a snapshot gives you the ability to move around to different points of time in your development environment. A great example of this, is the work I did for this set of blogs, I built a base VM, then snapshotted it as I went along. If something didn’t work I just revert back to my branch point and try again. This saved me hours of work in rebuilding my test VM.

This probably sounds great, but it sounds like a lot of extra work… Every time a new project starts I’d have to do the exact same things to setup a development environment all over again. You know, set global variables, install this package, recompile the kernel headers, etc. No one wants that! Which is another reason virtualizing rocks!!! You can setup a VM exactly like you want and use that for the template of any or all of your development VMs. Then whenever a new project is started, a workspace is already to go and there is no need to repeat all the standard installation tasks.

Organizational Happiness

I could keep going on with user scenarios, but I know IT admins are chomping at the bit to find out why this is good for their organization. I’d like to switch now to some of the reasons this is a big deal for organizations. Many of these build on the points from above.

Being able to deliver the CUDA Toolkit enables a lot of cool options for organizations. The one that springs to mind first is the enhanced security to the organization from virtualizing these developers. No longer is there an expensive system sitting under someone’s desk, the system has been moved into the data center. There is less chance of something wandering off.

The typical response to this is that this can already be done with physical systems and letting developers VNC/RDP/RDSH into the the machine. The host is in a secure area, same result. Which is true to an extent, however with virtualization it’s possible to secure the data at a very granular level. With VMware it’s possible to control what devices are allowed to connect to the VM. That means you can disable removable storage from the VM (and any other USB devices you want) and prevent users from copying data and walking out the door with valuable IP.

That may be all well and good but what keeps user’s from copying and pasting code or anything else from their development VM to their local device? That’s another cool feature of VMware Horizon, you can disable copy and paste capabilities for VMs. This helps keep digital assets safe where they are supposed to be, inside the organization.

This is one form of data protection, it would be great to protect developers desktop from damage. Above I talked about versioning and archiving the developers environment. This is another awesome advantage of virtualization (not specific to GPU based systems), data protection becomes so much easier. You can backup all the developers systems. That way when something gets removed or they corrupt their image you can just recover the last backup and move on.

Wouldn’t it be great if it were possible to automate delivery of all these systems for developers and not have to order a new system, configure it to organizational policy, and then take it to the developer? Not to mention the fact the developers all have their own “special” systems which are completely different from the rest of the organization and are never purchased in a standard way so there are no discounts to be applied… By virtualizing a developers system, all the sudden things become standardized. The developer can have a system that matches everyone else’s, there’s no need for “special” orders. That means you can standardize on systems in the datacenter too!

Why, you might ask? Because chances are, IT already orders something like a Dell R740 or Cisco C240 M4 and has special pricing for them. Thus the only significant variation is the GPUs that are being installed, which happen to be the same ones used for HPC, Machine Learning (ML), Deep Learning (DL), and VDI. That probably means it’s a standard, repeatable, order for IT to provide saving the organization time and money.

This also provides a great life cycle plan. The newest servers can start as HPC, ML, DL, and high end developer systems, then once they’ve aged a bit and people need the next big thing they can be migrated into less demanding roles such as less demanding developers or typical user VDI hosts. This allows the organization to realize additional financial advantages while keeping their developers outfitted with the latest hardware.

You may also hear the claim that performance won’t be on par with a traditional physical system. It actually should be pretty darn close. Because of the architecture used, the hypervisor consumes very few resources and has minimal impact on calls to hardware such as processors and GPUs. Because of this results will be similar between physical and virtual hosts.

I have two things left that I’ll cover, one is the perception that there will be tons of resources unused on the ESXi hosts that house these VMs (which is strangely contradictory to the point above). The typical rational goes, you have a developers system that consumes 80% of the resources of a physical host and you can’t put another VM or two on the same host as it might impact the performance of the developers system. Here’s a simple way around that, use shares. That’s right use shares for resources inside of VMware. The way a share works is when there is resource contention, which ever machine has the most shares will get priority on the resources! So if the developers VM has 10,000 shares and the secondary system has say 10 shares, guess which one will win contention arguments for resources? The developers system! And when there’s no contention both systems just keep right on trucking. (This is probably my favorite benefit that I’ve talked about in this blog.)Benefits of Virtualizing the CUDA Toolkit

The last Item I’ll cover for organizations is the sharing of resources… when a developers system sits at his or her desk it’s hard to share those resources with other developers when the system is not in use. By virtualizing developer environments, resources can be redistributed to other areas of the organization. Now instead of resources sitting idle under a desk, they can be part of a pool of resources that are shared. For example developers in the United States start shutting down there systems (or letting them go idle) around 5PM, developers in India start logging in at about the same time… wouldn’t it be great if both could share those resources? OR developers go idle at around 5 and the HPC, ML, or DL systems kick in and start using the idle resources to speed computing operations.

Hopefully these reasons resonate with both developers and organizations. By enabling developers with VMs configured to leverage GPUs significant benefits can be gained at both the individual and organizational level (a small sample in the graphic). The genie is now out of the lamp and it can fulfill the wishes of many.

Be on the look out for additional blogs on things I’ve learned from virtualizing the NVIDIA CUDA Toolkit.Hopefully you’ve enjoyed the blogs on this topic thus far and they have been helpful. If you have questions or comments please be sure to post them below or contact me directly.

 

Permanent link to this article: https://www.wondernerd.net/empowering-cuda-developers-with-virtual-desktops-part3/

Empowering CUDA Developers with Virtual Desktops (Part2)

In this blog post we are looking at how to install the NVIDIA CUDA Toolkit and its basic setup. In the previous blog post we looked at the typical problem encountered when trying to install the CUDA Toolkit in a virtualized environment with a vGPU.  In the follow on to this post (Part 3) I will detail why this is substantial for both developers and organizations.

A quick review of part 1 before we get into the guts of how to deploy the NVIDIA CUDA Toolkit on a Linux VM. Below is the diagram from the previous post. We can’t use the CUDA Toolkit package manager (RPM/Deb) to deploy the toolkit as it installs a prepackaged driver. That means we have to install it using the run file for the CUDA Toolkit as it has some options around the GPU driver.

NVIDIA CUDA Toolkit Virtual Deployment Model

That said, how do we get the NVIDIA CUDA Toolkit installed on a virtual machine? It’s a multi-step process which is rooted in a correctly configured virtual machine (VM). That means we need properly built virtual infrastructure, specifically ESXi hosts with NVIDIA GPUs. So lets start there but before we do a couple of quick notes.

  • At the time of this writing (October 2017) VMware does not support Pascal vGPUs in Linux Desktops running on VMware Horizon. If you need to do this in a supported manner, you will want to use NVIDIA M6, M10, or M60 GPUs.
  • I built this on my lab environment, which you can read about here, note that my configuration is not supported by either VMware nor NVIDIA. It works for my purposes but, it’s not supported.

Now lets get you those three wishes and get started with setting up our hardware.

Physical Hardware

I’m going to assume we will be using currently (October 2017) supported GPU’s in our ESXi hosts. That means NVIDIA M6, M10, M60, P4, P40, P6, or P100. If you you are still using Kepler GPUs, K1 or K2, these steps should work but haven’t been tested and would be substantially unsupported as the Kepler GPUs have reached EOL. Other GPUs are not currently supported by VMware. You can check to see if your GPU is supported in the VMware HCL for Shared  Pass-Through Graphics (aka vGPU).

You will need to follow your hardware vendors instructions for installing the GPUs in physical servers (ESXi hosts) as hardware vendors are all a bit different, or you may be lucky and it came pre-installed.

That gets us to the installation of the virtual environment. I wont explain how to install ESXi or add the host to a vCenter instance (or even setup a vCenter environment if you are starting completely from scratch). There are plenty of posts that explain how to do this.

The Base Virtual Environment

For the next three sections I will be summarizing material I presented at the GPU Tech Conference in 2017 (Maxwell based cards) and at VMworld 2017 (Pascal based cards) on setting up and configuring vGPUs for a Linux environment. Also as of this writing (October 13, 2017) it should be noted that VMware does not support the use of Pascal GPUs for Linux virtual desktops, my build, using an NVIDIA P4 GPU, is unsupported. (If you need this support for Pascal GPUs with Linux VMs in your environment be sure to contact your VMware sales representative).

Now on to configuring the host.

  • If we are using the Maxwell GPUs (M6, M10, and M60) we first need to use GPUmodeSwitch and set the card to graphics mode (GTC slides 10 and 11). This is not necessary for Pascal series GPUs.
  • At this point we are able to install the Virtual GPU manager, also known as the VIB. To do this we want to upload the VIB to a datastore on the ESXi host and install it like any other VIB (GTC slide 12 \ VMworld slide 10)
  • If we are using Pascal based GPUs we will need to change the ECC mode to 0 on the GPU. (VMworld slide 11)
  • Next we want to set our graphics in the ESXi host to shared direct (VMworld slide 12)
  • We should then check and make sure the GPUs are not enabled for Passthrough (GTC slides 13)

That gets the basics of the virtual environment setup.

VMware Horizon

Now we need to have a quick side chat about virtual No virtual display console with VGPU. To see the display an alternative connection such as Horizon or RDSH must be used.desktops as compared to other VMs. To use these virtual desktops to their full capability we need an alternative display adapter to gain access to the VMs. We can’t just use the VMware Virtual Console to access the virtual machine. In a few cases it might be acceptable just to let users connect to a development system by SSH. However it will probably be more desirable to access a full GUI.

The simple reason that the VMware Virtual Console won’t work when a vGPU is used is when the virtual machine is configured to use the vGPU, the vGPU is not mapped back to the default console. Think of it like when you install a new GPU in a physical desktop you either plug in to the on board display adapter or you plug into the video card, the VMs cable is plugged into the on board adapter not the vGPU. (See diagram on the right)

So how does one display a desktop to developers? The best way, in my opinion (I work for Dell, major share holder of VMware), to do this is using VMware Horizon which provides virtual desktop infrastructure (VDI) for displaying desktops. Setup and configuration of VMware Horizon is beyond the scope of this blog. Needless to say using Horizon provides a lot of flexibility and power in the datacenter and we will be leveraging it for the purposes of this post.

vGPU Licensing

Because of the way we are using the GPU for virtual desktops we need to license the VMs. This is done through the NVIDIA GRID License Server. It can be setup on either a Linux OS or a Windows OS. The license server can be downloaded from NVIDIA in the same place you downloaded the VIB and guest OS driver.

Installation is straight forward and outlined in the GRID License Server Release Notes. I also detail the setup and licensing of VMs in GTC slides 15 to 26 and VMworld slides 14 to 19.

You have to setup and use NVIDIA Licensing for NVIDIA vGPUs. If you don’t and try to run a vGPU without proper licensing, the VM will not function correctly and you will get errors when you attempt to run CUDA applications. The one I get most frequently is the one below, CUDA Error code=46(cudaErrorDevicesUnavailable). It’s caused by the VM not having a license.

CUDA Error code=46(cudaErrorDevicesUnavailable))

Virtual Machine Virtual Hardware Configuration

At this point we can build a base virtual machine. After all we want these desktops to be something that are repeatable, quickly deployable, easily protectable, and when we are ready to reclaim resources disposable.

The first task for this is just to build a basic virtual machine. For my initial testing I built a CentOS 7 Linux VM. I patched, installed any base development tools such as gcc, and completed other standard OS deployment operations. Once we have prepared a base VM image we will shutdown the guest VM.

  • With the guest VM shutdown we will edit the virtual hardware settings for our VM. (GTC slides 28 and 29 \ VMworld slides 22 and 23)
    • We will use the new device drop down at the bottom of the edit settings screen to select a Shared PCI Device
    • Then we will select the desired vGPU Profile (How much of a vGPU a user can use)
    • Lastly we want to click the “Reserve all Memory” button (this is important to do otherwise the VM may not power on)
    • Then we can power on the VM
  • Inside the VM we are going to setup some networking and disable Nouveau. (GTC slides 32 and 33 \ VMworld slides 24 and 25)
  • At this point we can install the NVIDIA GPU drivers. (GTC slides 34 and 35 \ VMworld slides 26 and 27)
    • It’s important to note that the driver installed during this step must match the VIB installed in previous steps!
  • Once the NVIDIA driver is installed we will install the VMware Horizon Agent on the VM. (GTC slide 35 \ VMworld slide 27)
  • At this point we can reboot the VM
  • When the VM reboots the VMware Virtual Console of the VM will no longer function and you will need to access the VM using VMware Horizon, SSH, or some other console viewer.

At this point I recommend verifying that the VM functions correctly in VMware Horizon by adding it to a dedicated manual desktop pool. If it does we are ready for the next step.

Installing the NVIDIA CUDA Toolkit

Now I will get a little more detailed on the install since I haven’t done a session on setting this up yet. It is important to note that Changjiang’s blog on building a deep learning box is what actually helped me to figure out how to install the NVIDIA CUDA Toolkit on a virtual machine. As of this blog post I am using version 9.0.176 of the CUDA Toolkit. With that lets get started.

  1. Download the run file version of the NVIDIA CUDA Toolkit from the developer site – https://developer.nvidia.com/cuda-downloads
  2. Perform the pre-installation tasks in the CUDA Toolkit Documentation
    1. Verify that your VM shows it has an NVIDIA GPU in it with the command: lspci | grep -i nvidia
    2. Verify gcc is installed: gcc –version
    3. Install the Kernel Headers and Development packages (varies by OS)
  3. Now skip down to the Runfile Installation section
    1. Disable Nouveau if you haven’t already
    2. At this point drop into runlevel 3 (text mode) – when you do this the virtual console will be functional again until you exit the run level.
    3. As sudo you want to execute the run file: sudo sh ./cuda_<version>_linux.run
      1. Follow the prompts on screen
      2. When asked to install the driver GPU driver enter No (N), this is the most important part of this process.
        The reason for this is, if you select yes, the file will over write the already installed driver with the driver included in the package, which if you remember from earlier, the driver version in the VM has to match the VIB version.
      3. Finish answering the prompts and complete the installation of the run file
  4. At this point we can precede to the post-installation steps
    1. Add /usr/local/cuda-9.0/bin to the PATH variable:
      export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
    2. We then need to add the 64bit library to the the LD_LIBRARY_PATH variable:
      export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
      (I’ve had issues with this variable entry staying in my CentOS VM, if you have issues running the examples following a reboot check and see if this variable is empty.)
    3. Install the writable samples
      cuda-install-samples-9.0.sh <dir>
      I typically put this in the /home/usr/ path (~)
    4. Make the samples:
      cd ~/NVIDIA_CUDA-9.0_Samples
      make
      This can take a while to run, you may want to do this over lunch
  5. Reboot your VM, if you did this via the console you will need to return to your VMware Horizon connection to the VM.
  6. Open up a console and change to the location of the files you built. Typically:
    cd ~/NVIDIA_CUDA-9.0_Samples/bin/x86_64/linux/release/

    1. Run deviceQuery
      ./deviceQuery
      Output will look something like this:

      It will not look exactly the same though.
    2. Run bandwidthTest
      ./bandwidthTest
      Output will look something like this:
      NVIDIA CUDA Toolkit bandwidthTestIt will not look exactly the same though.
    3. If you are curious what I got for all the different files in my example, you can review them here.
  7. At this point you are ready to use the NVIDIA CUDA Toolkit or install additional components such as TensorFlow.

To summarize the process (see picture below); we first installed the VIB on the our ESXi hosts with GPUs (1). Next we installed the NVIDIA GPU driver on our virtual machine (2). After which we installed the VMware Horizon Agent on the virtual machine (3). Lastly we used the run file install method to install the NVIDIA CUDA Toolkit on the VM (4). At this point we can finish customizing the VM and use it for our master image to deliver to users.

This concludes the installation of the NVIDIA CUDA Toolkit, the second in my multi-part blog series on installing the NVIDIA CUDA Toolkit on a VM. If you haven’t already be sure to read the previous blog post (part1) where we looked at the typical problems encountered when trying to install the CUDA Toolkit. Also be sure to read the next blog in this series about why this is a big deal for organizations and developers (part3).

If you have issues, run into any snags, or something else please either share in the comments or contact me.

Permanent link to this article: https://www.wondernerd.net/empowering-cuda-developers-with-virtual-desktops-part2/

Empowering CUDA Developers with Virtual Desktops (Part1)

I’m very excited to share with everyone that I have successfully installed the NVIDIA CUDA Toolkit on a Linux CentOS 7 Virtual Desktop running on Horizon 7.1 in my home lab. (No, I’m not the first but its a big deal for me.) You might be thinking “big deal you’ve deployed an app on a virtual machine!” or “Why would anyone want to use virtual machines for CUDA development, they want/need a whole dedicated piece of hardware, besides it’s easier that way!”

When I hear objections like this, all I can think of is the Disney movie Aladdin where the Genie says “Master, I don’t think you quite realize what you’ve got here!”

Disney's Aladdin - Genie's introduction

In this series of blogs I’m going to let the genie out of the lamp. For this post I’m going to layout the problem of installing the CUDA Toolkit on a Horizon Virtual Machine. In the next post I will lay out how to install it on a virtual machine. The following post will then explain why a configuration like this is significant benefit to developers and companies. There may also be follow on parts that I haven’t even thought of yet, as I’m still excited about proving this works correctly.

With that let’s rub the lamp and see what we get.

Most people in the virtualization space think of virtual GPUs (vGPUs) as something that provides enhanced graphics capabilities to virtual desktops (using VDI) not something for processing of data. Those developing applications that use CUDA (deep learning, machine learning, big data, etc.) tend to think of GPUs as more of a tool for improved data processing performance. Both perceptions are barriers into virtualizing developer workloads.

Because of this CUDA developers don’t consider virtualization and virtualization teams don’t consider CUDA developers.The net result is each side writes the other off. Leading to no documentation on how to deliver a given product on a given platform (CUDA on a VM). You can see this in both the NVIDIA CUDA Toolkit and in vGPU technology.

Deploying vGPU technology has a fair amount of requirements and configuration steps (as you can see in my GTC 17 session on setting up vGPUs for Linux VMs). Many times you are required to use a specific set of matching drivers, one for the ESXi host (in VMware a VIB) and one for the VM (a driver). If those don’t match, the VM may fail to work correctly or at all.

With the CUDA Toolkit, the typical install path, in Linux OSs, is a package manager install (RPM/Deb) that is configured to deploy a specific GPU driver version. This driver version, to the best of my knowledge, has never matched the driver version for a vGPU. There is also no easy way to change that driver in the RPM or Deb file.Easy Button

And this is typically where the discussion ends… “My virtual machine can only run driver X.Y.Z” AND “The RPM deploys driver A.B.C” SO… “This just won’t work, make it a physical machine and lets move on.”

This is the point where we need an “easy button” to press and make the drivers magically match up so we can run the CUDA Toolkit on a VM.

I repeatedly tried installing the CUDA Toolkit  with the package manager installs, as I outlined above, on VMs, trying various combinations and orders to see if there was a magic way to get the package installer to accept and match the driver I was using. There’s not. There is another method though that will get your VM running the CUDA Toolkit without a much issue, we can use the runfile installation method.

You can see this in the image below. We have a VM with vGPU capabilities running on an ESXi host on the left. On the right we have two different deployment methods, package manager and run files. Package manager based installs won’t work on VMs as the driver installed as part of the package is not compatible with the on needed on the VM. However the run file deployment of the CUDA Toolkit will work as the GPU driver is variable. I’ll cover the steps of how to deploy the NVIDIA CUDA Toolkit  runfile in the next blog post,followed by how this unleashes a powerful genie for both developers and organizations in the third post of this series.

NVIDIA CUDA Toolkit Virtual Deployment Model

Permanent link to this article: https://www.wondernerd.net/empowering-cuda-developers-with-virtual-desktops-part1/

VMworld VMTN6636U: GPU Enabled Linux VDI

It’s Wednesday of VMworld… Today I present my vBrownbag Tech Talk on GPU Enabled Linux VDI (VMTN6636U). I want to provide access to the slides used in this session. I will link the recording here as well once the session is posted.

Front slide of VMworld SessionVMTN6636U VMworld Session

It’s important to note with the material I’m covering in this session that at the time of the session what I am doing is completely not supported. The hardware I tested with is not on the HCL list for the GPUs and the GPUs have not yet been tested with Linux VDI by VMware. That said I’m also pleased to say that it works really well.

If you are looking for a supported way to deliver vGPU enabled Linux VDI please consider using the NVIDIA M60 GPU. I detailed this in my GPU Tech Conference session.

I would like to thank the NVIDIA and VMware program teams for reviewing the content in my session. There help with this project is invaluable.

Hopefully this material is helpful. Be sure to reach out if you have questions.

 

Permanent link to this article: https://www.wondernerd.net/vmworld-vmtn6636u-gpu-enabled-linux-vdi/