README.ASIC 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  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. Bitmain's Antminer S5 and U1-3, Butterfly Labs' SC range of devices, HashBuster
  5. boards, GekkoScience's Compac USB stick, Klondike modules, and KnCMiner's
  6. Mercury, Jupiter and Saturn.
  7. ANTMINER S1-S5
  8. --------------
  9. BFGMiner must be compiled for and run on the embedded controller. When
  10. configuring, use the --enable-bitmain option to build the 'bitmain' driver used
  11. to interface with this hardware. None of the device attributes are autodetected
  12. at this time, so you must also tell BFGMiner this at runtime with a series of
  13. --set options. For example:
  14. -S bitmain:auto --set btm:model=S5 --set btm:layout=32:8 --set btm:timeout=3
  15. --set btm:clock=350 --set btm:reg_data=0d82 --set btm:voltage=x0725
  16. Note that reg_data is optional for S4 and S5 and will be calculated from clock
  17. if not provided.
  18. The meaning of each of these options are not documented individually at this
  19. time, but can be determined from the stock cgminer's options. You want to look
  20. at the "bitmain-options" from the command line, and the "bitmain-freq" and
  21. "bitmain-voltage" in the /config/cgminer.conf file.
  22. In this case, they were:
  23. NOTE: These are NOT valid BFGMiner options!
  24. --bitmain-options 115200:32:8:7:200:0782:0725
  25. | | | | ^^^^ voltage
  26. | | | ^^^^ reg_data
  27. | | ^^^ clock
  28. | ^ timeout
  29. ^^^^ layout
  30. "bitmain-freq" : "3:350:0d82",
  31. | | ^^^^ reg_data
  32. | ^^^ clock
  33. ^ timeout
  34. "bitmain-voltage" : "0725"
  35. ^^^^ voltage
  36. Notice how there are duplicate settings for timeout, clock, reg_data, and
  37. voltage. You can probably use either one, but the 350 MHz clock performs
  38. better than the 200 MHz clock. You shouldn't mix and match the
  39. timeout/clock/reg_data combinations, however!
  40. Additionally, since the controllers are underpowered for these devices, you may
  41. need to experiment with a good queue setting to control how much work BFGMiner
  42. tries to pre-prepare for it. A reasonable starting place is:
  43. --queue 8192
  44. ALCHEMIST
  45. ---------
  46. This driver requires the latest FPGA firmware flashed on the blades (stock
  47. firmware has major bug and won't run properly with this driver). For
  48. instructions, please visit: https://litecointalk.org/?topic=27370
  49. The driver has been designed to run each of the 8 blades inside an AlcheMist
  50. 256 as a separate miner. To detect all the blades you need to manually probe it
  51. with the following serial ports:
  52. -S ALC:all -S ALC:/dev/ttyO1 -S ALC:/dev/ttyO2 -S ALC:/dev/ttyO3
  53. -S ALC:/dev/ttyO4
  54. (the four ttyUSB ports are auto detected by all)
  55. The driver supports custom frequency settings in the range of 200-400 MHz in 16
  56. MHz increments (driver will default to 352 MHz if these conditions are not met).
  57. Frequency is set with the following --set option:
  58. --set ALC:clock=336
  59. You can also set the frequency per board by specifying the tty port:
  60. --set ALC@/dev/ttyO3:clock=352
  61. Driver also supports running blades off a Raspberry Pi directly or with USB Dongles. For a single blade off a raspberry Pi make sure you have configured GPIO pin 25 correctly (see below) and scan via
  62. -S ALC:/dev/ttyAMA0
  63. echo 25 > /sys/class/gpio/export
  64. echo out > /sys/class/gpio/gpio25/direction
  65. for multiple blades using USB Dongles connected to a pi make sure the reset pin on the alcheminer board is connected to the RTS/DTR pin on the dongle board, and option --set
  66. ALC:mode=1 added to startup command line.
  67. ANTMINER U3
  68. -----------
  69. The U3 does not support autodetection, so you will want to use --scan-serial to
  70. manually probe it. For example, to scan all devices, you can use:
  71. -S antminer:all --set antminer:chip=BM1382
  72. Additionally, for optimal performance you will need to set voltage, clock, and
  73. timing. Voltage format for the U3 is not documented by the manufacturer, thus
  74. must be provided as hexadecimal configuration codes. Timing is provided in the
  75. number of nanoseconds each hash takes at the given configuration. A
  76. known-working configuration is:
  77. --set antminer:voltage=x800 --set antminer:clock=237.5
  78. --set antminer:timing=0.022421
  79. To set different frequency and voltage settings for multiple U3 miners on a
  80. single BFGMiner process use:
  81. --set antminer@\\.\COM10:voltage=xNNNN
  82. or
  83. --set antminer@/dev/ttyUSB1:voltage=xNNNN
  84. Another option is to program the CP2102 chip so they have unique serial numbers;
  85. this method would avoid problems with the device showing up on different tty/COM
  86. locations after reboot/hotplug:
  87. /cp210x-program -w -F eeprom-content.AntU3-custom.hex --set-product-string='Antminer U3' --set-serial-number=myveryown0001
  88. Then you can use --set antminer@myveryown0001:voltage=xNNNN
  89. AVALON 1
  90. --------
  91. Currently, Avalon boards are best supported by connecting them directly (or via
  92. a hub) to a regular PC running BFGMiner. It is also possible to install the
  93. OpenWrt packages of BFGMiner to the Avalon's embedded controller, but this is
  94. not a simple task due to its lack of available flash space.
  95. To use the Avalon from a regular PC, you will need to specify two options:
  96. First, add the -S option specifying the avalon driver specifically. For example,
  97. -S avalon:\\.\COM9
  98. Next, use the --set-device option to provide the device configuration.
  99. If you are translating options from --avalon-options (cgminer and older versions
  100. of BFGMiner), note the values are baud:miner_count:asic_count:timeout:clock.
  101. baud=N The device is essentially hard coded to emulate 115200 baud,
  102. so you shouldn't change this.
  103. miner_count=N Most Avalons are 3 module devices, which come to 24 miners.
  104. 4 module devices would use 32 here.
  105. asic_count=N Virtually all have 10, so don't change this.
  106. timeout=N This defines how long the device will work on a work item
  107. before accepting new work to replace it. It should be changed
  108. according to the frequency (last setting). It is possible to
  109. set this a little lower if you are trying to tune for short
  110. block mining (eg p2pool) but much lower and the device will
  111. start creating duplicate shares.
  112. clock=N This is the clock speed of the devices. Only specific values
  113. work: 256, 270, 282 (default), 300, 325, 350 and 375.
  114. Sample settings for valid different frequencies (last 2 values):
  115. 34:375
  116. 36:350
  117. 39:325
  118. 43:300
  119. 45:282
  120. 47:270
  121. 50:256
  122. AVALON 2/3
  123. ----------
  124. Avalon 2/3 units communicate with a UART, usually attached to your host via a
  125. generic USB UART adapter. Therefore, you will need to manually probe the correct
  126. UART device with the -S option:
  127. -S avalonmm:\\.\COM22
  128. Next, use the --set option to configure at least your desired clock frequency
  129. and voltage.
  130. Avalon 2: --set avalonmm:clock=1500 --set avalonmm:voltage=1
  131. Avalon 3: --set avalonmm:clock=450 --set avalonmm:voltage=0.6625
  132. You may also want to set the fan speed, which is specified as a percentage:
  133. --set avalonmm:fan=95
  134. BFSB, MEGABIGPOWER, AND METABANK BITFURY BOARDS
  135. -----------------------------------------------
  136. Both BFSB and MegaBigPower (V2 only at this time) boards are supported with the
  137. "bfsb" driver. Metabank boards are supported with the "metabank" driver. These
  138. drivers are not enabled by default, since they must be run on a Raspberry Pi in
  139. a specific hardware configuration with the boards. To enable them, you must
  140. build with --enable-bfsb or --enable-metabank. Do not try to use these drivers
  141. without the manufacturer-supported hardware configuration! Also note that these
  142. drivers do not properly support thermal shutdown at this time, and without
  143. sufficient cooling you may destroy your board or chips!
  144. To start BFGMiner, ensure your Raspberry Pi's SPI is enabled (you can run the
  145. raspi-config utility for this). For Metabank boards, you must also load the I2C
  146. drivers (do not try to modprobe both with a single command; it won't work):
  147. modprobe i2c-bcm2708
  148. modprobe i2c-dev
  149. Then you must run BFGMiner as root, with the proper driver selected.
  150. For example:
  151. sudo bfgminer -S bfsb:auto
  152. BFx2
  153. ----
  154. You will need to install the WinUSB driver instead of the default FTDI serial
  155. driver. The easiest way to do this is using Zadig: http://zadig.akeo.ie/
  156. Note that since it's impossible to tell the BFx2 apart from various other
  157. devices (including BFL/Cairnsmore1 miners and even many non-mining devices!),
  158. you must run with the -S bfx:all option (or 'bfx:all' at the M+ menu).
  159. I do not know what this will do with other devices; it may start fires,
  160. launch nuclear missiles (please don't run BFGMiner on computers with
  161. missile controls), etc.
  162. BI*FURY
  163. -------
  164. Bi*Fury should just work; you may need to use -S bifury:<path>
  165. On Windows, you will need to install the standard USB CDC driver for it.
  166. http://store.bitcoin.org.pl/support
  167. If you want to upgrade the firmware, unplug your device. You will need to
  168. temporarily short a circuit. With the USB connector pointing forward, and the
  169. heatsink down, look to the forward-right; you will see two tiny lights, a set of
  170. 2 terminals, and a set of 3 terminals. The ones you need to short are the set of
  171. 2. With them shorted, plug the device back into your computer. It will then
  172. pretend to be a mass storage disk drive. If you use Windows, you can play along
  173. and just overwrite the firmware.bin file. If you use Linux, you must use mcopy:
  174. mcopy -i /dev/disk/by-id/usb-NXP_LPC1XXX_IFLASH_ISP-0:0 firmware.bin \
  175. ::/firmware.bin
  176. After this is complete, unplug the device again and un-short the 2 terminals.
  177. This completes the upgrade and you can now plug it back in and start mining.
  178. BIG PICTURE MINING BITFURY USB
  179. ------------------------------
  180. These miners are sensitive to unexpected data. Usually you can re-plug them to
  181. reset to a known-good initialisation state. To ensure they are properly detected
  182. and used with BFGMiner, you must specify -S bigpic:all (or equivalent) options
  183. prior to any other -S options (which might probe the device and confuse it).
  184. BLOCK ERUPTER BLADE
  185. -------------------
  186. Blades communicate over Ethernet using the old but simple getwork mining
  187. protocol. If you build BFGMiner with libmicrohttpd, you can have it work with
  188. one or more blades. First, start BFGMiner with the --http-port option. For
  189. example:
  190. bfgminer --http-port 8330
  191. Then configure your blade to connect to your BFGMiner instance on the same port,
  192. with a unique username per blade. It will then show up as a PXY device and
  193. should work more or less like any other miner.
  194. BLOCK ERUPTER USB
  195. -----------------
  196. These will autodetect if supported by the device; otherwise, you need to use
  197. the '--scan-serial erupter:<device>' option to tell BFGMiner what device to
  198. probe; if you know you have no other serial devices, or only ones that can
  199. tolerate garbage, you can use '--scan-serial erupter:all' to probe all serial
  200. ports. They communicate with the Icarus protocol, which has some additional
  201. options in README.FPGA
  202. COMPAC
  203. ------
  204. These USB sticks are based on Bitmain's BM1384 chip, and use the antminer
  205. driver. You can set the clock frequency with
  206. --set compac:clock=200
  207. You can also adjust the clock real-time while the stick is hashing using RPC's pgaset:
  208. bfgminer-rpc "pgaset|0,clock,x0982"
  209. | ^^^^^ hex frequency
  210. ^ device number
  211. HEX*FURY
  212. --------
  213. Hex*Fury uses the bifury driver. Miners using earlier boards may need to
  214. workaround bugs in the firmware:
  215. bfgminer --set bifury:chips=6 --set bifury:free_after_job=no
  216. This may cause poor behaviour or performance from other bifury-based devices.
  217. If you encounter this, you can set the workarounds per-device by using their
  218. serial number (which can be seen in the TUI device manager; in this example,
  219. 141407160211cdf):
  220. bfgminer --set bifury@141407160211cdf:chips=15 ...
  221. KLONDIKE
  222. --------
  223. --klondike-options <arg> Set klondike options clock:temptarget
  224. KNCMINER (Jupiter)
  225. --------
  226. KnCMiner rigs use a BeagleBone Black (BBB) as the host; this is pluged into a
  227. "cape" with a FPGA and connections for 4-6 ASIC modules (depending on the cape
  228. version). Note that in addition to the usual dependencies, this driver also
  229. requires i2c-tools (aka libi2c-dev on some systems). The BBB comes with the
  230. Ångström Distribution by default. The following is a step by step install for
  231. BFGMiner on this system;
  232. -----------------Start------------
  233. cat >/etc/opkg/feeds.conf <<\EOF
  234. src/gz noarch http://feeds.angstrom-distribution.org/feeds/v2013.06/ipk/eglibc/all/
  235. src/gz base http://feeds.angstrom-distribution.org/feeds/v2013.06/ipk/eglibc/armv7ahf-vfp-neon/base/
  236. src/gz beaglebone http://feeds.angstrom-distribution.org/feeds/v2013.06/ipk/eglibc/armv7ahf-vfp-neon/machine/beaglebone/
  237. EOF
  238. opkg update
  239. opkg install angstrom-feed-configs
  240. rm /etc/opkg/feeds.conf
  241. opkg update
  242. opkg install update-alternatives
  243. opkg install automake autoconf make gcc cpp binutils git less pkgconfig-dev ncurses-dev libtool nano bash i2c-tools-dev
  244. while ! opkg install libcurl-dev; do true; done
  245. curl http://www.digip.org/jansson/releases/jansson-2.0.1.tar.bz2 | tar -xjvp
  246. cd jansson-2.0.1
  247. ./configure --prefix=/usr CC=arm-angstrom-linux-gnueabi-gcc --disable-static NM=arm-angstrom-linux-gnueabi-nm
  248. make install && ldconfig
  249. cd ..
  250. git clone git://github.com/luke-jr/bfgminer
  251. cd bfgminer
  252. ./autogen.sh
  253. git clone git://github.com/troydhanson/uthash
  254. ./configure --host=arm-angstrom-linux-gnueabi --enable-knc --disable-other-drivers CFLAGS="-I$PWD/uthash/src"
  255. make AR=arm-angstrom-linux-gnueabi-ar
  256. /etc/init.d/cgminer.sh stop
  257. ./bfgminer -S knc:auto -c /config/cgminer.conf
  258. ---------------END-------------
  259. KNCMINER (Titan)
  260. --------
  261. Titan uses RaspberryPi as a controller.
  262. Build instructions:
  263. -----------------Start------------
  264. git clone git@github.com:KnCMiner/bfgminer.git
  265. cd bfgminer
  266. ./autogen.sh
  267. ./configure --enable-scrypt --disable-sha256d --enable-titan --disable-other-drivers
  268. make
  269. sudo /etc/init.d/bfgminer.sh restart
  270. screen -r
  271. ---------------END-------------
  272. MONARCH
  273. -------
  274. The Butterfly Labs Monarch devices can be used as either USB devices, or in a
  275. PCI-Express slot. As USB devices, they are essentially plug-and-play. If you
  276. wish to use them via PCI-Express, however, you must first load the proper
  277. driver. BFGMiner can work with either Linux uio (2.6.23+, requires root access)
  278. or Linux vfio (3.6+, requires IOMMU support).
  279. To enable uio on your cards, you may need to do:
  280. sudo modprobe uio_pci_generic
  281. echo 1cf9 0001 | sudo tee /sys/bus/pci/drivers/uio_pci_generic/new_id
  282. Enabling vfio is similar, but allows you to run BFGMiner without root
  283. privileges. Since setting this up is more complicated, BFGMiner includes a
  284. setup-vfio script (which must be run with root permissions). Simply run:
  285. sudo setup-vfio --unsafe --user $(whoami) 1cf9 0001
  286. You will be asked about each Monarch found, and must answer 'yes' to each one.
  287. If you wish to manually setup VFIO, follow these steps:
  288. First, load the kernel module:
  289. sudo modprobe vfio-pci
  290. Next, identify what the device ids are for your card(s):
  291. lspci -D | grep 1cf9 # the first number of each line is the device id
  292. From that, you can identify its IOMMU group, and list all devices sharing that
  293. group:
  294. readlink "/sys/bus/pci/devices/$DEVICE_ID/iommu_group"
  295. ls "/sys/kernel/iommu_groups/$IOMMU_GROUP_ID/devices/"
  296. All of the devices listed (other than the Monarch), if any, will need to be
  297. disabled and unbound! To do that, use:
  298. echo "$DEVICE_ID" | sudo tee "/sys/bus/pci/devices/$DEVICE_ID/driver/unbind"
  299. echo "$DEVICE_CODE" | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id
  300. Note that $DEVICE_ID should be something like "0000:01:00.0" and $DEVICE_CODE is
  301. something like "1cf9 0001" (this example is the Monarch itself).
  302. If you want to run BFGMiner as a normal user:
  303. chown "$USERNAME" "/dev/vfio/$IOMMU_GROUP_ID"
  304. Depending on your system, you may also need to do:
  305. echo 1 | sudo tee /sys/module/vfio_iommu_type1/parameters/allow_unsafe_interrupts
  306. ONESTRINGMINER
  307. --------------
  308. OneStringMiner boards use the bifury driver. Miners using earlier boards may
  309. need to workaround bugs in the firmware:
  310. bfgminer --set bifury:chips=15 --set bifury:free_after_job=no
  311. If you have different devices using the bifury driver, see the section on
  312. Hex*Fury for applying workarounds per-device.
  313. GRIDSEED
  314. --------
  315. Gridseed units, at the present time, come in two versions: Blade - a 40 chip
  316. unit and Orb - a 5 chip unit. Orb units can be used to mine both SHA256d and
  317. scrypt based coins whereas the Blade is scrypt only, although BFGMiner only
  318. supports scrypt mode at this time.
  319. BFGMiner allows a miner to connect both types of units to a single miner
  320. instance and provides for granular control of the clock frequencies for each
  321. device and each chip on each device. The basic use of this feature is to use the
  322. --set option on from the command line:
  323. bfgminer --scrypt -S gridseed:all --set gridseed@<serial_number>:clock=825
  324. for multiple devices, add multiple --set arguments.
  325. Additionally, these can be added to the bfgminer.conf file for persistence like
  326. this:
  327. "set" : [
  328. "gridseed@<serial_number>:clock=825",
  329. "gridseed@<serial_number>:clock=850",
  330. "gridseed@<serial_number>:clock=875"
  331. ]
  332. To find the device serial number, start bfgminer and press <M> to manage
  333. devices, then <Page Down> or <down arrow> through the list of devices and take
  334. note of the device serial number in the device information shown.
  335. ...
  336. Select processor to manage using up/down arrow keys
  337. GSD 0a: | 74.4/ 72.9/ 10.2kh/s | A: 1 R:0+0(none) HW:0/none
  338. STM32 Virtual COM Port from STMicroelectronics
  339. Serial: 6D85278F5650
  340. Clock speed: 875
  341. ...
  342. So for example, an entry would look like this:
  343. gridseed@6D85278F5650:clock=875
  344. ZEUSMINER
  345. ---------
  346. Zeusminers do not support autodetection, so you will need to use --scan to probe
  347. for them:
  348. -S zeusminer:\\.\COM3
  349. You should also configure the driver for your specific device:
  350. --set zeusminer:clock=N Clock frequency (default: 328)
  351. --set zeusminer:chips=N Number of chips per device
  352. Blizzard : 6 Cyclone : 96
  353. Hurricane X2: 48 (2*24) Hurricane X3: 64 (2*32)
  354. Thunder X2: 96 (4*24) Thunder X3: 128 (4*32)
  355. Note: if you set this option incorrectly, the device may underperform and/or
  356. misreport hashrate.
  357. For example:
  358. bfgminer --scrypt -o stratum+tcp://pool:port -u user -p pass -S zeusminer:\\.\COM3 --set zeusminer:clock=328 --set zeusminer:chips=128
  359. ---
  360. This code is provided entirely free of charge by the programmer in his spare
  361. time so donations would be greatly appreciated. Please consider donating to the
  362. address below.
  363. Luke-Jr <luke-jr+bfgminer@utopios.org>
  364. 1QATWksNFGeUJCWBrN4g6hGM178Lovm7Wh