{"id":1349,"date":"2013-12-24T17:03:39","date_gmt":"2013-12-25T01:03:39","guid":{"rendered":"http:\/\/zsprawl.com\/iOS\/?p=1349"},"modified":"2014-01-24T16:57:47","modified_gmt":"2014-01-25T00:57:47","slug":"mining-bitcoins-in-esxi-using-an-xfx-7970","status":"publish","type":"post","link":"http:\/\/zsprawl.com\/iOS\/2013\/12\/mining-bitcoins-in-esxi-using-an-xfx-7970\/","title":{"rendered":"Mining Bitcoins in ESXi using an XFX 7970"},"content":{"rendered":"<p>This is a very specific article meant to target a very small subset of geeks out there. Sure, there are many of us geeks, and a large number have heard of this craze the last few years called Bitcoin. After Bitcoin became popular, like tv news popular, a number of crypto-coin spinoffs have surfaced. I&#8217;m not going to go into the merits (or scams) of the various altcoins out there, but a very popular one called Litecoin is what got me started in the mining hobby.<\/p>\n<p><a href=\"http:\/\/zsprawl.com\/iOS\/wp-content\/uploads\/2013\/12\/cryptcoins.jpg\"><img decoding=\"async\" src=\"http:\/\/zsprawl.com\/iOS\/wp-content\/uploads\/2013\/12\/cryptcoins-1024x682.jpg\" alt=\"cryptcoins\" width=\"515\" class=\"aligncenter size-large wp-image-1359\" \/><\/a><\/p>\n<p>As anyone getting into mining learns quickly, cpu mining is not very popular because quite frankly it sucks. Using your GPU is where it is at for the home user, yielding easily 10 times the speeds of the CPU. Bitcoin is now mined only using dedicated miners, so if you are planning to mine Bitcoin this late in the game, don&#8217;t bother. However, there appears to be some speculative profit in mining other scrypt-based coins, like Litecoin.<br \/>\n<!--more--><br \/>\nIf you decide to mine with your GPU, use whatever you have until you truly know what you are doing. It is easy to think the whole thing is a slam dunk money fest, and done right, it might be, but don&#8217;t spend thousands of dollars up front for naught. For example, ATI video cards are much better at mining then nvidia, which is why they are sold out everywhere!<\/p>\n<p>If you can get your hands on an ATI video card, XFX is probably the brand you will land, because they suck, haha. I have a XFX AMD HD 7970 that I got for gaming for around $300 a little while ago. I got lucky because since as of today (a day before Christmas), they are moving for $450+ on eBay. The problem with this particular brand is two fold, they run hot as hell, and they seemed crippled when you start mining, getting half the speeds of other brands with the same model of chip. <\/p>\n<p>Using the default cgminer 3.7.2, I pulled a mere 450 KH\/s with:<\/p>\n<blockquote><p>cgminer -I 13<\/p><\/blockquote>\n<p>After a lot of research on the Internet, it seems other people with 7970 cards were getting 700+ KH\/s. I was not pleased with a mere 450 KH\/s. After a ton of command line tweaking, I was able to get into the 530 KH\/s area with:<\/p>\n<blockquote><p>cgminer -I 13 -g 2 -w 256 &#8211;thread-concurrency 8192<\/p><\/blockquote>\n<p>Still not pleased, being I was getting less than 700, a lot of Googling lead me to <a href=\"https:\/\/litecointalk.org\/index.php?topic=8984.0\" target=\"_blank\">someone who swapped the XFX firmware bios on the card with a Gigabyte version<\/a>. Flashing the firmware can be a dangerous proposition as it can lead you to brick your card, but a majority of the time, you can just boot up on another video card (hope you have one handy) and flash back your old bios. So be sure to back it up using <a href=\"http:\/\/www.techpowerup.com\/downloads\/SysInfo\/GPU-Z\/\" target=\"_blank\">GPU-Z<\/a> and do your homework.<\/p>\n<p>I downloaded the <a href=\"http:\/\/www.techpowerup.com\/vgabios\/133826\/gigabyte-hd7970-3072-121106.html\" target=\"_blank\">Gigabyte bios<\/a> after backing up my current XFX bios to a safe place. I can&#8217;t stress enough to backup your bios! There are a lot of writeups to boot to a dos disk, but I was lazy and used the <a href=\"http:\/\/www.techpowerup.com\/downloads\/2107\/ati-winflash-2-0-1-18\/\" target=\"_blank\">ATIWinFlash tool<\/a> to avoid all of that. A little warning though, it failed the first time I tried to flash, but all I had to do was hit the flash button again and voila, success!<\/p>\n<p>After rebooting, I was now getting right around 700 KH\/s with the following:<\/p>\n<blockquote><p>cgminer -I 13 -g 2 -w 256 &#8211;thread-concurrency 8128 &#8211;gpu-powertune 20 &#8211;gpu-engine 1040 &#8211;gpu-memclock 1825<\/p><\/blockquote>\n<p>For most people, they&#8217;d be done now, but I wanted to run this GPU in my ESXi farm. Why? Because I already run an ESXi farm and don&#8217;t want to leave a 300W gaming rig running all day. Mining is already a gamble. If you can remove most of the power costs, it is only profit left!<\/p>\n<p>In vSphere 5.5, VMware really improved the passthrough capabilities of ESXi. They still suck, but one thing added was GPU support for View. I tried very hard to get my nvidia GTX 470 working with ESXi, and failed. Once again, ATI shines and I&#8217;m able to get it working with the following tips:<\/p>\n<ul>\n<li>Make sure you are not using the video card as the ESXi Host&#8217;s boot device. Change it in the bios to boot to another video card (like the onboard one) or this whole thing will not work.<\/li>\n<li>Enable passthrough for all the devices that ESXi detects. In my case, there is a video and audio driver.<\/li>\n<li>Load the correct driver before setting up passthrough.<\/li>\n<\/ul>\n<p>After three reboots, I was able to see the AMD HD 7970 in the device manager. However, when I used the same cgminer commands:<\/p>\n<blockquote><p>cgminer -I 13 -g 2 -w 256 &#8211;thread-concurrency 8128 &#8211;gpu-powertune 20 &#8211;gpu-engine 1040 &#8211;gpu-memclock 1825<\/p><\/blockquote>\n<p>I began getting a crappy 500 KH\/s again. I loaded a GPU-Z, and noticed that my VM could not see memory clock speeds, core clock speeds, or even GPU temperature. This makes sense from a virtualization point of view; however, it means the VM is ignoring cgminer&#8217;s overclock settings.<\/p>\n<p>In my searching, I stumbled across an <a href=\"http:\/\/www.techpowerup.com\/forums\/threads\/radeon-hd77xx-78xx-79xx-bios-editor.183423\/\" target=\"_blank\">ATI bios editor<\/a>. With this, I&#8217;m able to download the firmware from my card (using GPU-Z) and then edit the base core clock and memory speeds! If this whole topic hasn&#8217;t scared you yet, and you are still feeling brave, do double check you have those firmware backups handy. Using the tool, I change my gpu core clock speed to 1040 and the memory clock speed to 1825. <\/p>\n<p>And there you have it, ~700 KH\/s on an XFX AMD HD 7970 graphics card, in an ESXi virtual machine!<\/p>\n<p><a href=\"http:\/\/zsprawl.com\/iOS\/wp-content\/uploads\/2013\/12\/cgminer1.png\"><img decoding=\"async\" src=\"http:\/\/zsprawl.com\/iOS\/wp-content\/uploads\/2013\/12\/cgminer1.png\" alt=\"cgminer\" width=\"515\" class=\"aligncenter size-full wp-image-1366\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a very specific article meant to target a very small subset of geeks out there. Sure, there are many of us geeks, and a large number have heard of this craze the last few years called Bitcoin. After Bitcoin became popular, like tv news popular, a number of crypto-coin spinoffs have surfaced. I&#8217;m <a href=\"http:\/\/zsprawl.com\/iOS\/2013\/12\/mining-bitcoins-in-esxi-using-an-xfx-7970\/#more-'\" class=\"more-link\"><br \/>more \u00bb<\/a><\/p>\n","protected":false},"author":318,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93,24],"tags":[129,94],"class_list":["post-1349","post","type-post","status-publish","format-standard","hentry","category-bitcoin","category-blog","tag-bitcoin","tag-litecoin"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts\/1349"}],"collection":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/users\/318"}],"replies":[{"embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/comments?post=1349"}],"version-history":[{"count":18,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts\/1349\/revisions"}],"predecessor-version":[{"id":1373,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts\/1349\/revisions\/1373"}],"wp:attachment":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/media?parent=1349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/categories?post=1349"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/tags?post=1349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}