Aug 182017
 

As I have been dabbling in machine learning, I decided to build a GPU machine. Over the weekend, I built one for myself. I wanted to share the details with others so that they can make the right choices.

A key part of machine learning is to do lot of mathematical computations. As you are training the neural network, you need to do large number of matrix multiplications. In fact, almost all the computations are on matrices — these transformations are similar in nature to graphics. Say you want to tilt an image? Lighten or darken an image? All of it is matrix operations. Graphics cards (Graphics Processing Unit of GPU) excel in these computations.
So, I wanted to build a high end GPU machine for as little money as possible.

Getting the parts

The challenge with getting the parts is how do you know which parts work together? How do you know what all you need? Thankfully, www.pcpartpicker.com will come to the rescue (there are some limitations, which I will describe later). If you are impatient, here is my list:
PCPartPicker part list / Price breakdown by merchant

Type Item Price
CPU Intel – Core i5-7600K 3.8GHz Quad-Core Processor $211.98 @ Amazon
CPU Cooler Cooler Master – Hyper 212 EVO 82.9 CFM Sleeve Bearing CPU Cooler $24.88 @ OutletPC
Motherboard Gigabyte – GA-Z270X-Ultra Gaming ATX LGA1151 Motherboard $158.88 @ OutletPC
Memory G.Skill – Ripjaws V Series 64GB (4 x 16GB) DDR4-2400 Memory $511.99 @ Newegg
Storage Samsung – 850 EVO-Series 500GB 2.5″ Solid State Drive $174.99 @ Newegg
Video Card EVGA – GeForce GTX 1080 Ti 11GB SC Black Edition Video Card $724.99 @ SuperBiiz
Case Corsair – 330R Quiet ATX Mid Tower Case $49.00
Power Supply Rosewill – 600W 80+ Bronze Certified Semi-Modular ATX Power Supply $58.87 @ OutletPC
Prices include shipping, taxes, rebates, and discounts
Total (before mail-in rebates) $1935.58
Mail-in rebates -$20.00
Total $1915.58
Generated by PCPartPicker 2017-08-18 22:19 EDT-0400

https://pcpartpicker.com/list/GpFnD8 [Knowing what I know, this list would work — but I would get low profile memory, as it was difficult to fix the CPU fan with the these high memory sticks].

GPU

First, what is the right build for GPU computing? The first and foremost is that you need a good GPU. As of writing this note, it is Nvidia 1080 Ti. Here are the reasons why:

  1. Nvidia is the undisputed leader in GPU computing. While AMD is a good brand, the library support for Nvidia is unmatched. It is well-debugged, with full support for many frameworks.
  2. Now which card? Within the home buyer’s range, you are looking at GeForce GTX series. The higher the number the better it is. Ti, standing for Titanium offer upto 30% more than the regular version.  You can get 970, 980, 980 Ti, 1070, 1080, 1080 Ti — any of them will work. Realistically, these options stand out:
    1. 1080 Ti: This is the best one currently. Runs around $700
    2. 1080: 30% less than the Ti. Runs around $500
    3. 980: You can get them on Ebay — if you are lucky, you get it under $150.

I think the best value is for $1080 Ti, if you are a serious player in machine learning. For full details, please visit: http://timdettmers.com/2017/04/09/which-gpu-for-deep-learning/

GPU

The GPU GeForce 1080 Ti is available from many vendors like EVGA, MSI, ASUS etc. The main differences are all the brands is:

  1. Ability to overclock
  2. Number of fans: Typically most have two fans. Some have 3 fans allowing for higher clock speed. Some even have liquid cooling for quiet operation.
  3. Connections: Display ports, HDMI or DVI-D’s that these motherboards can connect to.
  4. Color schemes (don’t laugh — lot of gamers expose the innards of the machine)

I ended up with EVGA GeForce 1080 Ti SC Gaming edition. There are higher brands like SC2 — but, they did not offer much more.

CPU + Motherboard

While AMD Ryzen is really attractive now, I opted for Intel. Intel works without any tweaks with all the software we use, including Linux and virtualization. I will use AMD Ryzen someday, but not yet. AMD Ryzen 7 on the higher end can offer 8 cores or 16 threads. It offers great performance, yet the stock Linux does not work with it (the latest kernel does work).

You need to know a few things before buying a CPU. CPUs come in two varieties: the one that can be overclocked and one that can’t be. In the case of Intel, it is Intel K series can be overclocked. In Ryzen it is X series. The current generation of Intel is Kaby Lake (7th generation). The older one is sky lake (6th generation). While there is no major performance difference, I did not find much cost difference either.

cpucpu-image

The overclocked versions have the advantage of supporting overclocking. I am not sure if needed it. Moreover, the standard version comes with a CPU fan and overclocked version needs a separate CPU fan.

Still my micro center was selling i5-7600K for really cheap. I went with it.

The mother board needs to support the Kaby Lake (7th generation). It also needs to support the GPU length. Other than these two, most are standard. Gigabyte has good reputation of motherboards. I chose this one because it is on sale. Notice the SLI — that means, it can take two GPU’s, if I want to up the performance later on.

mobo

Some motherboards support m2 SSD’s, which are much faster than usual SSD’s. They fit like memory, and act like disks. Still, they are expensive and not yet mainstream. This motherboards supports m2 SSD’s if I need to use in the future.

Case

The other big factor in building a computer is the case. Since you chose ATX motherboard, you are looking for a mid or full case. You also want it to be quiet. You want it to have at least a few fans (like two or three). You want it to have enough space to organize the cables, fit the disks etc. In my case, all I needed was just the SSD hard disk. My priority was a quiet box. I went with Corsair 330R silent case. It has padding on the sides and two fans (with support to add more fans, if needed).

330R

This case does not come with a PSU. I looked for the integrated cases, but did not find any good ones.

PSU

The choice of PSU is largely boils down to these:

  1. Modular vs. Semi modular vs. non modular: The PSU comes with many power cables. Non-modular PSU has all the cables attached, whether you use them or not. Modular has all the cables as optional. If you don’t use it, you don’t need to clutter the case with attachments. I prefer the semi-modular, with the essential ones already fixed (we do have to power the CPU and motherboard, right?)
  2. The certification: Any kind of certification here is good. The lowest level 80+ Bronze is good enough for us. This filter weeds out fly-by-night operators.
  3. The wattage: The PC partpicker will tell you how much power source you need. For the GPU we chose, the recommended wattage is 600W.

psu

I ended up picking up one from local microcenter that was on sale that meets these requirements. The red one needs to be used for the GPU. Two means, it supports two GPUs. One of them is SATA connector for connecting the disks and optical drive.

Memory

These motherboards can take up to 64 GB. In my experience that is ample, even if you are running many processes. In reality, we will be limited by GPU anyways. This motherboard takes 128pin DIMMS, with speeds from 2400 to 3600. There isn’t much difference in performance, according to the research I did. The difference may be 1% or 2% — which is not justified in the increase in the cost of 30% of the memory. So, I ended up getting the DDR4 2400. Look for any deals on usual sites.

memory

One caveat about memory. The memory goes next to the CPU on the motherboard. It only takes 4 cards — so, you should get 4x16GB. Our fan sits on top of the CPU, jutting out over the memory. The memory stick I ordered has a cover that forces the fan to move up 5mm. It is not a big deal, but you can order some other memory and save the hassle.

CPU cooler

As I mentioned earlier, the usual non-overclocked version of CPU comes with a fan. I went for the overclocked version only because there was a deal. I ended up having to order a special fan.

What is the deal with a fan? I did not find many differences. For the work we do, for the climate I am in, for the case I have, heat is not a big problem. The case itself has lot of fans too. The higher end ones with liquid cooling are not worth the trouble for me.

Hyper212Evo

The cooler master Hyper 212 Evo has a large heat sink. It comes with the thermal compound to place the heatsink on the CPU. It has all the attachments required. If you find something good enough on the sale, it should not make much difference.

Hard disk

For my need, the choice is between m2 SSD or SATA SSD. The SATA SSD is like a hard disk. The M2 SSD looks like a memory card and sits in one of the slots. It is really fast, but the price is too much for the budget. So, I went with a 500 GB Samsung SSD.  This SSD may require some additional hardware to place in the case. But, really speaking it is not needed as long as it is plugged in and placed without the danger of falling down in the case. You can you use a rubber band, for all you care, to fix it in the case. Or, spend $5 and get the attachment to place it in 3.5 bay.

samsung

How to buy

Pcpartpicker does the price comparison and tells you where each component is cheaper. Be aware that you have to add taxes to your price on Amazon or your local retailer. Places like newegg or B&H do not collect taxes, though technically you should pay the taxes by yourself end of the year. Surprisingly, I found www.microcenter.com to be the cheapest. It has a retail store in my neighborhood. I managed to pick up the case in open case price, making it really cheap. The CPU+Mobo was on a combo price deal, saving me another $40. Overall, it was cheaper by $120 — a good 6% than the online companies.

Order all the parts at once so that you can start building immediately. In case there is a problem, it becomes clear immediately. You want to take advantage of one month return policy most merchants have — so, start building immediately.

Building

I never built a computer. Thanks to Youtube, I found it easy. Here are the videos I used:
https://www.youtube.com/watch?v=T9pShHlCmLc&list=PLc3lzolCKqOOnVDfa6OpbuYX2f28R-31x — this is a three part video series. It makes it really easy to build the PC. If you want a quick no-nonsense video: https://www.youtube.com/watch?v=0bUghCx9iso&t=1428s

In any case, here are the steps:

  1. Install the CPU
  2. Install the CPU fan
  3. Install the memory
  4. Install the motherboard into the case, taking care the back plate is placed snugly.
  5. Plug the case fans into the motherboard
  6. Install the graphics card
  7. Install the hard disk
  8. Plug the front panel cables into the motherboard
  9. Put the PSU in.
  10. Plug the power into the motherboard
  11. Plug the power into the CPU
  12. Plug the power into GPU
  13. Plug the power into the SSD and the front panel (and DVD drive, if you have one).
  14. Arrange the cables neatly.
  15. Now, test the case and close the case.

I am not going to describe these steps in detail, as the videos are very descriptive.

After building the computer, check the BIOS. These are the steps you want to do:

  1. Check if the BIOS recognized all the parts.
  2. Update the bios, if there is a newer bios.
  3. Install the OS.
  4. Update the clock speeds.

I am going to describe installing OS only in a little bit of detail, as it may be instructive:

Installing OS

As you are plugging in the peripherals, you will notice that your monitor can be plugged into the motherboard or the graphics card. By default, if the card is there, you should plug into the graphics card.
If you are installing using the flash drive, you would need to change the booting order. There are some issues installing Linux desktop with XWindows. Instead, my suggestion is to install Linux server — which skips the graphical installation entirely. You can the graphical installation after installing the drivers. You can use rufus (https://rufus.akeo.ie/) on windows to copy the ubuntu ISO to a bootable flash drive.

Once you install it, my suggestion is to follow https://blog.nelsonliu.me/2017/04/29/installing-and-updating-gtx-1080-ti-cuda-drivers-on-ubuntu/ — While I am not able to independently test installation using other methods, this methods worked on my machine.

How does it fare?

I will tell you the full details later. But, for 2K, I have a GPU server for which I need to pay 70c per hr. Assuming that I run it for 8hrs, it is roughly $150 per month. At that rate, it pays for itself in an year and half. Of course, I can run bitcoin mining, and make some real money!

Next part

In the next part, I will tell you how to start with your GPU machine, basic setup, basic tools, and basic steps in GPU computing.

Aug 032011
 

In today’s installment, I will show how to install a hypervisor. I choose a free product VMware hypervisor to install on my computer so that I can run VM’s.

What is a hypervisor? It is an hosting environment to run virtual machines. There are two kinds. The first kind runs on the bare metal (no OS needed) and the second one runs on an OS. Naturally, the first kind is faster. In case of VMware hypervisor, it runs a barebones version of Linux with hypervisor software, file system and a few other tools.

Step 1: Download the software

Hypervisor itself is free, which you can download it at: http://www.vmware.com/go/esxi. Make a note of the license number they give you – you need that later. The old name for hypervisor is ESXi. You will find references to vSphere, which is the enterprise version which costs lots of money. You need vSphere Client as well, but that can wait. The software comes in the .iso format. You can mount it in windows using http://www.daemon-tools.cc/eng/products/dtLite (daemon tools).

Step 2: My machine is not supported!

First thing I did was to burn the iso to the the DVD. I installed Linux countless times from 1994 and thought I could get this past quickly. Little did I know that VMware removed support for standard components like Mobo based network interfaces. Too bad.

First thing is to remember what components I have in my system. The mobo (mother board) information comes up during boot times, but I still wanted a complete list. An evaluation copy of AIDA 64 listed the complete list of the machine hardware details after I installed in that machine.

What I need is to do the following:

  1. Get the driver: You can find most drivers as oem.tgz here.
  2. You need to modify the boot image. You can use ESXi customizer for this purpose. It creates a new iso for you.

At this point, you will be running out of DVD’s to burn. I wanted to use flash drive to install my OS. That way, if there is a mistake, I can always rewrite that.

Step 3: Creating a bootable flash drive

Most mother boards support booting from flash drives. When booting up, you can enter the setup (by pressing DEL often, but it tells you what to press to edit the setup) and edit the boot sequence. You may have to insert the flash drive before and rescan it and then setup the boot sequence. That is what I did.

To prepare the flash drive, there are several ways. Here are the two methods (thanks to: vmhelp site).

  1. Use syslinux(make sure you use version 3.8x – the version 4.x doesn’t work):
    • First format the flash drive in DAT32 mode.
    • Go to syslinux/win32 folder and run the command: syslinux.exe –mbf G: (assuming G: is where your flash drive is).
    • Copy the contents of the iso that you created with ESXi customizer. Again, mount the iso using daemon tools.
    • Rename the isolinux.cfg to SYSlinux.cfg.
  2. Use Unetbootin for creating the flash drive.

Once you created the boot drive, you will notice that you still will encounter issues. Specifically, the system needs to know that it needs to copy files from the flash drive. Here is what you can do, using kickstart script.

First edit the syslinux.cfg file:

menu title VMware VMvisor Boot Menu
timeout 80

label ESXi Installer
menu label ^ESXi Installer
kernel mboot.c32
append vmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- mod.tgz

label ^Boot from local disk
menu label ^Boot from local disk
localboot 0x80

All we did is to add  ks=usb Now, we need to create a ks.cfg in the following way:

vmaccepteula
rootpw password
autopart --firstdisk --overwritevmfs
install usb
network --bootproto=dhcp --device=vmnic0

Thanks to Jonathan Medd for this guidance. Now, boot from the flash drive and finally, the system will copy the files to the first bootable drive and complete the installation. Finally, remove the flash drive and reboot the system. Before the reboot is done, for a good measure, adjust the booting sequence.

Step 4: Configuring the hypervisor

When you first login (remember the login password that you specified in the ks.cfg file (password)), you can do a few adjustments. This is what I did:

  1. Move from DHCP to static IP. Makes it easier to remember the IP number.
  2. Set the DNS to static DNS (I have a forwarding DNS running on a different machine, that caches the requests – I use that as well as google’s which is 8.8.8.8).
  3. Enable local tech help mode (which lets me login on the local console into shell).
  4. Enable remote tech help mode (which lets me login via ssh).

The last two are not a good idea security wise, but I decided to do it temporarily.

Step 5: Installing the client

There are four/five ways to interact with the hypervisor:

  1. You can login locally to do what you can with shell.
  2. You can ssh into the box to do the same.
  3. You can run remoteCLI that VMware gives.
  4. You can use web services SDK and forge your own programs.
  5. You can use vSphere Client, a gui program to create/manage your virtual machines.

Naturally, most people opt for the last one. I am doing the same too (except that I use the ssh as well. More later). The licensing restricts some functionality. It would be fascinating to see if web services are also restricted.

Btw, once you start the vSphere client, you can provide the license that you got when you were downloading. Otherwise, you are in 60 day evaluation mode.

Step 6: Installing an existing VM

The web is replete with virtual machines. Most virtual machines are created for use in VMPlayer. THe hypervisor only lets you create/clone machines. How do you transfer the new machines in here? As I see it, there are two choices:

  1. You can use vmware converter to convert the existing physical machines. It can covert to and upload the image to the hypervisor.
  2. You can move the vmdk file to the hypervisor (you can use scp or winscp)  and convert the file with the following command: “vmkfstools -i sourcefile.vmdk destinationfile.vmdk”. After that, when you are creating the virtual machine, you can link into this file.

I did the second type.

In the next posts, I will describe the machine setups that I am planning on (mostly for various BI projects that I am planning on). Specifically, I will see if we can use openstack with this hypervisor.

Aug 012011
 

I generally run lot of virtual machines on my desktop. For any development activity, I use VM’s. These days, the cost of machines plummeting, I got my self a new machine recently. My considerations are these:

  1. Lot of memory: I need to run VM’s.
  2. Lot of parallel processing: Again, needed to run VM’s.
  3. Not so much for the high graphics controller: I am not a gamer. I suck at most games, including computer games. All I need to do is to run two monitors from my machine.

I wanted to, but cannot make a case for an SSD. I know it makes the system blindingly fast, but they are still pricey.  I don’t want to spend $450 on a small SSD now.

I looked at the big players like DELL and HP and was not happy with the offers. They seem to focus on Xeon based servers which are marketed to the SMB market. As an enthusiast, I want to pick and choose my parts.

I finally ordered a computer from Avadirect. It’s prices are very reasonable (I calculated the cost for me to assemble and it came to be a difference of just $75 or so) and the delivery times are OK (it took them two weeks to deliver).

Here are the parts I chose:

  • Case: I wanted a middle of range case, that is cool enough. I went with COOLER MASTER, Elite 335 case. I went with a standard 585W power supply.
  • Motherboard: Here I had an option for the Z68 based motherboard (modern, supports sandy bridge, but can only support 16GB memory for now – when the larger chips become available, it can support up to 32GB). My other choice was X58 chipset based which can support 24GB right now. The cost is just about the same, but opted for Z68 chipset only because I want to have that sandy bridge advantage.
  • Memory: The maximum it can support – that is 16GB of DDR3 1333MHz memory.
  • Disks: Two Seagate 1TB barracuda disks at 7200RPM. They are not the best, but they are quite good.
  • Graphics: Even though I could run off the motherboard, I wanted to have a dedicated card. I chose a lower end GeoForce GT520. If I were redoing it, I would have chosen a different one. The problem with it is while it supports two monitors, it supports 1 DVI, 1 HDMI, and one VGA. I have two DVI at home. Bummer!

All in all, it set me back by a $1000 dollars including shipping.

If anybody is looking for getting a machine custom built, I can recommend Ava direct. It is exactly what it seems.