compile with : g++ watchNV.cpp -o watchNV
Code :
#include <stdlib.h>
#include <math.h>
#include <iostream>
int main(int argc , char* argv[])
{
std::cout << "watch system START" << std::endl;
system("gnome-terminal --geometry='85x25+0+8000' -e 'watch -n 1 nvidia-smi' ");
system("gnome-terminal --geometry='85x25+0+0' -e 'htop' ");
std::cout << "watch system OVER" << std::endl;
return 0;
}