Bug 279355 - games/veloren-weekly: prevent out of memory panic
Summary: games/veloren-weekly: prevent out of memory panic
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-27 18:37 UTC by Sean Farley
Modified: 2024-05-30 03:26 UTC (History)
0 users

See Also:
jbeich: maintainer-feedback+
jbeich: merge-quarterly+


Attachments
Remove error about Queue::write_texture (1.18 KB, patch)
2024-05-27 18:37 UTC, Sean Farley
no flags Details | Diff
Remove error about Queue::write_texture (744 bytes, patch)
2024-05-27 21:07 UTC, Sean Farley
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Farley freebsd_committer freebsd_triage 2024-05-27 18:37:03 UTC
Created attachment 251021 [details]
Remove error about Queue::write_texture

For whatever reason, Veloren is panicking about running out of memory in the call to Queue::write_texture().  By removing the error, the game can run perfectly fine on my system.  I think it may be only with the NVIDIA driver as I have only seen mention of it with that driver on FreeBSD.

Bugs on Veloren's GitLab repo:
- https://gitlab.com/veloren/veloren/-/issues/1279#note_1272994785
- https://gitlab.com/veloren/veloren/-/issues/1975

My setup:

- FreeBSD 14
- NVIDIA driver v550.78
- NVIDIA GeForce RTX 4070
- veloren-weekly s20240523


Attaching a patch to the port that allows me to run it successfully.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2024-05-27 20:04:41 UTC
Comment on attachment 251021 [details]
Remove error about Queue::write_texture

Looks OK but can't test. Ideally, this should be reported to NVIDIA as Linux version of the proprietary driver seems to work fine.

Do you use nvidia-drm-kmod? According to https://download.nvidia.com/XFree86/Linux-x86_64/550.54.14/README/kms.html it affects some EGL/Vulkan extensions.

> +	${PATCH} ${PATCH_ARGS} \
> +		-d ${WRKDIR}/wgpu-0.18-with-fixes-for-veloren-v1 < \
> +		${FILESDIR}/extra-patch-wgpu

Instead of this prefix ---/+++ lines with ../ to patch a file in parent directory. See files/patch-keyboard-keynames for an example.

> +--- wgpu/src/backend/direct.rs.orig	2024-01-17 19:16:17.000000000 -0500
> ++++ wgpu/src/backend/direct.rs	2024-02-08 20:33:55.286862000 -0500

portlint will complain about non-makepatch format. I usually fix it manually: run "TZ=UTC diff -up <old> <new>", strip +++ timestamp and replace ".000000000 +0000" with " UTC"
Comment 2 Sean Farley freebsd_committer freebsd_triage 2024-05-27 21:05:26 UTC
(In reply to Jan Beich from comment #1)

I have no success with or without nvidia-drm-kmod.

Reporting to NVIDIA can be a bit difficult although they have responded to some stuff I asked in the past.  I want to see if the Veloren reacts first to see if it is something else other than a driver issue.  Right now, I am not sure what is wrong so cannot give NVIDIA more to debug.

That is good information to know about the patch generation.  I "cheated" and ran WRKSRC=/usr/ports/games/veloren-weekly/work/wgpu-0.18-with-fixes-for-veloren-v1 make makepatch to make sure I got the patch started right then modified it to use relative paths.  Updating attachment.
Comment 3 Sean Farley freebsd_committer freebsd_triage 2024-05-27 21:07:37 UTC
Created attachment 251029 [details]
Remove error about Queue::write_texture
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-05-30 00:15:46 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b0293949bef41db192a1c6395270037312248000

commit b0293949bef41db192a1c6395270037312248000
Author:     Sean Farley <scf@FreeBSD.org>
AuthorDate: 2024-05-27 18:37:03 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-05-30 00:13:45 +0000

    games/veloren-weekly: add workaround for x11/nvidia-driver

    ERROR veloren_voxygen::render::renderer: Validation Error

    Caused by:
    In Queue::write_texture
    Not enough memory left.

    PR:             279355

 games/veloren-weekly/Makefile                      |  1 +
 games/veloren-weekly/files/patch-wgpu-nvidia (new) | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-05-30 00:15:47 UTC
A commit in branch 2024Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=acc51499b8ee9cb411d30dfc9c67e689e55a9f10

commit acc51499b8ee9cb411d30dfc9c67e689e55a9f10
Author:     Sean Farley <scf@FreeBSD.org>
AuthorDate: 2024-05-27 18:37:03 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-05-30 00:15:11 +0000

    games/veloren-weekly: add workaround for x11/nvidia-driver

    ERROR veloren_voxygen::render::renderer: Validation Error

    Caused by:
    In Queue::write_texture
    Not enough memory left.

    PR:             279355
    (cherry picked from commit b0293949bef41db192a1c6395270037312248000)

 games/veloren-weekly/Makefile                      |  1 +
 games/veloren-weekly/files/patch-wgpu-nvidia (new) | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
Comment 6 Sean Farley freebsd_committer freebsd_triage 2024-05-30 03:26:50 UTC
Thanks!