| import os, re | |
| def clean_gpu(): | |
| ret = os.popen("fuser -v /dev/nvidia*").read() | |
| ret = re.sub("kernel", " ", ret) | |
| ids = set(ret.split(" ")) | |
| ids = [int(i) for i in ids if i != ''] | |
| ids = [str(i) for i in sorted(ids)] | |
| ids_string = ' '.join(ids) | |
| cmd = f"kill -9 {ids_string}" | |
| os.system("fuser -v /dev/nvidia*") | |
| flag = input(f"You are going run this command: \n ==> \"{cmd}\" \nEnter y/Y to proceed, or other to abort.\n[y/n]") | |
| if flag.lower() == 'y': | |
| os.system(cmd) | |
| print("All gpu process cleaned!") | |
| else: | |
| print("Aborted!") | |
| if __name__ == '__main__': | |
| clean_gpu() |
Xet Storage Details
- Size:
- 630 Bytes
- Xet hash:
- ba91b948f0211252ee7e2bb6db8e9401172a6fc2becbe80588f843fef27e6b7d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.