Skip to content
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

How to specify gpu #2628

Open
wzr0108 opened this issue Aug 12, 2024 · 4 comments
Open

How to specify gpu #2628

wzr0108 opened this issue Aug 12, 2024 · 4 comments

Comments

@wzr0108
Copy link

wzr0108 commented Aug 12, 2024

face_analysis_model_path = "pretrained_models/face_analysis"
face_analysis = FaceAnalysis(
    name="",
    root=face_analysis_model_path,
    providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
)
face_analysis.prepare(ctx_id=2, det_size=(640, 640))

gpu0 is used regardless of ctx_id setting

@ZubairKhan001
Copy link

face_analysis = FaceAnalysis(
name="",
root=face_analysis_model_path,
providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
provider_options=[{"device_id": device_id])

@wzr0108
Copy link
Author

wzr0108 commented Aug 15, 2024

device_id=5

face_analysis_model_path = "pretrained_models/face_analysis"
face_analysis = FaceAnalysis(
    name="",
    root=face_analysis_model_path,
    providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
    provider_options=[{"device_id": device_id}]
)
face_analysis.prepare(ctx_id=device_id, det_size=(640, 640))

still using gpu0

@ZubairKhan001
Copy link

when the model is loaded what is the value assigned to device id, 0 or 5?

@wzr0108
Copy link
Author

wzr0108 commented Aug 16, 2024

i set device_id=5, but the model is loaded into gpu0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants