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

Thumbnails generation on windows uses too much CPU #300

Closed
astandarduser opened this issue May 28, 2022 · 21 comments
Closed

Thumbnails generation on windows uses too much CPU #300

astandarduser opened this issue May 28, 2022 · 21 comments
Labels
type:bug Something isn't working
Milestone

Comments

@astandarduser
Copy link

Have just started using this software and it saves a whole lot of time finding things as an artist, just curious if there is a way to limit the CPU usage to around 70 percent when generating thumbnails?

@astandarduser astandarduser added the type:enhancement New feature or request label May 28, 2022
@mwestphal
Copy link
Contributor

Hi, are you using Windows or Linux ?

@astandarduser
Copy link
Author

I am using Windows, there are also 4 instances of it running, although I installed it about 15 minutes ago

@astandarduser
Copy link
Author

astandarduser commented May 28, 2022

So even without opening a new folder where it 100 percent CPU usage, it's still using a significant amount of the CPU 13% * 3 instances so 39% when doing nothing. Seems very power hungry when it shouldn't be doing much. It's also been an hour or so of leaving it be

@astandarduser
Copy link
Author

astandarduser commented May 28, 2022

Update: after a restart it seems to be acting more like it should where the CPU use goes way down after a folder has thumbnails generated. But as mentioned in the topic it would still be good to put a limit on cpu usage when generating the thumbnails for the first time even though it will make it slower

@mwestphal
Copy link
Contributor

Hum, did you open multiple file manager or only one ? Can you share a archive containing the file you were generating thumbnails from ?

I will try to reproduce.

Thanks,

@mwestphal mwestphal added type:bug Something isn't working and removed type:enhancement New feature or request labels May 28, 2022
@mwestphal
Copy link
Contributor

Sounds more like a bug to me.

@astandarduser
Copy link
Author

I think you could be right that I opened multiple explorer windows, now it generates them around 20 percent. I guess you can wipe this thread. Looking forward to further developments. Not sure if it's possible but would be amazing for maya ascii support , ztl, and 3dxml

@mwestphal
Copy link
Contributor

I think you could be right that I opened multiple explorer windows, now it generates them around 20 percent. I guess you can wipe this thread.

I still think there is an issue here, I remember seeing some slowdown sometimes, so identifying it more cleanly is nice, and at least maybe we can do something to avoid using too much CPU and slowing down windows.

Not sure if it's possible but would be amazing for maya ascii support , ztl, and 3dxml

There is a dedicated issue for new file formats, coul you comment on it ?
#38

Thanks !

@astandarduser
Copy link
Author

astandarduser commented May 28, 2022

Not sure how to vote on that but appreciate the link. And there are definitely bugs that need to be ironed out as it's currently using 20 percent CPU with no explorer windows open. Hope at some point they do as it's honestly going to save so much time when organizing and finding assets

@mwestphal
Copy link
Contributor

Not sure how to vote on that but appreciate the link

You can just comment on the issue and I will add them in my top comment.

@astandarduser
Copy link
Author

astandarduser commented May 30, 2022

Should add, the software started going crazy in terms of CPU usage opening up constant instances in folders with lots of nrrd and dicom files and didn't open them particularly well anyways. Is there a way to stop f3d from doing this as I already removed these formats from the config but it still does the same thing when opening that folder. Also I have set a different application to be the default for those file types

@astandarduser
Copy link
Author

My final thoughts on this, I tried another software called space-thumbnails which generated correct thumbs for everything including glb files which f3d doesn't support and it was much lighter on the system and had no cpu issues however it supports much fewer formats (needs fbx support) and is not a viewer. Will use it for thumbnails and f3d as a viewer for now until the cpu usage is ironed out. I'm not sure if looking at the code of that app will help but might be worth a look.

Keep up the amazing development, it's the fastest viewer I have found, also would be great to open two models at once and have them open in the same scene as some models are exported into parts, and some obj's do not open, or just show up as random tri's in a rough silhouette, but windows 3d viewer opens them fine just much slower. I'm happy to provide an example obj if needed but I assume you will have some that face this issue

@mwestphal
Copy link
Contributor

Thanks for the feedback.

including glb files which f3d doesn't support

F3D does support glb files though :)

I'm happy to provide an example obj if needed but I assume you will have some that face this issue

Please do, in another issue preferentially.

@astandarduser
Copy link
Author

Strange, glb's seem to not work completely for me. I will create a thread with 2 samples. And just so I'm not creating too many issue threads since it's still related to thumbnails, I installed space-thumbnails, and then f3d afterwards with the thumbnails option unchecked. However in every folder space-thumbnails didn't process f3d is generating thumbnails again

@Meakk
Copy link
Contributor

Meakk commented May 30, 2022

Here is an interesting part in space-thumbnails documentation: https://github.com/EYHN/space-thumbnails#speed

Rendering thumbnails for 3D models may not be that fast. To keep your explorer smooth and available, we have made some limits here, if the model file size is larger than 300MB or takes longer than 5 seconds to load and render, it will be cancelled and display this image below.

@mwestphal I think we should have something similar in F3D

EDIT: Related code is here https://github.com/EYHN/space-thumbnails/blob/3b74705f476f1ecb4a5b6e08193dff04de1cfdcb/crates/windows/src/providers/thumbnail.rs#L95

@astandarduser
Copy link
Author

astandarduser commented May 30, 2022

I do prefer f3d's thumbnails as space-thumbnails seems to pick up strange colours for my stl files, grey shaded is honestly better and more consistent/readable if all 3d files are like that. Although space-thumbnails did load some of my fairly large model files just fine without any high cpu usage

@mwestphal
Copy link
Contributor

@Meakk : Indeed, I think it was discussed but not implemented. Some investigation needed,

@mwestphal mwestphal changed the title Any way to limit the CPU when it's generating thumbnails Thumbnails generation on windows uses too much CPU May 30, 2022
@mwestphal
Copy link
Contributor

So a nice generic way to fix that would be to have a config file for thumbnail and to add a --max-size option in F3D. If size is bigger than max-size, just do not load it.

@mwestphal
Copy link
Contributor

Will be adressed by #401

@mwestphal
Copy link
Contributor

mwestphal commented Sep 25, 2022

@astandarduser: This has been addressed, file bigger than 100MiB will not get thumbnails, so the experience should be much smoother. If the 100 MiB is too conservative, you can modify it in the new thumbnail specific configuration file.

If you think this is too conservative for all users, let us know, we may consider increasing it in the config file directly if needed.

We will most likely not implement a "max-loading-time" option as it is a bit more complex to do cleanly, will use more CPU than max-size when triggered for a pretty similar result.

I can provide a binary if you want to be able to test before the next release.

I'm closing this, feel free to reopen if needed :)

@astandarduser
Copy link
Author

@astandarduser: This has been addressed, file bigger than 100MiB will not get thumbnails, so the experience should be much smoother. If the 100 MiB is too conservative, you can modify it in the new thumbnail specific configuration file.

If you think this is too conservative for all users, let us know, we may consider increasing it in the config file directly if needed.

We will most likely not implement a "max-loading-time" option as it is a bit more complex to do cleanly, will use more CPU than max-size when triggered for a pretty similar result.

I can provide a binary if you want to be able to test before the next release.

I'm closing this, feel free to reopen if needed :)

Awesome, looking forward to testing. And I'll wait for the release as I've been pretty busy lately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants