Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: Of Slipstreams and Sensor Ghosts (09/24/21)

Author Topic: VRAM Usage Estimator 1.10.0  (Read 4302 times)

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
VRAM Usage Estimator 1.10.0
« on: September 16, 2020, 02:24:40 PM »




Are you curious how much VRAM each mod uses?
Well, look no further! This helpful thread by Dark.Revenant already has VRAM calculations for many mods: https://fractalsoftworks.com/forum/index.php?topic=8726.0

What's VRAM? How much do I need? What if I don't have enough?
Again, go check out Dark.Revenant's thread! https://fractalsoftworks.com/forum/index.php?topic=8726.0


Not all of my mods/versions are in that thread and/or I'm too lazy to add everything up!
Well, then, I have a tool for you. Based on a Python script by Dark.Revenant, converted to Kotlin, and modified...presenting the creatively-named VRAM Counter for Windows, Linux, and it might even work on MacOS, too!


Download

Source Code

What it does
- Gives mod-by-mod estimates of VRAM usage.
- Gives a total VRAM usage of all mods, plus a total including the vanilla game (this is the amount of VRAM your GPU needs to exceed)
- Additionally lets you see VRAM estimation with different GraphicsLib map options toggled; normal, material, and surface maps. Open up "config.properties" to configure.

What it does not do
- Tell you how much VRAM your computer has We do that now
- Tell you if you are exceeding what your PC can handle (just load the game and find out...) We do this too
- Promise to be exact. This is an estimate. For exact usage, run the game and compare before & after VRAM usage.

Usage
Unzip the folder into your mods folder, just like you were installing any other mod. Then open the folder and double-click on VRAM-Counter.bat.
On Linux/MacOS, try running "java -jar ./VRAM-Counter.jar" and see how that goes.



How do I check how much VRAM I have on Windows 10?
Spoiler
[close]

I'm a modder and I have a bunch of unused images in my mods that this tool is counting!
If you want, you can add "CURRENTLY_UNUSED" or "DO_NOT_USE" to your image file name and the tool will ignore it. MesoTroniK specifically requested this feature.

How's it work?
Image VRAM use =
Code
((numOfChannels * bitsPerChannel) / bitsPerByte) * widthRoundedUpToNearestPowerOfTwo * heightRoundedUpToNearestPowerOfTwo * multiplier
Multiplier = 1x for background images and 1.33x for other images. The 1.33x is extra memory used for mipmapping.

Backgrounds are ignored if they are the same size as vanilla's backgrounds (because vanilla always has one background loaded, so a vanilla-sized background is not adding more VRAM use).
If the mod has one or more backgrounds that are larger than a vanilla background, then the largest of them is counted as additional VRAM used (additionalVRAMUse = modBackgroundVRAMUse - vanillaBackgroundVRAMUse).

What was that window that flashed and then went away when I ran the tool? Was that coronavirus?
Spoiler
The tool is open source, so folks with the know-how can check out what is going on.
That window that appeared briefly is an OpenGL window, which I'm using to detect the computer's maximum VRAM and other GPU specs. No information leaves your machine.
[close]


Changelog
Spoiler
1.10.0
- Support for Starsector 0.9.5a mod_info.json format.
- Backwards compatible with 0.91a format.

1.9.0
- GPU information, including dedicated VRAM if Nvidia, is now displayed. Credit to LazyWizard for most of the code (taken from Console Commands).

1.8.0
- Sort mods by their VRAM impact in descending order.
- Show total at bottom of each detailed breakdown.
- Slight text cleanup.
- Fixed the detailed breakdown not getting added to the file output.
- Added section to Readme about finding your GPU's VRAM.

1.7.0
- Mod totals are now included in text ouput file

1.6.0
- Prompt for GraphicsLib settings on each run.

1.5.0
- Make it clearer what it and isn't counted when user only copy/pastes a single line from the output.
- Add all enabled mods to the summary view.
- Copy the summary to the clipboard so it may be easily pasted into chat.

1.4.0
- Total estimated use no longer counts images with the same relative path and name multiple times.
  - So if Mods A and B both have /graphics/image.png, both will have the size counted in the per-mod display, but it will be only counted once in the total.

1.3.0
- Now prints out estimated usage of *enabled mods*, in addition to all found mods.
- For readability, only the currently chosen GraphicsLib settings (in 'config.properties') are shown.
- Fixed the # images count incorrectly counting all files.
- Now shows mod name, version, and id instead of mod folder name.
[close]

« Last Edit: May 07, 2021, 11:10:56 AM by Wispborne »
Logged

Draco

  • Ensign
  • *
  • Posts: 20
    • View Profile
    • Email
Re: VRAM Usage Estimator
« Reply #1 on: September 16, 2020, 09:23:23 PM »

Good work
Logged

Chairman Suryasari

  • Captain
  • ****
  • Posts: 364
  • The Deployer of John Lennon's.
    • View Profile
Re: VRAM Usage Estimator
« Reply #2 on: September 17, 2020, 08:11:40 AM »

Thanks for your hardwork! Really appreciate it!  ;D
Logged
"Kids under 13 shouldn't have access to the internet. if 10yo me were on tumblr and read about suicide and depression 5 hours a day, every day, god knows i would jump off a bridge if my parents ever yell at me."

-Some random Youtube comment on video about Sonic OC.

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
Re: VRAM Usage Estimator 1.3.0
« Reply #3 on: September 20, 2020, 06:45:11 PM »

1.3.0

- Now prints out estimated usage of *enabled mods*, in addition to all found mods.
- For readability, only the currently chosen GraphicsLib settings (in 'config.properties') are shown.
- Fixed the # images count incorrectly counting all files.
- Now shows mod name, version, and id instead of mod folder name.

https://github.com/davidwhitman/VRAM_Calculator/releases/tag/1.3.0
Logged

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
Re: VRAM Usage Estimator 1.4.0
« Reply #4 on: September 21, 2020, 04:48:49 PM »

1.4.0
- Total estimated use no longer counts images with the same relative path and name multiple times.
  - So if Mods A and B both have /graphics/image.png, both will have the size counted in the per-mod display, but it will be only counted once in the total.
Logged

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
Re: VRAM Usage Estimator 1.5.0
« Reply #5 on: October 10, 2020, 02:40:12 PM »

1.5.0
- Make it clearer what it and isn't counted when user only copy/pastes a single line from the output.
- Add all enabled mods to the summary view.
- Copy the summary to the clipboard so it may be easily pasted into chat.
Logged

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
Re: VRAM Usage Estimator 1.6.0
« Reply #6 on: November 22, 2020, 06:26:26 PM »

1.6.0
- Prompt for GraphicsLib settings on each run.

I suspect that many users did not realize that the default was to assume GraphicsLib was fully enabled, which meant that this tool over greatly overestimate VRAM usage if GraphicsLib was disabled.
If GraphicsLib is not enabled at the mod level, the user is not prompted.
Logged

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
Re: VRAM Usage Estimator 1.7.0
« Reply #7 on: January 18, 2021, 08:26:15 PM »

1.7.0
- Mod totals are now included in text ouput file
Logged

Nalesh

  • Ensign
  • *
  • Posts: 11
    • View Profile
    • Email
Re: VRAM Usage Estimator 1.7.0
« Reply #8 on: January 19, 2021, 07:20:58 AM »

Would really love if the list was ordered heaviest to lightest.
Logged

PyroFuzz

  • Commander
  • ***
  • Posts: 110
    • View Profile
    • Email
Re: VRAM Usage Estimator 1.7.0
« Reply #9 on: January 19, 2021, 08:42:44 AM »

Excellent! I have been looking for something like this for some time now. I'm glad you made this.
Logged
Hello!

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
Re: VRAM Usage Estimator 1.7.0
« Reply #10 on: January 19, 2021, 09:39:14 AM »

Would really love if the list was ordered heaviest to lightest.

1.8.0
- Sort mods by their VRAM impact in descending order.
- Show total at bottom of each detailed breakdown.
- Slight text cleanup.
- Fixed the detailed breakdown not getting added to the file output.
- Added section to Readme about finding your GPU's VRAM.
Logged

Wispborne

  • Commander
  • ***
  • Posts: 182
  • Discord: Wisp#0302
    • View Profile
Re: VRAM Usage Estimator 1.10.0
« Reply #11 on: April 05, 2021, 09:25:19 AM »

1.10.0
- Support for Starsector 0.9.5a mod_info.json format.
- Backwards compatible with 0.91a format.

If you run 1.9.0 on Starsector 0.9.5a, it will ignore mods that use the new mod_info.json format, but will work fine otherwise.
If you run 1.10.0 on Starsector 0.91a, it will support all mods.
Logged