carlrobertoh / CodeGPT

The leading open-source AI copilot for JetBrains. Connect to any model in any environment, and customize your coding experience in any way you like.
https://codegpt.ee
Apache License 2.0
1.01k stars 213 forks source link

Add a CUDA_VISIBLE_DEVICES option or a option to restrict the number of GPUs #549

Closed mpperez3 closed 4 months ago

mpperez3 commented 4 months ago

Describe the need of your request

Currently, the project does not provide a way to limit the number of GPUs or control the GPU resources allocated to the application. This can lead to inefficient resource utilization, especially in environments with multiple GPUs. It can also be problematic in shared environments where multiple programs or processes need to share GPU resources without interference.

Proposed solution

Introduce a configuration option to set the CUDA_VISIBLE_DEVICES environment variable within the application. This will allow users to specify which GPUs should be visible and utilized by the application, thereby controlling the maximum GPU usage. The option can be set through a configuration variable.

Additional context

Implementing this feature will enhance resource management, particularly in multi-GPU setups. It will provide users with greater control over their GPU resources, improving the efficiency and flexibility of the application. This is especially useful for scenarios involving varying task requirements