README.ASIC 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. SUPPORTED DEVICES
  2. Currently supported ASIC devices include Avalon, Bitfountain's Block Erupter
  3. series (both USB and blades), a large variety of Bitfury-based miners,
  4. Butterfly Labs' SC range of devices, HashBuster boards, Klondike modules, and
  5. KnCMiner's Mercury, Jupiter and Saturn.
  6. AVALON 1
  7. --------
  8. Currently, Avalon boards are best supported by connecting them directly (or via
  9. a hub) to a regular PC running BFGMiner. It is also possible to install the
  10. OpenWrt packages of BFGMiner to the Avalon's embedded controller, but this is
  11. not a simple task due to its lack of available flash space.
  12. To use the Avalon from a regular PC, you will need to specify two options:
  13. First, add the -S option specifying the avalon driver specifically. For example,
  14. -S avalon:\\.\COM9
  15. Next, use the --set-device option to provide the device configuration.
  16. If you are translating options from --avalon-options (cgminer and older versions
  17. of BFGMiner), note the values are baud:miner_count:asic_count:timeout:clock.
  18. baud=N The device is essentially hard coded to emulate 115200 baud,
  19. so you shouldn't change this.
  20. miner_count=N Most Avalons are 3 module devices, which come to 24 miners.
  21. 4 module devices would use 32 here.
  22. asic_count=N Virtually all have 10, so don't change this.
  23. timeout=N This defines how long the device will work on a work item
  24. before accepting new work to replace it. It should be changed
  25. according to the frequency (last setting). It is possible to
  26. set this a little lower if you are trying to tune for short
  27. block mining (eg p2pool) but much lower and the device will
  28. start creating duplicate shares.
  29. clock=N This is the clock speed of the devices. Only specific values
  30. work: 256, 270, 282 (default), 300, 325, 350 and 375.
  31. Sample settings for valid different frequencies (last 2 values):
  32. 34:375
  33. 36:350
  34. 39:325
  35. 43:300
  36. 45:282
  37. 47:270
  38. 50:256
  39. AVALON 2/3
  40. ----------
  41. Avalon 2/3 units communicate with a UART, usually attached to your host via a
  42. generic USB UART adapter. Therefore, you will need to manually probe the correct
  43. UART device with the -S option:
  44. -S avalonmm:\\.\COM22
  45. Next, use the --set option to configure at least your desired clock frequency
  46. and voltage.
  47. Avalon 2: --set avalonmm:clock=1500 --set avalonmm:voltage=1
  48. Avalon 3: --set avalonmm:clock=450 --set avalonmm:voltage=0.6625
  49. You may also want to set the fan speed, which is specified as a percentage:
  50. --set avalonmm:fan=95
  51. BFSB, MEGABIGPOWER, AND METABANK BITFURY BOARDS
  52. -----------------------------------------------
  53. Both BFSB and MegaBigPower (V2 only at this time) boards are supported with the
  54. "bfsb" driver. Metabank boards are supported with the "metabank" driver. These
  55. drivers are not enabled by default, since they must be run on a Raspberry Pi in
  56. a specific hardware configuration with the boards. To enable them, you must
  57. build with --enable-bfsb or --enable-metabank. Do not try to use these drivers
  58. without the manufacturer-supported hardware configuration! Also note that these
  59. drivers do not properly support thermal shutdown at this time, and without
  60. sufficient cooling you may destroy your board or chips!
  61. To start BFGMiner, ensure your Raspberry Pi's SPI is enabled (you can run the
  62. raspi-config utility for this). For Metabank boards, you must also load the I2C
  63. drivers (do not try to modprobe both with a single command; it won't work):
  64. modprobe i2c-bcm2708
  65. modprobe i2c-dev
  66. Then you must run BFGMiner as root, with the proper driver selected.
  67. For example:
  68. sudo bfgminer -S bfsb:auto
  69. BI*FURY
  70. -------
  71. Bi*Fury should just work; you may need to use -S bifury:<path>
  72. On Windows, you will need to install the standard USB CDC driver for it.
  73. http://store.bitcoin.org.pl/support
  74. If you want to upgrade the firmware, unplug your device. You will need to
  75. temporarily short a circuit. With the USB connector pointing forward, and the
  76. heatsink down, look to the forward-right; you will see two tiny lights, a set of
  77. 2 terminals, and a set of 3 terminals. The ones you need to short are the set of
  78. 2. With them shorted, plug the device back into your computer. It will then
  79. pretend to be a mass storage disk drive. If you use Windows, you can play along
  80. and just overwrite the firmware.bin file. If you use Linux, you must use mcopy:
  81. mcopy -i /dev/disk/by-id/usb-NXP_LPC1XXX_IFLASH_ISP-0:0 firmware.bin \
  82. ::/firmware.bin
  83. After this is complete, unplug the device again and un-short the 2 terminals.
  84. This completes the upgrade and you can now plug it back in and start mining.
  85. BIG PICTURE MINING BITFURY USB
  86. ------------------------------
  87. These miners are sensitive to unexpected data. Usually you can re-plug them to
  88. reset to a known-good initialisation state. To ensure they are properly detected
  89. and used with BFGMiner, you must specify -S bigpic:all (or equivalent) options
  90. prior to any other -S options (which might probe the device and confuse it).
  91. BLOCK ERUPTER BLADE
  92. -------------------
  93. Blades communicate over Ethernet using the old but simple getwork mining
  94. protocol. If you build BFGMiner with libmicrohttpd, you can have it work with
  95. one or more blades. First, start BFGMiner with the --http-port option. For
  96. example:
  97. bfgminer --http-port 8330
  98. Then configure your blade to connect to your BFGMiner instance on the same port,
  99. with a unique username per blade. It will then show up as a PXY device and
  100. should work more or less like any other miner.
  101. BLOCK ERUPTER USB
  102. -----------------
  103. These will autodetect if supported by the device; otherwise, you need to use
  104. the '--scan-serial erupter:<device>' option to tell BFGMiner what device to
  105. probe; if you know you have no other serial devices, or only ones that can
  106. tolerate garbage, you can use '--scan-serial erupter:all' to probe all serial
  107. ports. They communicate with the Icarus protocol, which has some additional
  108. options in README.FPGA
  109. HEX*FURY
  110. --------
  111. Hex*Fury uses the bifury driver. Miners using earlier boards may need to
  112. workaround bugs in the firmware:
  113. bfgminer --set bifury:chips=6 --set bifury:free_after_job=no
  114. This may cause poor behaviour or performance from other bifury-based devices.
  115. If you encounter this, you can set the workarounds per-device by using their
  116. serial number (which can be seen in the TUI device manager; in this example,
  117. 141407160211cdf):
  118. bfgminer --set bifury@141407160211cdf:chips=15 ...
  119. KLONDIKE
  120. --------
  121. --klondike-options <arg> Set klondike options clock:temptarget
  122. KNCMINER (Jupiter)
  123. --------
  124. KnCMiner rigs use a BeagleBone Black (BBB) as the host; this is pluged into a
  125. "cape" with a FPGA and connections for 4-6 ASIC modules (depending on the cape
  126. version). Note that in addition to the usual dependencies, this driver also
  127. requires i2c-tools (aka libi2c-dev on some systems). The BBB comes with the
  128. Ångström Distribution by default. The following is a step by step install for
  129. BFGMiner on this system;
  130. -----------------Start------------
  131. cat >/etc/opkg/feeds.conf <<\EOF
  132. src/gz noarch http://feeds.angstrom-distribution.org/feeds/v2013.06/ipk/eglibc/all/
  133. src/gz base http://feeds.angstrom-distribution.org/feeds/v2013.06/ipk/eglibc/armv7ahf-vfp-neon/base/
  134. src/gz beaglebone http://feeds.angstrom-distribution.org/feeds/v2013.06/ipk/eglibc/armv7ahf-vfp-neon/machine/beaglebone/
  135. EOF
  136. opkg update
  137. opkg install angstrom-feed-configs
  138. rm /etc/opkg/feeds.conf
  139. opkg update
  140. opkg install update-alternatives
  141. opkg install automake autoconf make gcc cpp binutils git less pkgconfig-dev ncurses-dev libtool nano bash i2c-tools-dev
  142. while ! opkg install libcurl-dev; do true; done
  143. curl http://www.digip.org/jansson/releases/jansson-2.0.1.tar.bz2 | tar -xjvp
  144. cd jansson-2.0.1
  145. ./configure --prefix=/usr CC=arm-angstrom-linux-gnueabi-gcc --disable-static NM=arm-angstrom-linux-gnueabi-nm
  146. make install && ldconfig
  147. cd ..
  148. git clone git://github.com/luke-jr/bfgminer
  149. cd bfgminer
  150. ./autogen.sh
  151. git clone git://github.com/troydhanson/uthash
  152. ./configure --host=arm-angstrom-linux-gnueabi --enable-knc --disable-other-drivers CFLAGS="-I$PWD/uthash/src"
  153. make AR=arm-angstrom-linux-gnueabi-ar
  154. /etc/init.d/cgminer.sh stop
  155. ./bfgminer -S knc:auto -c /config/cgminer.conf
  156. ---------------END-------------
  157. KNCMINER (Titan)
  158. --------
  159. Titan uses RaspberryPi as a controller.
  160. Build instructions:
  161. -----------------Start------------
  162. git clone git@github.com:KnCMiner/bfgminer.git
  163. cd bfgminer
  164. ./autogen.sh
  165. ./configure --enable-scrypt --enable-titan --disable-other-drivers
  166. make
  167. sudo /etc/init.d/bfgminer.sh restart
  168. screen -r
  169. ---------------END-------------
  170. MONARCH
  171. -------
  172. The Butterfly Labs Monarch devices can be used as either USB devices, or in a
  173. PCI-Express slot. As USB devices, they are essentially plug-and-play. If you
  174. wish to use them via PCI-Express, however, you must first load the proper
  175. driver. BFGMiner can work with either Linux uio (2.6.23+, requires root access)
  176. or Linux vfio (3.6+, requires IOMMU support).
  177. To enable uio on your cards, you may need to do:
  178. sudo modprobe uio_pci_generic
  179. echo 1cf9 0001 | sudo tee /sys/bus/pci/drivers/uio_pci_generic/new_id
  180. Enabling vfio is similar, but allows you to run BFGMiner without root
  181. privileges. Since setting this up is more complicated, BFGMiner includes a
  182. setup-vfio script (which must be run with root permissions). Simply run:
  183. sudo setup-vfio --unsafe --user $(whoami) 1cf9 0001
  184. You will be asked about each Monarch found, and must answer 'yes' to each one.
  185. If you wish to manually setup VFIO, follow these steps:
  186. First, load the kernel module:
  187. sudo modprobe vfio-pci
  188. Next, identify what the device ids are for your card(s):
  189. lspci -D | grep 1cf9 # the first number of each line is the device id
  190. From that, you can identify its IOMMU group, and list all devices sharing that
  191. group:
  192. readlink "/sys/bus/pci/devices/$DEVICE_ID/iommu_group"
  193. ls "/sys/kernel/iommu_groups/$IOMMU_GROUP_ID/devices/"
  194. All of the devices listed (other than the Monarch), if any, will need to be
  195. disabled and unbound! To do that, use:
  196. echo "$DEVICE_ID" | sudo tee "/sys/bus/pci/devices/$DEVICE_ID/driver/unbind"
  197. echo "$DEVICE_CODE" | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id
  198. Note that $DEVICE_ID should be something like "0000:01:00.0" and $DEVICE_CODE is
  199. something like "1cf9 0001" (this example is the Monarch itself).
  200. If you want to run BFGMiner as a normal user:
  201. chown "$USERNAME" "/dev/vfio/$IOMMU_GROUP_ID"
  202. Depending on your system, you may also need to do:
  203. echo 1 | sudo tee /sys/module/vfio_iommu_type1/parameters/allow_unsafe_interrupts
  204. ONESTRINGMINER
  205. --------------
  206. OneStringMiner boards use the bifury driver. Miners using earlier boards may
  207. need to workaround bugs in the firmware:
  208. bfgminer --set bifury:chips=15 --set bifury:free_after_job=no
  209. If you have different devices using the bifury driver, see the section on
  210. Hex*Fury for applying workarounds per-device.
  211. GRIDSEED
  212. --------
  213. Gridseed units, at the present time, come in two versions: Blade - a 40 chip
  214. unit and Orb - a 5 chip unit. Orb units can be used to mine both SHA256d and
  215. scrypt based coins whereas the Blade is scrypt only, although BFGMiner only
  216. supports scrypt mode at this time.
  217. BFGMiner allows a miner to connect both types of units to a single miner
  218. instance and provides for granular control of the clock frequencies for each
  219. device and each chip on each device. The basic use of this feature is to use the
  220. --set option on from the command line:
  221. bfgminer --scrypt -S gridseed:all --set gridseed@<serial_number>:clock=825
  222. for multiple devices, add multiple --set arguments.
  223. Additionally, these can be added to the bfgminer.conf file for persistence like
  224. this:
  225. "set" : [
  226. "gridseed@<serial_number>:clock=825",
  227. "gridseed@<serial_number>:clock=850",
  228. "gridseed@<serial_number>:clock=875"
  229. ]
  230. To find the device serial number, start bfgminer and press <M> to manage
  231. devices, then <Page Down> or <down arrow> through the list of devices and take
  232. note of the device serial number in the device information shown.
  233. ...
  234. Select processor to manage using up/down arrow keys
  235. GSD 0a: | 74.4/ 72.9/ 10.2kh/s | A: 1 R:0+0(none) HW:0/none
  236. STM32 Virtual COM Port from STMicroelectronics
  237. Serial: 6D85278F5650
  238. Clock speed: 875
  239. ...
  240. So for example, an entry would look like this:
  241. gridseed@6D85278F5650:clock=875
  242. ---
  243. This code is provided entirely free of charge by the programmer in his spare
  244. time so donations would be greatly appreciated. Please consider donating to the
  245. address below.
  246. Luke-Jr <luke-jr+bfgminer@utopios.org>
  247. 1QATWksNFGeUJCWBrN4g6hGM178Lovm7Wh