2019-12-14 22:06 CET

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0005611Spring engineGeneralpublic2017-06-11 18:17
Reporterabma 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version103.0 +git 
Target Version104.0Fixed in Version103.0 +git 
Summary0005611: wrong vram reported
DescriptionGR::LogVersionInfo]
    SDL version : 2.0.5 (linked) / 2.0.5 (compiled)
    GL version : 3.0 Mesa 13.0.6
    GL vendor : X.Org
    GL renderer : Gallium 0.4 on AMD JUNIPER (DRM 2.48.0 / 4.9.0-3-amd64, LLVM 3.9.1)
    GLSL version: 1.30
    GLEW version: 2.0.0
    GPU memory : 2045MB (total) / 1009MB (available)
    SwapInterval: 1
    
    ARB shader support : 1
    GLSL shader support : 1
    FBO extension support : 1
    NPOT-texture support : 1
    24-bit Z-buffer support : 1
    primitive-restart support: 1
    clip-control support : 1
    
    max. FBO samples : 8
    max. texture size : 16384
    max. vec4 varyings/attributes: 32/16
    max. draw-buffers : 8
    max. rec. indices/vertices : 3000/3000
    max. uniform buffer-bindings : 72
    max. uniform block-size : 64KB
    
    enable ATI-hacks : 0
    compress MIP-maps: 0

vs glxinfo:

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: AMD JUNIPER (DRM 2.48.0 / 4.9.0-3-amd64, LLVM 3.9.1) (0x68be)
    Version: 13.0.6
    Accelerated: yes
    Video memory: 1024MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
Additional Informationthis card has only 1024MB and not "GPU memory : 2045MB (total)"
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
related to 0004733assignedjK remove include/* from spring repo 
+Relationships

-Notes

~0017811

abma (administrator)

relevant kernel log:

[ 4.392422] [drm] radeon kernel modesetting enabled.
[ 4.399532] CRAT table not found
[ 4.399534] Finished initializing topology ret=0
[ 4.399552] kfd kfd: Initialized module
[ 4.406189] [drm] initializing kernel modesetting (JUNIPER 0x1002:0x68BE 0x1787:0x2287 0x00).
[ 4.406209] [drm] register mmio base: 0xFEA20000
[ 4.406210] [drm] register mmio size: 131072
[ 4.406274] ATOM BIOS: JUNIPER
[ 4.406341] radeon 0000:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
[ 4.406343] radeon 0000:01:00.0: GTT: 1024M 0x0000000040000000 - 0x000000007FFFFFFF
[ 4.406347] [drm] Detected VRAM RAM=1024M, BAR=256M
[ 4.406347] [drm] RAM width 128bits DDR
[ 4.406420] [TTM] Zone kernel: Available graphics memory: 8192774 kiB
[ 4.406421] [TTM] Zone dma32: Available graphics memory: 2097152 kiB
[ 4.406422] [TTM] Initializing pool allocator
[ 4.406428] [TTM] Initializing DMA pool allocator
[ 4.406455] [drm] radeon: 1024M of VRAM memory ready
[ 4.406456] [drm] radeon: 1024M of GTT memory ready.
[ 4.406469] [drm] Loading JUNIPER Microcode
[ 4.407354] radeon 0000:01:00.0: firmware: direct-loading firmware radeon/JUNIPER_pfp.bin
[ 4.407927] radeon 0000:01:00.0: firmware: direct-loading firmware radeon/JUNIPER_me.bin
[ 4.407962] radeon 0000:01:00.0: firmware: direct-loading firmware radeon/JUNIPER_rlc.bin
[ 4.408562] radeon 0000:01:00.0: firmware: direct-loading firmware radeon/JUNIPER_smc.bin
[ 4.408568] [drm] Internal thermal controller with fan control
[ 4.408653] [drm] radeon: power management initialized
[ 4.410144] radeon 0000:01:00.0: firmware: direct-loading firmware radeon/CYPRESS_uvd.bin
[ 4.410349] [drm] GART: num cpu pages 262144, num gpu pages 262144
[ 4.412912] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
[ 4.422838] kvm: Nested Virtualization enabled
[ 4.422842] kvm: Nested Paging enabled
[ 4.423986] [drm] PCIE GART of 1024M enabled (table at 0x000000000014C000).
[ 4.424091] radeon 0000:01:00.0: WB enabled
[ 4.424094] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xffff8a0dd9378c00
[ 4.424096] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xffff8a0dd9378c0c
[ 4.424322] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x000000000005c418 and cpu addr 0xffff9ec1c2c1c418
[ 4.424325] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 4.424325] [drm] Driver supports precise vblank timestamp query.
[ 4.424326] radeon 0000:01:00.0: radeon: MSI limited to 32-bit
[ 4.424389] radeon 0000:01:00.0: radeon: using MSI.
[ 4.424407] [drm] radeon: irq initialized.

~0017812

Kloot (developer)

Last edited: 2017-06-10 13:52

View 2 revisions

find the glxinfo LOC where vram is retrieved, then compare it to https://github.com/spring/spring/blob/develop/rts/Rendering/GL/myGL.cpp#L143

~0017813

abma (administrator)

https://cgit.freedesktop.org/mesa/demos/tree/src/xdemos/glxinfo.c#n373

queryInteger(GLX_RENDERER_VIDEO_MEMORY_MESA, v);
printf(" Video memory: %dMB\n", *v);

~0017814

abma (administrator)

Last edited: 2017-06-10 14:25

View 2 revisions

it seems the values shown are from: GetVideoMemInfoNV()

when commenting out stuff GetVideoMemInfoATI() returns 6092/6092 and

GetVideoMemInfoMESA returns 0/0


i didn't fully investigate but it seems mesa doesn't return anything because when compiling spring the included header files are used:

spring header vs system header:
grep GLX_RENDERER_VIDEO_MEMORY_MESA /usr/include/GL/*.h include/GL/*.h
/usr/include/GL/glxew.h:#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187
/usr/include/GL/glxext.h:#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187

~0017815

Kloot (developer)

Last edited: 2017-06-10 14:49

View 2 revisions

1) the mesa driver should not also be implementing NV or ATI extensions and then returning garbage when those are called, I consider that beyond the engine's scope

2) using glGetInteger in GetVideoMemInfoMESA wasn't correct, that part works now (at least with up-to-date headers)

~0017816

abma (administrator)

on windows it looks like this:

Spring 103.0.1-1050-g53fbce0 develop

    SDL version : 2.0.4 (linked) / 2.0.4 (compiled)
    GL version : 3.0.13399 Compatibility Profile Context 15.200.1062.1004
    GL vendor : ATI Technologies Inc.
    GL renderer : AMD Radeon HD 5700 Series
    GLSL version: 4.40
    GLEW version: 1.5.8
    GPU memory : 9174MB (total) / 9174MB (available)
    SwapInterval: 0
    
    ARB shader support : 1
    GLSL shader support : 1
    FBO extension support : 1
    NPOT-texture support : 1
    24-bit Z-buffer support : 0
    primitive-restart support: 1
    clip-control support : 0
    
    max. FBO samples : -1
    max. texture size : 16384
    max. vec4 varyings/attributes: 32/29
    max. draw-buffers : 8
    max. rec. indices/vertices : 16777215/2147483647
    max. uniform buffer-bindings : 90
    max. uniform block-size : 64KB
    
    enable ATI-hacks : 1
    compress MIP-maps: 0


i'm not sure if the code to detect the gpu memory is correct ;-)

~0017817

Kloot (developer)

is that the output of GetVideoMemInfoATI, or does the ATI driver also fail and claim support for GLEW_NVX_gpu_memory_info?


if the former, what happens if you change

  for (uint32_t param: {GL_VBO_FREE_MEMORY_ATI, GL_TEXTURE_FREE_MEMORY_ATI, GL_RENDERBUFFER_FREE_MEMORY_ATI}) {

to just

  for (uint32_t param: {GL_TEXTURE_FREE_MEMORY_ATI}) {

?

~0017818

abma (administrator)

Last edited: 2017-06-10 17:13

View 2 revisions

thats the output of GetVideoMemInfoATI:

GPU memory : 3058MB (total) / 3058MB (available)

~0017819

Kloot (developer)

ATI/Windows is fixed after d2b28cc798185379695e4d3f808cffc52c259ce1.

Mesa/Linux should still be tested with modern headers.

~0017820

abma (administrator)

three things i had to change:

add include:
+#include <GL/glxew.h>
 

fix invalid type:

- qcriProcAddr(GLX_RENDERER_VIDEO_MEMORY_MESA, &memInfo[0]);
+ qcriProcAddr(GLX_RENDERER_VIDEO_MEMORY_MESA, (unsigned int*)memInfo);
 

and rename GrayScale due a conflict with xlib:
 
-void CBitmap::GrayScale()
+void CBitmap::ConvGrayScale()


then it reports correctly 1024MB. current used memory isn't reported as it seems there is no function for it.


can glxew.h be safely included?

~0017821

Kloot (developer)

more or less, the glx* stuff might not exist on distros that have switched from X to wayland (and ofc it doesn't on windows).

~0017830

Anonymous (viewer)

Fix 35fc58d4986d4379e5d7a73498560100b62ec47c committed to develop branch: fix 0005611, repo: spring changeset id: 8360
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2017-06-10 13:45 abma New Issue
2017-06-10 13:49 abma Note Added: 0017811
2017-06-10 13:52 Kloot Note Added: 0017812
2017-06-10 13:52 Kloot Note Edited: 0017812 View Revisions
2017-06-10 14:15 abma Note Added: 0017813
2017-06-10 14:25 abma Note Added: 0017814
2017-06-10 14:25 abma Note Edited: 0017814 View Revisions
2017-06-10 14:32 abma Relationship added related to 0004733
2017-06-10 14:46 Kloot Note Added: 0017815
2017-06-10 14:49 Kloot Note Edited: 0017815 View Revisions
2017-06-10 15:42 abma Note Added: 0017816
2017-06-10 15:52 Kloot Note Added: 0017817
2017-06-10 17:05 abma Note Added: 0017818
2017-06-10 17:13 abma Note Edited: 0017818 View Revisions
2017-06-10 17:13 Kloot Note Added: 0017819
2017-06-10 23:11 abma Note Added: 0017820
2017-06-11 00:17 Kloot Note Added: 0017821
2017-06-11 18:16 Changeset attached => spring develop 35fc58d4
2017-06-11 18:16 Anonymous Note Added: 0017830
2017-06-11 18:17 Kloot Assigned To => Kloot
2017-06-11 18:17 Kloot Status new => resolved
2017-06-11 18:17 Kloot Resolution open => fixed
2017-06-11 18:17 Kloot Fixed in Version => 103.0 +git
+Issue History