{"id":13677929,"url":"https://github.com/nicehash/sgminer","last_synced_at":"2025-12-16T19:27:13.119Z","repository":{"id":16357372,"uuid":"19107401","full_name":"nicehash/sgminer","owner":"nicehash","description":"OpenCL GPU miner","archived":true,"fork":true,"pushed_at":"2018-02-12T20:38:08.000Z","size":13912,"stargazers_count":158,"open_issues_count":4,"forks_count":98,"subscribers_count":53,"default_branch":"master","last_synced_at":"2024-08-02T13:19:44.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"sgminer-dev/sgminer","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicehash.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-24T12:22:51.000Z","updated_at":"2024-08-02T13:19:44.024Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nicehash/sgminer","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicehash%2Fsgminer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicehash%2Fsgminer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicehash%2Fsgminer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicehash%2Fsgminer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicehash","download_url":"https://codeload.github.com/nicehash/sgminer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173315,"owners_count":17268096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T13:00:48.620Z","updated_at":"2025-12-16T19:27:08.056Z","avatar_url":"https://github.com/nicehash.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# sgminer\n\n\n## Introduction\n\nThis is a multi-threaded multi-pool GPU miner with ATI GPU monitoring,\n(over)clocking and fanspeed support for scrypt-based cryptocurrency. It is\nbased on cgminer by Con Kolivas (ckolivas), which is in turn based on\ncpuminer by Jeff Garzik (jgarzik).\n\n**releases**: https://github.com/sgminer-dev/sgminer/releases\n\n**git tree**: https://github.com/sgminer-dev/sgminer\n\n**bugtracker**: https://github.com/sgminer-dev/sgminer/issues\n\n**irc**: `#sgminer` and `#sgminer-dev` on freenode\n\n**mailing lists**: https://sourceforge.net/p/sgminer/mailman/\n\nLicense: GPLv3.  See `COPYING` for details.\n\n\n## Documentation\n\nDocumentation is available in directory `doc`. It is organised by topics:\n\n* `API` for the RPC API specification;\n* `configuration.md` for (largely incomplete) detailed information on all\n  configuration options;\n* `FAQ.md` for frequently asked questions;\n* `GPU` for semi-obsolete information on GPU configuration options and mining\n  SHA256d-based coins;\n* `kernel.md` for OpenCL kernel-related information, including development\n  procedure;\n* `MINING.md` for how to find the right balance in GPU configuration to mine\n  Scrypt-based coins efficiently;\n* `windows-build.txt` for information on how to build on Windows.\n\nNote that **most of the documentation is outdated or incomplete**. If\nyou want to contribute, fork this repository, update as needed, and\nsubmit a pull request.\n\n\n## Building\n\n### Dependencies\n\nMandatory:\n\n* [curl dev library](http://curl.haxx.se/libcurl/) - `libcurl4-openssl-dev` on Debian\n* [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config)\n* [libtool](http://www.gnu.org/software/libtool/)\n* [AMD APP SDK](http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/)\t- available under various names as a package on different GNU/Linux distributions\n\nOptional:\n\n* curses dev library - `libncurses5-dev` on Debian or `libpdcurses` on WIN32, for text user interface\n* [AMD ADL SDK](http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/) - version 6, required for ATI GPU monitoring \u0026 clocking\n\nIf building from git:\n\n* autoconf\n* automake\n\nsgminer-specific configuration options:\n\n    --disable-adl           Override detection and disable building with adl\n\t--disable-adl-checks\n    --without-curses        Do not compile support for curses TUI\n\n#### Debian Example\n\n    apt-get install libcurl4-openssl-dev pkg-config libtool libncurses5-dev\nAMD APP SDK and AMD ADL SDK must be downloaded from the amd websites.\n\n### *nix build instructions\n\nIf needed, place include headers (`*.h` files) from `ADL_SDK_*\u003cVERSION\u003e*.zip` in `sgminer/ADL_SDK`.\n\nThen:\n\n    git submodule init\n    git submodule update\n    autoreconf -i\n    CFLAGS=\"-O2 -Wall -march=native -std=gnu99\" ./configure \u003coptions\u003e\n    make\n\nTo compile a version that can be used accross machines, remove\n`-march=native`.\n\nTo compile a debug version, replace `-O2` with `-ggdb`.\n\nDepending on your environment, replace `-std=gnu99` with `-std=c99`.\n\nSystemwide installation is optional. You may run `sgminer` from the build\ndirectory directly, or `make install` if you wish to install\n`sgminer` to a system location or a location you specified with `--prefix`.\n\n### Windows build instructions\n\nSee `doc/windows-build.txt` for MinGW compilation and cross-compiation,\n`doc/cygwin-build.txt` for building using Cygwin, or use the provided\n`winbuild` Microsoft Visual Studio project (tested on MSVS2010), with\ninstructions in `winbuild/README.txt`.\n\n\n## Basic Usage\n\n**WARNING**: documentation below this point has not been updated since the\nfork.\n\nAfter saving configuration from the menu, you do not need to give sgminer\nany arguments and it will load your configuration.\n\nAny configuration file may also contain a single\n\n    \"include\" : \"filename\"\n\nto recursively include another configuration file.\n\nWriting the configuration will save all settings from all files in the\noutput.\n\nSingle pool:\n\nsgminer -o http://pool:port -u username -p password\n\nMultiple pools:\n\nsgminer -o http://pool1:port -u pool1username -p pool1password -o http://pool2:port -u pool2usernmae -p pool2password\n\nSingle pool with a standard http proxy, regular desktop:\n\nsgminer -o \"http:proxy:port|http://pool:port\" -u username -p password\n\nSingle pool with a socks5 proxy, regular desktop:\n\nsgminer -o \"socks5:proxy:port|http://pool:port\" -u username -p password\n\nSingle pool with stratum protocol support:\n\nsgminer -o stratum+tcp://pool:port -u username -p password\n\nThe list of proxy types are:\n http:    standard http 1.1 proxy\n http0:   http 1.0 proxy\n socks4:  socks4 proxy\n socks5:  socks5 proxy\n socks4a: socks4a proxy\n socks5h: socks5 proxy using a hostname\n\nIf you compile sgminer with a version of CURL before 7.19.4 then some of\nthe above will not be available. All are available since CURL version\n7.19.4.\n\nIf you specify the --socks-proxy option to sgminer, it will only be\napplied to all pools that don't specify their own proxy setting like\nabove.\n\nFor more advanced usage , run `sgminer --help`.\n\nSee `doc/GPU` for more information regarding GPU mining and\n`doc/SCRYPT` for more information regarding Scrypt mining.\n\n\n## Runtime usage\n\nThe following options are available while running with a single keypress:\n\n[P]ool management [G]PU management [S]ettings [D]isplay options [Q]uit\n\nP gives you:\n\nCurrent pool management strategy: Failover\n[F]ailover only disabled\n[A]dd pool [R]emove pool [D]isable pool [E]nable pool\n[C]hange management strategy [S]witch pool [I]nformation\n\n\nS gives you:\n\n[Q]ueue: 1\n[S]cantime: 60\n[E]xpiry: 120\n[W]rite config file\n[C]gminer restart\n\n\nD gives you:\n\n[N]ormal [C]lear [S]ilent mode (disable all output)\n[D]ebug:off\n[P]er-device:off\n[Q]uiet:off\n[V]erbose:off\n[R]PC debug:off\n[W]orkTime details:off\nco[M]pact: off\n[L]og interval:5\n\n\nQ quits the application.\n\n\nG gives you something like:\n\nGPU 0: [124.2 / 191.3 Mh/s] [A:77  R:33  HW:0  U:1.73/m  WU 1.73/m]\nTemp: 67.0 C\nFan Speed: 35% (2500 RPM)\nEngine Clock: 960 MHz\nMemory Clock: 480 Mhz\nVddc: 1.200 V\nActivity: 93%\nPowertune: 0%\nLast initialised: [2011-09-06 12:03:56]\nThread 0: 62.4 Mh/s Enabled ALIVE\nThread 1: 60.2 Mh/s Enabled ALIVE\n\n[E]nable [D]isable [R]estart GPU [C]hange settings\nOr press any other key to continue\n\n\nThe running log shows output like this:\n\n [2012-10-12 18:02:20] Accepted f0c05469 Diff 1/1 GPU 0 pool 1\n [2012-10-12 18:02:22] Accepted 218ac982 Diff 7/1 GPU 1 pool 1\n [2012-10-12 18:02:23] Accepted d8300795 Diff 1/1 GPU 3 pool 1\n [2012-10-12 18:02:24] Accepted 122c1ff1 Diff 14/1 GPU 1 pool 1\n\nThe 8 byte hex value are the 2nd 8 bytes of the share being submitted to the\npool. The 2 diff values are the actual difficulty target that share reached\nfollowed by the difficulty target the pool is currently asking for.\n\nThe output line shows the following:\n(5s):1713.6 (avg):1707.8 Mh/s | A:729  R:8  HW:0  WU:22.53/m\n\nEach column is as follows:\n5s:  A 5 second exponentially decaying average hash rate\navg: An all time average hash rate\nA:  The total difficulty of Accepted shares\nR:  The total difficulty of Rejected shares\nHW:  The number of HardWare errors\nWU:  The Work Utility defined as the number of diff1 shares work / minute\n     (accepted or rejected).\n\n GPU 1: 73.5C 2551RPM | 427.3/443.0Mh/s | A:8 R:0 HW:0 WU:4.39/m\n\nEach column is as follows:\nTemperature (if supported)\nFanspeed (if supported)\nA 5 second exponentially decaying average hash rate\nAn all time average hash rate\nThe total difficulty of accepted shares\nThe total difficulty of rejected shares\nThe number of hardware erorrs\nThe work utility defined as the number of diff1 shares work / minute\n\nThe sgminer status line shows:\n ST: 1  SS: 0  NB: 1  LW: 8  GF: 1  RF: 1\n\nST is STaged work items (ready to use).\nSS is Stale Shares discarded (detected and not submitted so don't count as rejects)\nNB is New Blocks detected on the network\nLW is Locally generated Work items\nGF is Getwork Fail Occasions (server slow to provide work)\nRF is Remote Fail occasions (server slow to accept work)\n\nThe block display shows:\nBlock: 0074c5e482e34a506d2a051a...  Started: [17:17:22]  Best share: 2.71K\n\nThis shows a short stretch of the current block, when the new block started,\nand the all time best difficulty share you've found since starting sgminer\nthis time.\n\n\n## Multipool\n\n### Failover strategies\n\nA number of different strategies for dealing with multipool setups are\navailable. Each has their advantages and disadvantages so multiple strategies\nare available by user choice, as per the following list:\n\n#### Failover\n\nThe default strategy is failover. This means that if you input a number of\npools, it will try to use them as a priority list, moving away from the 1st\nto the 2nd, 2nd to 3rd and so on. If any of the earlier pools recover, it will\nmove back to the higher priority ones.\n\n#### Round robin\n\nThis strategy only moves from one pool to the next when the current one falls\nidle and makes no attempt to move otherwise.\n\n#### Rotate\n\nThis strategy moves at user-defined intervals from one active pool to the next,\nskipping pools that are idle.\n\n#### Load balance\n\nThis strategy sends work to all the pools on a quota basis. By default, all\npools are allocated equal quotas unless specified with --quota. This\napportioning of work is based on work handed out, not shares returned so is\nindependent of difficulty targets or rejected shares. While a pool is disabled\nor dead, its quota is dropped until it is re-enabled. Quotas are forward\nlooking, so if the quota is changed on the fly, it only affects future work.\nIf all pools are set to zero quota or all pools with quota are dead, it will\nfall back to a failover mode. See quota below for more information.\n\nThe failover-only flag has special meaning in combination with load-balance\nmode and it will distribute quota back to priority pool 0 from any pools that\nare unable to provide work for any reason so as to maintain quota ratios\nbetween the rest of the pools.\n\n#### Balance\n\nThis strategy monitors the amount of difficulty 1 shares solved for each pool\nand uses it to try to end up doing the same amount of work for all pools.\n\n\n### Quotas\n\nThe load-balance multipool strategy works off a quota based scheduler. The\nquotas handed out by default are equal, but the user is allowed to specify any\narbitrary ratio of quotas. For example, if all the quota values add up to 100,\neach quota value will be a percentage, but if 2 pools are specified and pool0\nis given a quota of 1 and pool1 is given a quota of 9, pool0 will get 10% of\nthe work and pool1 will get 90%. Quotas can be changed on the fly by the API,\nand do not act retrospectively. Setting a quota to zero will effectively\ndisable that pool unless all other pools are disabled or dead. In that\nscenario, load-balance falls back to regular failover priority-based strategy.\nWhile a pool is dead, it loses its quota and no attempt is made to catch up\nwhen it comes back to life.\n\nTo specify quotas on the command line, pools should be specified with a\nsemicolon separated --quota(or -U) entry instead of --url. Pools specified with\n--url are given a nominal quota value of 1 and entries can be mixed.\n\nFor example:\n--url poola:porta -u usernamea -p passa --quota \"2;poolb:portb\" -u usernameb -p passb\nWill give poola 1/3 of the work and poolb 2/3 of the work.\n\nWriting configuration files with quotas is likewise supported. To use\nthe above quotas in a configuration file they would be specified thus:\n\n    \"pools\" : [\n        {\n                \"url\" : \"poola:porta\",\n                \"user\" : \"usernamea\",\n                \"pass\" : \"passa\"\n        },\n        {\n                \"quota\" : \"2;poolb:portb\",\n                \"user\" : \"usernameb\",\n                \"pass\" : \"passb\"\n        }\n    ]\n\n\n### Extra File Configuration\n\nIf you want to store a number of pools in your configuration file, but\ndon't always want them automatically enabled at start up (or restart),\nthen the \"state\" option with a value of \"disabled\" can be used:\n\n    \"pools\" : [\n        {\n                \"url\" : \"poola:porta\",\n                \"user\" : \"usernamea\",\n                \"pass\" : \"passa\"\n        },\n        {\n                \"quota\" : \"2;poolb:portb\",\n                \"user\" : \"usernameb\",\n                \"pass\" : \"passb\",\n                \"state\" : \"disabled\"\n        }\n    ]\n\nIt is then trivial to change the \"state\" setting to \"enabled\" in the\nconfiguration file at anytime and then restart the miner (see below).\nYou can enable the pool whilst the miner is still running ('p' followed\nby 'e' followed by pool number) - but the pool will still be disabled on\nrestart if the config file is not changed.\n\n\"state\" can also be set to \"hidden\". This allows the json file to\ncontain a large number of pools, of which some could be automatically\nculled at start up. This makes it easy to swap pools in and out of the\nruntime selection, without having a large list of pools cluttering up\nthe display.\n\n    \"pools\" : [\n        {\n                \"poolname\" : \"Main Pool\",\n                \"url\" : \"poola:porta\",\n                \"user\" : \"usernamea\",\n                \"pass\" : \"passa\",\n                \"state\" : \"disabled\"\n        },\n        {\n                \"poolname\" : \"Joe's Weekend Pool\",\n                \"quota\" : \"2;poolb:portb\",\n                \"user\" : \"usernameb\",\n                \"pass\" : \"passb\",\n                \"state\" : \"hidden\"\n        }\n    ]\n\nThese options are considered experimental and therefore will NOT be\ncreated when the 'Write config file' option is used ('s' followed by\n'w').\n\nA restart of the miner ('s' followed by 'c') will reload the config\nfile and any changes that may have been made.\n\n\n## Logging\n\nsgminer will log to stderr if it detects stderr is being redirected to a\nfile. To enable logging simply append `2\u003elogfile.txt` to your command line\nand `logfile.txt` will contain all debug output unless you set `debug-log`\nto `false`, in which case it will only contain output at the log level you\nspecified (notice by default).\n\nThere is also the -m option on Linux which will spawn a command of your choice\nand pipe the output directly to that command.\n\nThe WorkTime details 'debug' option adds details on the end of each line\ndisplayed for Accepted or Rejected work done. An example would be:\n\n \u003c-00000059.ed4834a3 M:X D:1.0 G:17:02:38:0.405 C:1.855 (2.995) W:3.440 (0.000) S:0.461 R:17:02:47\n\nThe first 2 hex codes are the previous block hash, the rest are reported in\nseconds unless stated otherwise:\nThe previous hash is followed by the getwork mode used M:X where X is one of\nP:Pool, T:Test Pool, L:LP or B:Benchmark,\nthen D:d.ddd is the difficulty required to get a share from the work,\nthen G:hh:mm:ss:n.nnn, which is when the getwork or LP was sent to the pool and\nthe n.nnn is how long it took to reply,\nfollowed by 'O' on it's own if it is an original getwork, or 'C:n.nnn' if it was\na clone with n.nnn stating how long after the work was recieved that it was cloned,\n(m.mmm) is how long from when the original work was received until work started,\nW:n.nnn is how long the work took to process until it was ready to submit,\n(m.mmm) is how long from ready to submit to actually doing the submit, this is\nusually 0.000 unless there was a problem with submitting the work,\nS:n.nnn is how long it took to submit the completed work and await the reply,\nR:hh:mm:ss is the actual time the work submit reply was received\n\nIf you start sgminer with the --sharelog option, you can get detailed\ninformation for each share found. The argument to the option may be \"-\" for\nstandard output (not advisable with the ncurses UI), any valid positive number\nfor that file descriptor, or a filename.\n\nTo log share data to a file named \"share.log\", you can use either:\n./sgminer --sharelog 50 -o xxx -u yyy -p zzz 50\u003eshare.log\n./sgminer --sharelog share.log -o xxx -u yyy -p zzz\n\nFor every share found, data will be logged in a CSV (Comma Separated Value)\nformat:\n    timestamp,disposition,target,pool,dev,thr,sharehash,sharedata\nFor example (this is wrapped, but it's all on one line for real):\n    1335313090,reject,\n    ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000,\n    http://localhost:8337,GPU0,0,\n    6f983c918f3299b58febf95ec4d0c7094ed634bc13754553ec34fc3800000000,\n    00000001a0980aff4ce4a96d53f4b89a2d5f0e765c978640fe24372a000001c5\n    000000004a4366808f81d44f26df3d69d7dc4b3473385930462d9ab707b50498\n    f681634a4f1f63d01a0cd43fb338000000000080000000000000000000000000\n    0000000000000000000000000000000000000000000000000000000080020000\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicehash%2Fsgminer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicehash%2Fsgminer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicehash%2Fsgminer/lists"}