DisplayInformation returns 0 / (Re-)Implement DisplayInformation for all supported platforms

Bug #1662961 reported by Kam
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Undecided
Unassigned

Bug Description

I'm compiling Panda in MSVC 2015 64bit, Windows 7 64, Python 3.6.

The getter-Methods in panda3d.core.DisplayInformation() return Zero values on my System, e. g. '0', '-1' or empty String "".

Code example:

import panda3d.core
di = panda3d.core.DisplayInformation()
print(di.getAvailablePageFileSize())
print(di.getAvailablePhysicalMemory())
print(di.getCpuBrandString())
print(di.getDriverDateYear())
print(di.getNumLogicalCpus())
print(di.getOsVersionMajor())

The DisplayInformation() class needs to be revised for all supported platforms, probably.

description: updated
Revision history for this message
rdb (rdb) wrote :

Is this also an issue when you set "auto-cpu-data true" in Config.prc?

Revision history for this message
Kam (kamg-deactivatedaccount) wrote :

I had to change the code to this:

import panda3d.core

base = ShowBase(windowType='none')

base.makeDefaultPipe()
di = base.pipe.getDisplayInformation()

print(di.getAvailablePageFileSize())
print(di.getAvailablePhysicalMemory())
print(di.getCpuBrandString())
print(di.getDriverDateYear())
print(di.getNumLogicalCpus())
print(di.getOsVersionMajor())

That would print the correct 'OsVersionMajor'.

Setting 'auto-cpu-data true' in Config.prc gives me the correct 'CpuBrandString' and 'NumLogicalCpus'.

.getAvailablePageFileSize() and .getAvailablePhysicalMemory() are still 0, same for the graphics device values.

Revision history for this message
rdb (rdb) wrote :

OK, as expected. CPUID is currently only implemented on Windows, though, so we still need to implement it on other systems.

As for other info, much of it is requested via Direct3D currently, and it needs to be explicitly requested via "request-dxdisplay-information true". However, this is very slow, so it is strongly advised against.

Revision history for this message
Kam (kamg-deactivatedaccount) wrote :

Is it really necessary to get these information via the graphics pipe (I mean the system and CPU information), or would it make sense to refactor the code to be independent of it? I would have expected to get the CPU and system information by simply initializing DisplayInformation(), without going over base.pipe.getDisplayInformation(). However, if this is by design, I think the documentation needs an update, it doesn't mention it and the limits.

Revision history for this message
rdb (rdb) wrote :

Yes, it's a bit odd that it's defined there. This should probably be in PandaSystem (or ExecutionEnvironment).

Revision history for this message
rdb (rdb) wrote :

The cpuid stuff as well as memory limits are now implemented for all platforms. Some platforms provide a bit more information, some a bit less.

Changed in panda3d:
status: New → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.