Docker使用久了,会残留很多中间生成的镜像,占用磁盘空间。
要清理Docker镜像,本来是挺简单的,一条命令就搞定了:
| def add_profiling_markers(model): | |
| """Monkey-patch profiling markers into an nn.Module. | |
| Args: | |
| model: an nn.Module | |
| Effect: | |
| all model.named_module() forward calls get wrapped in their | |
| own profiling scope, making traces easier to understand. | |
| """ |
| # This isn't supposed to run as a bash script, i named it with ".sh" for syntax highlighting. | |
| # https://developer.nvidia.com/nsight-systems | |
| # https://docs.nvidia.com/nsight-systems/profiling/index.html | |
| # My preferred nsys (command line executable used to create profiles) commands | |
| # | |
| # In your script, write | |
| # torch.cuda.nvtx.range_push("region name") | |
| # ... |
The following error message may be encountered when building CUDA code with CMake:
error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary
It is caused by generated glue code not being linked in. The glue code is generated into files named with the project and a suffix:
myprojectname.device-link.obj
Ensure CUDA is enabled as a language for the project:
| #!/usr/bin/env python | |
| import os | |
| import re | |
| import subprocess | |
| import socket | |
| import sys | |
| def pids_of_jid(jid): | |
| result = subprocess.run(["sstat", "-p", "--format=PID", "-j", jid, "--noheader"], stdout=subprocess.PIPE) |
| import json | |
| import os | |
| import plugin_api | |
| # | |
| def IsUsefulInput(viewtype): | |
| return viewtype == "CBV" or viewtype == "IBV" or viewtype == "VBV" or viewtype == "SRV" | |
| def DumpBufferByDrawcall(folder, call, res, id, texture): | |
| if not os.path.exists(folder): |
| commit 6fac225de0575b18550f9421196f90a2279c44af | |
| Author: Tiago Koji Castro Shibata <[email protected]> | |
| Date: Fri Dec 28 23:13:14 2018 -0200 | |
| Fix compilation with latest OpenCV | |
| C APIs were removed and must be replaced with C++ calls | |
| diff --git a/Makefile b/Makefile | |
| index 63e15e6..c148d4b 100644 |
| #pip install pafy | |
| #sudo pip install --upgrade youtube_dl | |
| import cv2, pafy | |
| url = "https://www.youtube.com/watch______" | |
| video = pafy.new(url) | |
| best = video.getbest(preftype="webm") | |
| #documentation: https://pypi.org/project/pafy/ | |
| capture = cv2.VideoCapture(best.url) |