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
Can't hide GPUs to get_cuda_device_count() #1693
Comments
CUDA_VISIBLE_DEVICES should affect which GPU will be visible. If you have more than 2 GPUs, try export CUDA_VISIBLE_DEVICES=1 and run a script to see if GPU 1 is used as expected. |
I have one gpu only, and when I set CUDA_VISIBLE_DEVICES=""
the count is still 1.
Il Lun 13 Mag 2024, 17:51 Minh-Thuc ***@***.***> ha scritto:
… CUDA_VISIBLE_DEVICES should affect which GPU will be visible. If you have
more than 2 GPUs, try export CUDA_VISIBLE_DEVICES=1 and run a script to see
if GPU 1 is used as expected.
—
Reply to this email directly, view it on GitHub
<#1693 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7LDISRBLZNAZFGACHKIQLZCDOPNAVCNFSM6AAAAABHLYM5VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBYGA3TOMZQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I just tested it, if I set |
did you test on Windows?
Il Mar 14 Mag 2024, 11:14 Minh-Thuc ***@***.***> ha scritto:
… I just tested it, if I set CUDA_VISIBLE_DEVICES="" and get number of gpu
device with ctranslate2::get_gpu_count() , I got the correct value.
—
Reply to this email directly, view it on GitHub
<#1693 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7LDIS3U7DF375G3TSFJITZCHIXLAVCNFSM6AAAAABHLYM5VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBZGY4DQNRXGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I tested on Linux. Make sure you set correctly the environment variable. You can test directly with CUDA without using ct2 before. |
Hi,
thank you for this great project!
I'm running on Windows 11 and ctranslate2 v4.2.1. When running in a machine with gpus, even if I set CUDA_VISIBLE_DEVICES to the empty string, get_cuda_device_count() always returns the number of gpus in the machine.
Is this expected?
The text was updated successfully, but these errors were encountered: