{"version":"https://jsonfeed.org/version/1.1","title":"Jaryl Chng's Knowledge Base","home_page_url":"https://kb.jarylchng.com","feed_url":"https://kb-jarylchng-com.pages.dev/json/","description":"<p>Welcome to the index page of my knowledge base, if you haven't done so, do visit my website at <a href=\"https://jarylchng.com\" rel=\"noopener noreferrer\" target=\"_blank\">https://jarylchng.com</a>.</p><p>I will mainly use this site to document stuff, most of which will likely be in the public domain.</p>","icon":"https://kb-static.jarylchng.com/kb-jarylchng-com/production/images/channel-c68f1f55f856ab833b4365991609dbec.png","favicon":"https://kb-static.jarylchng.com/kb-jarylchng-com/production/images/favicon-b94914f57599a477f9f72dab6bc71001.png","authors":[{"name":"Jaryl Chng"}],"language":"en-us","items":[{"id":"lp-s3OrdZuR","title":"Linux - Overclocking Multiple Headless Nvidia GPU for CUDA Cryptocurrency Mining","url":"https://kb.jarylchng.com/i/linux-overclocking-multiple-headless-nvidia-gpu-lp-s3OrdZuR/","content_html":"<h2>Setup</h2><pre class=\"ql-syntax\" spellcheck=\"false\">lspci | grep VGA\n  01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  02:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  03:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  04:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  06:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  07:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n</pre><p>6x Gigabyte GTX 1070 G1 Gaming (7.93 GB VRAM) pool mining Ethereum.</p><h2>Steps</h2><p>Firstly we will have to one-time initialize /etc/X11/xorg.conf by using Nvidia's xconfig tool including a <a href=\"https://wiki.archlinux.org/index.php/NVIDIA/Tips_and_tricks#Enabling_overclocking\" rel=\"noopener noreferrer\" target=\"_blank\">cool-bits</a> value of 28.</p><pre class=\"ql-syntax\" spellcheck=\"false\">nvidia-xconfig --allow-empty-initial-configuration --enable-all-gpus --cool-bits=28\n</pre><p>Afterwards, we can start a Xorg server headlessly as Nvidia's setting tool requires it to be up.</p><pre class=\"ql-syntax\" spellcheck=\"false\">X :0 &amp; # display :0\n</pre><p>Since I am running multiple cards, I would require a loop to go through all of it. Currently these values works best for the cards I used.</p><ul><li>-200 core clock</li><li>+1200 memory clock</li></ul><pre class=\"ql-syntax\" spellcheck=\"false\"># export DISPLAY=:0\n# IFS=$'\\n'\n# for gpu in $(nvidia-smi -L); do\n    id=$(echo ${gpu} | sed -e 's/GPU //g' -e 's/:.*//g')\n    nvidia-settings -a [gpu:${id}]/GPUPowerMizerMode=1 -a [gpu:${id}]/GPUGraphicsClockOffset[3]=-200 -a [gpu:${id}]/GPUMemoryTransferRateOffset[3]=1200\ndone\n</pre><p>As a final step, I would apply a -40 max watts undervolt as root.</p><pre class=\"ql-syntax\" spellcheck=\"false\">nvidia-smi -pl 140\n</pre><p>Optionally, since we do not need the Xorg server to be running anymore, we can kill it</p><pre class=\"ql-syntax\" spellcheck=\"false\">killall Xorg\n</pre><p>These configuration alone increased ~5MH/s per card, resulting in a 25-30MH/s overall increase!</p><h2>Automated bash script</h2><pre class=\"ql-syntax\" spellcheck=\"false\">#!/usr/bin/env bash\nsudo nvidia-smi -pl 140\nsudo X :0 &amp;\nsleep 5\nexport DISPLAY=:0\nIFS=$'\\n'\nfor gpu in $(nvidia-smi -L); do\n    id=$(echo ${gpu} | sed -e 's/GPU //g' -e 's/:.*//g')\n    sudo nvidia-settings -a [gpu:${id}]/GPUPowerMizerMode=1 -a [gpu:${id}]/GPUGraphicsClockOffset[3]=-200 -a [gpu:${id}]/GPUMemoryTransferRateOffset[3]=1200\ndone\nsudo killall Xorg\nsudo systemctl start ethminer # or your own command to start your own miner\n</pre>","content_text":"SETUP\n\nlspci | grep VGA\n  01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  02:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  03:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  04:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  06:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n  07:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)\n\n\n6x Gigabyte GTX 1070 G1 Gaming (7.93 GB VRAM) pool mining Ethereum.\n\n\nSTEPS\n\nFirstly we will have to one-time initialize /etc/X11/xorg.conf by using Nvidia's\nxconfig tool including a cool-bits value of 28.\n\nnvidia-xconfig --allow-empty-initial-configuration --enable-all-gpus --cool-bits=28\n\n\nAfterwards, we can start a Xorg server headlessly as Nvidia's setting tool\nrequires it to be up.\n\nX :0 & # display :0\n\n\nSince I am running multiple cards, I would require a loop to go through all of\nit. Currently these values works best for the cards I used.\n\n * -200 core clock\n * +1200 memory clock\n\n# export DISPLAY=:0\n# IFS=$'\\n'\n# for gpu in $(nvidia-smi -L); do\n    id=$(echo ${gpu} | sed -e 's/GPU //g' -e 's/:.*//g')\n    nvidia-settings -a [gpu:${id}]/GPUPowerMizerMode=1 -a [gpu:${id}]/GPUGraphicsClockOffset[3]=-200 -a [gpu:${id}]/GPUMemoryTransferRateOffset[3]=1200\ndone\n\n\nAs a final step, I would apply a -40 max watts undervolt as root.\n\nnvidia-smi -pl 140\n\n\nOptionally, since we do not need the Xorg server to be running anymore, we can\nkill it\n\nkillall Xorg\n\n\nThese configuration alone increased ~5MH/s per card, resulting in a 25-30MH/s\noverall increase!\n\n\nAUTOMATED BASH SCRIPT\n\n#!/usr/bin/env bash\nsudo nvidia-smi -pl 140\nsudo X :0 &\nsleep 5\nexport DISPLAY=:0\nIFS=$'\\n'\nfor gpu in $(nvidia-smi -L); do\n    id=$(echo ${gpu} | sed -e 's/GPU //g' -e 's/:.*//g')\n    sudo nvidia-settings -a [gpu:${id}]/GPUPowerMizerMode=1 -a [gpu:${id}]/GPUGraphicsClockOffset[3]=-200 -a [gpu:${id}]/GPUMemoryTransferRateOffset[3]=1200\ndone\nsudo killall Xorg\nsudo systemctl start ethminer # or your own command to start your own miner\n","date_published":"2024-04-06T16:14:44.971Z","_microfeed":{"web_url":"https://kb-jarylchng-com.pages.dev/i/linux-overclocking-multiple-headless-nvidia-gpu-lp-s3OrdZuR/","json_url":"https://kb-jarylchng-com.pages.dev/i/lp-s3OrdZuR/json/","rss_url":"https://kb-jarylchng-com.pages.dev/i/lp-s3OrdZuR/rss/","guid":"lp-s3OrdZuR","status":"published","itunes:episodeType":"full","date_published_short":"Sat Apr 06 2024","date_published_ms":1712420084971}}],"_microfeed":{"microfeed_version":"0.1.2","base_url":"https://kb-jarylchng-com.pages.dev","categories":[{"name":"Technology"}],"subscribe_methods":[{"name":"RSS","type":"rss","url":"https://kb-jarylchng-com.pages.dev/rss/","image":"https://kb-jarylchng-com.pages.dev/assets/brands/subscribe/rss.png","enabled":true,"editable":false,"id":"sQbXXExV58H"},{"name":"JSON","type":"json","url":"https://kb-jarylchng-com.pages.dev/json/","image":"https://kb-jarylchng-com.pages.dev/assets/brands/subscribe/json.png","enabled":true,"editable":false,"id":"nC8cjLCnOOi"}],"description_text":"Welcome to the index page of my knowledge base, if you haven't done so, do visit\nmy website at https://jarylchng.com.\n\nI will mainly use this site to document stuff, most of which will likely be in\nthe public domain.","copyright":"©2024","itunes:type":"episodic","items_sort_order":"newest_first"}}