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

GPU usage #18

Closed
RobertoLando opened this issue Sep 14, 2023 · 2 comments
Closed

GPU usage #18

RobertoLando opened this issue Sep 14, 2023 · 2 comments

Comments

@RobertoLando
Copy link

I'm using a few generated scripts on an EC2 instance of type g4dn.xlarge, with Tesla T4 GPU

When running the workflow from the ComfyUI interface, I see traced in logs:
Device: cuda:0 Tesla T4 : cudaMallocAsync
while if I run the generated python script I see:
Device: cuda:0 Tesla T4 : native

The script produces similar result, but it's a lot slower. I tryied to add --cuda-malloc to the command line, but nothing changes. Any clue?

btw: great extension!

@RobertoLando
Copy link
Author

Found a solution: in the python script generated by this extension you need to add import cuda_malloc at the beginning (with some code to verify if it is supported) and move the import torch statement from the beginning to the first line after def main():

It would be useful to generate code already in this form

@min-star
Copy link

Found a solution: in the python script generated by this extension you need to add import cuda_malloc at the beginning (with some code to verify if it is supported) and move the import torch statement from the beginning to the first line after def main():

It would be useful to generate code already in this form

i add the code,but the cost time is same with not add

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