突突唧之家

我的疑问 & 我的解决方案

After installing the NVIDIA container runtime, you should install all necessary packages:

apt update
apt install ocl-icd-libopencl1 opencl-headers clinfo

Enable OpenCL by:

mkdir -p /etc/OpenCL/vendors
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

A system option was added in snap 2.28 to specify the proxy server.

sudo snap set system proxy.http="http://<proxy_addr>:<proxy_port>"
sudo snap set system proxy.https="http://<proxy_addr>:<proxy_port>"

Use os.popen():

output = os.popen('ls').read()

The newer way (> Python 2.6) to do this is to use subprocess:

output = subprocess.Popen('ls', stdout=subprocess.PIPE).stdout.read()

Multiplying the loss with 0.0 will create zero gradients. However, your model could still "change". For example, since running stats are updated in each forward pass in batchnorm layers during training (i.e. if the model is in model.train() mode). Also, the optimizer could still update parameters if its using running stats (e.g. Adam) and if the parameters were already updated (i.e. if the running stats are already set) even if the gradient is set to zero.

Here is the simplest solution:

ssh-keygen -R <host>

For example,

ssh-keygen -R 192.168.3.10

From the ssh-keygen man page:

-R hostname Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).

Docker stores downloaded images, running containers, and persistent volume data in a single shared directory root on your system drive. You can customize your configuration to use an external drive, network share, or second internal disc if you need to add storage to your installation.

Preparation

The main part of this guide applies to Docker Engine for Linux and Docker Desktop on Windows and Mac. You'll need to find your Docker daemon.json file on all three platforms. This will be in one of the following locations:

  • /etc/docker/daemon.json on Linux.
  • %programdata%\docker\config\daemon.json on Windows.
  • ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/etc/docker/daemon.json on Mac.

Docker advises that Windows and Mac users update the config file via the UI, instead of manually applying changes in a text editor. You can access the settings screen by heading to Preferences > Docker Engine > Edit file in the Docker Desktop interface.

阅读全文 »

If it's the first time you check-out a repo you need to use --init first:

git submodule update --init --recursive

For git 1.8.2 or above, the option --remote was added to support updating to latest tips of remote branches:

git submodule update --recursive --remote

This has the added benefit of respecting any "non default" branches specified in the .gitmodules or .git/config files (if you happen to have any, default is origin/master, in which case some of the other answers here would work as well).

Apart from nvidia-smi, on Linux you can check which processes might be using the GPU using the command

sudo fuser -v /dev/nvidia*

This will list processes that have NVIDIA GPU device nodes open.

I found a great tip in GitHub to compact a VHD file without Hyper-V tools and it works great. The Dynamic VHD don't reduce their size even if the files were deleted from the hard drive, to fix it the "compact" operation is needed. This is included into the Hyper-V tools but this is only available in Windows 10/11 Pro.

There are another way to do this in Windows 10/11 Home, using the next commands:

1
2
3
4
5
6
7
8
9
diskpart

# Open window Diskpart

select vdisk file="C:\path\to\file.vhd"
attach vdisk readonly
compact vdisk
detach vdisk
exit

Try this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{listings,xcolor}

\lstdefinestyle{mystyle}
{
language=[LaTeX]{TeX},
texcsstyle=*\color{blue},
basicstyle=\ttfamily,
moretexcs={mycommand}, % user command highlight
frame=single,
}
\begin{document}

\begin{lstlisting}[style=mystyle]
\documentclass{article}
\usepackage[T1]{fontenc}
\newcommand*{\mycommand}{Hello World!}
\begin{document}
\mycommand
\end{document}
\end{lstlisting}

\end{document}