gpu: make texture pool block size configurable #1966

Closed
tharun-37 wants to merge 1 commit from upstream-pr/1966 into main
tharun-37 commented 2026-11-29 04:36:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tharun-37 on 2026-11-29T04:36:18Z.


Addresses part of #1576 (pool block size configurability).

Adds \VICTORY_POOL_BLOCK_MB\ environment variable (16, 32, 64, 128, 256 MiB) to configure the texture pool block size. Default remains 64 MiB. The block size is read once at startup and cached.

The 64 MiB default works well for larger VRAM cards, but on 8 GB cards it causes internal fragmentation (hundreds of MiB to >2 GiB trapped in partially-filled 64 MiB heaps). Users can now set \VICTORY_POOL_BLOCK_MB=16\ or \32\ to reduce fragmentation on smaller VRAM cards.

Tests use \TEST_BLOCK\ constant (64 MiB) and \set_test_block_size()\ helper to ensure deterministic test behavior regardless of environment.

Validation: \cargo test -p victory-gpu --locked\ (589 tests pass); \cargo check --workspace --locked; \cargo xtask policy\ (pre-existing lower.rs size violation unrelated to this change).

AI-assisted (OpenCode).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5547589595 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1966). Originally posted by [tharun-37](https://github.com/tharun-37) on 2026-11-29T04:36:18Z. --- Addresses part of #1576 (pool block size configurability). Adds \VICTORY_POOL_BLOCK_MB\ environment variable (16, 32, 64, 128, 256 MiB) to configure the texture pool block size. Default remains 64 MiB. The block size is read once at startup and cached. The 64 MiB default works well for larger VRAM cards, but on 8 GB cards it causes internal fragmentation (hundreds of MiB to >2 GiB trapped in partially-filled 64 MiB heaps). Users can now set \VICTORY_POOL_BLOCK_MB=16\ or \32\ to reduce fragmentation on smaller VRAM cards. Tests use \TEST_BLOCK\ constant (64 MiB) and \set_test_block_size()\ helper to ensure deterministic test behavior regardless of environment. Validation: \cargo test -p victory-gpu --locked\ (589 tests pass); \cargo check --workspace --locked\; \cargo xtask policy\ (pre-existing lower.rs size violation unrelated to this change). AI-assisted (OpenCode).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!1966
No description provided.