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.0What'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.0Not 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.
UsageUnzip 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?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 =
((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.
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.