Gareth Johnson
Gareth Johnson
Updated on January 12, 2022

SGMiner is one of the most efficient mining software in the cryptocurrency environment today. The reason it is so efficient is because it is simple and to the point. However, simplicity doesn’t always equal user-friendliness, as SGMiner lacks a guided user interface (GUI), which makes it less suitable for absolute beginner miners or to those who don’t have experience in coding. 

Regardless of whether you have the technical know-how or not, in this article, we’ll go step by step and teach you how to set up your mining software and start using SGMiner.

Cryptocurrency Mining

Mining cryptocurrency has been a popular business since the great financial success of cryptocurrencies. However, as it gets more popular, it also gets more competitive.

Today, cryptocurrency mining is a heavily invested and centralized business. Solo mining is hardly ever profitable, as the hashing power a solo miner can produce is incomparable to the one produced by large mining pools. What’s more, since the introduction of ASIC miners, the computing power needed to mine crypto has skyrocketed. Today, CPU mining is entirely over, and GPUs hardly compete with the latest ASIC miners.

ASIC Miners

That being said, you can still try your chance with GPU mining for a bit of a side hustle and just to see how it feels to get your hands dirty in the mining market.

What Is SGMiner?

SGMiner is an open-source cryptocurrency mining software developed by an independent developer. The most important aspect of SGMiner is that it supports mining coins that use the scrypt algorithm. The standard version doesn’t support any other mining algorithms.

SGMiner is basically an upgrade on the well-known CGMiner that was in turn based on CPUMiner. When CGMiner stopped supporting the scrypt algorithm, SGMiner took over. To mine cryptocurrency with SGMiner, look for its latest update, SGMiner GM, released in January 2017 by genesis mining.

SGMiner is a multi-threaded and multi-pool GPU miner. Multi-thread simply means increasing the capacity of parallel computing on a single-core processor to increase the computational power by tweaking the device around. And multipool mining is a way of mining where you switch between the most profitable coins during each mining period. These features make SGMiner a profitable software to mine cryptocurrency on GPUs with.

All GPUs are programmed to run at a certain speed by default. This factory setting is called the base clock. But depending on the GPU, the running speed can be increased safely. Overclocking support increases your GPU’s running speed from the default setting to a higher level. SGMiner lets you do this to optimize mining activity.

Moreover, since mining is a computationally cumbersome activity, SGMiner adjusts your fan speed accordingly to keep it from interfering with the mining activity and heating up to dangerous levels while mining. SGMiner works best on Windows operating systems with an ATI GPU. If you own a Linux operating system or an AMD GPU, you can use the SGMiner Avermore, a fork of SGMiner that supports X16R, X16S, and Xevan algorithms.

We’ve also mentioned that the software lacks a GUI and is completely configured and run through the command line. Ours is a tutorial in broad strokes but there is a lot of fine-tuning involved and possible device-specific problems you might encounter. If you don’t have any coding experience, we recommend looking into other miner options with more friendly user interfaces.

The Scrypt Algorithm

Different algorithms are used for mining different coins using the Proof of Work (PoW) protocol. For example, in order to mine Bitcoin (BTC), your processor applies the SHA-256 algorithm continuously for the verification and validation of blocks. Similarly, Ethereum (ETH) uses Keccak-256, Monero(XMR) uses CryptoNight and Litecoin uses the scrypt algorithm.

Crypto mining code on screen

SGMiner is software that was developed to support mining on the scrypt algorithm. Mining coins that are scrypt based on your GPU is a different process from mining other cryptocurrencies. At first, the scrypt algorithm was developed in response to the rise and dominance of ASIC mining rigs in crypto mining. It was thought of as a way to increase the performance of CPUs by altering the SHA-256 algorithm to bring people with everyday purpose machines back into the mining field. However, things took a different turn and the algorithm was repurposed to work on GPUs and ASICS.

To mine coins like Litecoin (LTC) using the scrypt algorithm, miners need to generate random numbers continuously, which then need to be stored in the RAM. This makes it a mainly RAM-dependent process. Thanks to this nature of the scrypt algorithm, scrypt networks have very different requirements and have notably lower hash rates than SHA-256 algorithm-based coins.

Which Coins Can You Mine With SGMiner?

Initially, SGMiner was developed to mine scrypt based coins. However, with the latest update, SGMiner GM 5.5.8, you can also mine Ethereum (ETH), Ripple (XRP), and ZCash (ZEC).

Before You Set Up SGMiner

The first thing you need to do is get a wallet to transfer the coins you mine. For simplicity’s sake, in this tutorial, we will go with the Litecoin wallet. You can decide which wallet you want to use depending on the coins you will mine.

Also, before running SGMiner, you need to have the following assets libraries on your computer:

curl dev library https://curl.se/libcurl/

curses dev library

pkg-config https://www.freedesktop.org/wiki/Software/pkg-config/

libtool http://www.gnu.org/software/libtool/

AMD APP SDK https://developer.amd.com/tools-and-sdks/

AMD ADL SDK

Once you download these assets and libraries, it’s time to download the mining software. For that, you can go to genesis mining’s SGMiner GitHub page and download sgminer-gm.zip for windows or sgminer_ubuntu64 for Linux.

Then, you need to join a mining pool. Even though you can mine solo in theory, as said before, it is strongly recommended that you join a mining pool because mining solo is not profitable at all. Once you sign up for a pool, go to the Worker Bots page and select your worker’s name and password.

How to Set Up SGMiner

Go back to the file you’ve extracted SGMiner into. Don’t open the miner.exe yet. Open a Notepad file and enter the following settings. This Notepad file is going to be your bat file. These settings are just average values to get you started. You need to fine-tune them according to your system specifications later on.

For Windows:

setx GPU_MAX_ALLOC_PERCENT 100

setx GPU_USE_SYNC_OBJECTS 1

For Linux:

export DISPLAY=:0

export GPU_MAX_ALLOC_PERCENT=100

export GPU_USE_SYNC_OBJECTS=1

After entering the lines above, you need to add another line. This line tells SGMiner the information it needs to know about your pool. Go to your Pool page and find your stratum and port information, then enter the following line, modified according to your specifications.

  • For single pool: sgminer -o http://pool:port -u username -p password
  • For multiple pools: sgminer -o http://pool1:port -u pool1username -p pool1password -o http://pool2:port -u pool2usernmae -p pool2password
  • Single pool with a standard http proxy on a regular desktop: sgminer -o “http:proxy:port|http://pool:port” -u username -p password
  • Single pool with a socks5 proxy on a regular desktop: sgminer -o “socks5:proxy:port|http://pool:port” -u username -p password
  • Single pool with stratum protocol support: sgminer -o stratum+tcp://pool:port -u username -p password

For more advanced settings, you can always run SGMiner –help.

Once you’re done with it, select Save As and go to the folder you extracted SGMiner to. The filename should be StartMiner.bat, and the save as type should be All Files, not txt. The bat file will be associated with the Tuning SGMiner.exe. When you open it, it will read over the exe file. This way, you don’t have to enter the specifications each time you run your miner.

To run SGMiner, double click on the bat file. It should open up a cmd prompt.

How to Tune SGMiner

If you somehow set the parameters above your GPU’s capacity, your SGMiner might stop mining due to misconfiguration.

Your GPU version is very important when mining scrypt-based coins as some drivers might halt the process before it’s done, while others might give lower hash rates. This is why you should try the latest driver update first. If you come across such a problem, the solution differs for every GPU model, and you should look for the solution specific to your device’s model.

Hand with blue gloves setting up GPU on white background

Some machines come with Open Computing Language (OpenCL), a framework for parallel programming on GPUs, which significantly increases GPU performances, but sometimes it may get into conflict with the AMF APP SDK, which is a portable multimedia framework that is used to abstract away API specific details. If that happens, consider removing redundant OpenCL vendors.

The Parameters You Need to Tune SGMiner

You can easily tune SGMiner with the parameters you want it to run on by adding the following commands to the last line you added on the bat file: –intensity XX (-I XX).

You need to find the optimum intensity for your GPU on a scale of 0 to 31. If you have HW errors – the HW value on your cmd prompt when you run SGMiner represents your HW errors – you probably need to lower your intensity rate. If not specified, the default setting will yield poor hash rates. You can refer to the shaders option for further fine-tuning: –shaders XXX. For best results, enter the number of shaders your GPU has.

The next command you can use is: –thread-concurrency, which represents the optimal volume of workload that your GPU can apply on scrypt. Obviously, the optimum value depends on your GPU. You are advised to spend some time experimenting with it to find the optimum point to make the best out of your processor.

The -g command is used occasionally when you want to mine on low intensities. If you wish to do so, after determining the optimum shaders and intensity values, start incrementally increasing the g value until the SGMiner fails to start.

The –lookup-gap is another advanced setting for situations when you want to mine on different ram usage levels. If for some reason you need to allocate less RAM on mining, for example, if you want to use your computer for another RAM dependent activity, you can increase the gap value. When increasing it, start from 2 and go up gradually from there until you find the optimum RAM allocation.

A Few Words Before You Go…

The primary goal of every mining software is computational efficiency. Every hardware and software combination has different optimum parameters to work on. To be able to make the best out of your device, you should do some research on how to personalize the parameters to your best interest. However, while doing so, you should keep in mind that mining cryptocurrency is a very cumbersome task for your GPU, and there are certain risks involved with it that you can read more on in our separate article.