-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cuda: limit gpu memory #280
Comments
Note:
If you want to share GPUs, set it between 0 and 1. (But of course, you don't know how much memory is available on the target, so fixed ratios are problematic. I recommend making this configurable at runtime, perhaps via envvars.) |
Also: limiting CPU-side RSS would be useful. We could do this from the outside (on the (This came up in OCR-D/quiver-benchmarks#22.) Unfortunately, there is no way to set the amount of shared GPU memory from the outside. So all our processors must be programmed in a cooperative way. |
(I wouldn't be surprised if I'm wrong about |
Indeed. For non-interactive bash, one can pass There may also be a middle ground in setting limits for all containers in the Docker daemon config. |
I'm not up-to-date: How are the containers run currently? Is it recommended that users do the ocrd_all's Dockerfile looks like there's nothing we could use. https://docs.python.org/3.9/library/resource.html looks promising, maybe we could use it in core, but I'm not sure if I understood it properly. |
Yes, it's still basically whatever the user comes up with. (We wrap them in Docker Compose services of another docker stage, but other usres still run CLIs, some of them after converting to Singularity.) But that's rapidly changing with the service containers which @joschrew is implementing. There we could simply add specs to the (generated) Docker Compose file, maybe after reading some .env variables.
Indeed, that's yet another route we could go! |
From tensorflow docs: »...to configure a virtual GPU device with
tf.config.set_logical_device_configuration
and set a hard limit on the total memory to allocate on the GPU.«Found in eynollah.py:
#gpu_options = tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=7.7, allow_growth=True)
Could the gpu be utilized better with gpu memory limit?
Y = memory usage in MB. Logarithmic scale. min = 10 MB. Sampled in 3 s intervals with
nvidia-smi
.red = sbb-binarize, blue = eynollah-segment, green = calamari-recognize (no gpu)
The text was updated successfully, but these errors were encountered: