简体   繁体   English

Theano for GPU内存不足错误

[英]Theano for GPU out of memory error

A few hours ago, I got the Theano+Keras GPU environment up and running successfully. 几个小时前,我启动并成功运行了Theano + Keras GPU环境。 I even tested some code to make sure that it was being executed on the GPU. 我什至测试了一些代码以确保它已在GPU上执行。 However, when I run import theano now, I get the following error: 但是,当我现在运行import theano ,出现以下错误:

ERROR (theano.gpuarray): Could not initialize pygpu, support disabled Traceback (most recent call last): . . . . GpuArrayException: cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory

I use a GPU on our university server and it is shared by many students in the lab. 我在我们的大学服务器上使用了一个GPU,实验室中许多学生都共享它。 Is the error possibly due to insufficient memory due to other running processes? 该错误是否可能是由于其他正在运行的进程而导致内存不足? The output of nvidia-smi is shown below. nvidia-smi的输出如下所示。 Process with PID 29586 is mine. PID 29586是我的过程。

+-----------------------------------------------------------------------------+ | NVIDIA-SMI 387.12 Driver Version: 387.12 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX TIT... Off | 00000000:01:00.0 On | N/A | | 48% 83C P2 196W / 250W | 12152MiB / 12198MiB | 99% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     10977      C   python                                      5506MiB |
|    0     24129      C   python                                      6323MiB |
|    0     25238      G   /usr/lib/xorg/Xorg                           110MiB |
|    0     25773      G   /usr/bin/gnome-shell                          90MiB |
|    0     29586      C   python                                       106MiB |
+-----------------------------------------------------------------------------+

The GPU is an Nvidia Titan X. I have googled this error extensively and have tried so many methods over the past few hours. GPU是Nvidia TitanX。在过去的几个小时中,我广泛搜索了此错误,并尝试了许多方法。 Please help. 请帮忙。

To keep it simple, yes, the card runs out of memory. 为简单起见,是的,该卡内存不足。 TITAN X has 12 GB of RAM and the first processes almost use all of it. TITAN X具有12 GB的RAM,第一个进程几乎使用了所有RAM。 Maybe ask the owner if they could stall their process or use a smaller batch size if they use it for Deep Learning. 也许会问所有者,如果他们将其用于深度学习,是否可以暂停进程或使用较小的批量大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM