How to configure Nvidia GPU only for computation/mining and Intel integrated GPU for video output on Ubuntu 16.04

in mining •  7 years ago  (edited)

nvidia+intel.jpg

the goal is:

in a system equipped with an nvidia gpu card and an intel cpu with intel integrated gpu, use the nvidia card for gpu computing/mining purpose keeping the ability to use the pc for the daily tasks without loosing gui performance. Who use gpu for computation (ex: boinc) or cryptocurrencies mining know that during this gpu-stress tasks the system becomes unresponsive also if the cpu is in idle. This situation forces to manually start/stop the tasks and results in reducing the earnings/computing performance.

prerequisites:

this guide is done using a system like the following, so maybe should work for other similar systems, of course everything you do following this guide is at your own risk:

  • cpu intel skylake
  • motherboard with h170 chipset, capable to activate intel gpu also when a pcie gpu is installed
  • ubuntu 16.04 with stock 4.4 linux kernel
  • nvidia pascal gpu card
  • installed last nvidia driver (384) from official ubuntu ppa
step by step instructions:

starting from a regular system that use the nvidia card for display, I was able to realize my goal doing this:

– on bios I enabled intel gpu, set it as primary gpu and I also set gpu memory at maximum avaible (1GB)

– saved bios settings, shutdown pc, then I disconnected the dvi cable from nvidia card and put in the motherboard port

– powered on system, booted ubuntu normally

– at this point nvidia driver should automatically enabled the prime into nvidia mode, wich means that everything should work like before, and the nvidia card will do rendering also if the dvi cable is plugged into motherboard

– open nvida settings and choose Intel power saving mode, then reboot

. at this point we are really using the intel integrated gpu with the linux xorg kernel driver (wich is the only one avaible), but the nvidia card without some workaround is now totally unavaible also for any computation task like cuda

– so (I don’t know if it is really needed or not) I installed nvidia-modprobe with sudo apt install nvidia-modprobe and then reboot

– after doing so, to get the nvidia work with the needed applications, we need to:

– open a terminal and launch: export LD_LIBRARY_PATH=/usr/lib/nvidia-384

– launch then, always in the same terminal, the miner/task that needs nvidia

in my case this workaround works perfectly for mining purposes (I used Claymore miner and EWBF zcash miner); I am now able to mine without having performance issues while using my pc for other tasks like web browsing, photo retouching I can also do gaming if using gaming or emulators like PCSX2 where the intel gpu is supported. The above workaround works also for nvidia-smi ; I use this tool to monitor the temperature and fan of my nvidia card.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!