-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decouple gfx-replay player from scene graph; integrate the batch renderer into it #1947
Decouple gfx-replay player from scene graph; integrate the batch renderer into it #1947
Conversation
0211bd6
to
692a3e6
Compare
1f85c05
to
6116a6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this is exactly how I wanted this to be. A bunch of minor comments.
0bfc210
to
1104cca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress! I left some comments.
I don't see any practical use for it there.
Pass --once to the app to repeat just once. Useful for benchmarking the renderer without the JSON parsing overhead, which is apparently significantly higher than all operations the renderer needs to do :D
dbc2668
to
57f74bd
Compare
bb7e787
to
be2e658
Compare
Because *imagine* how it would be if we could put comments next to the actual option we're adding. IMAGINE.
Not sure how important is to have this particular thing working there, so it's just an unreachable assert.
e85af83
to
a44a3a1
Compare
It was crashing because the python bindings for ReplayManager::readKeyframesFromFile() returned a Player but didn't tell Python the Player depends on the PlayerImplementation stored inside the ReplayManager. Which would involve some additional bookkeeping in the bindings, and ... everything else is using a shared_ptr anyway, so trying to avoid the unnecessary overhead in just a single place of all is like a drop in the ocean. Doesn't crash anymore with this change.
a44a3a1
to
a382d41
Compare
src/esp/sim/ReplayBatchRenderer.cpp
Outdated
environmentGridSize(cfg.numEnvironments)); | ||
if ((standalone_ = cfg.standalone)) | ||
renderer_.emplace<gfx_batch::RendererStandalone>( | ||
configuration, gfx_batch::RendererStandaloneConfiguration{}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can carry the GPU ID here:
renderer_.emplace<gfx_batch::RendererStandalone>(
configuration, gfx_batch::RendererStandaloneConfiguration{}
.setCudaDevice(cfg.gpuDeviceId));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll add this -- seems important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah well, the default ReplayRendererConfiguration::gpuDeviceId
is 0
, but 0
means the first CUDA device -- i.e., if you have no NV cards (or the NV card disconnected as in my case), it would fail to create the context.
The default should be -1
I think, i.e. picking whatever the primary GPU is, so it's not restricted to work only on NVidias. Can I change the default to -1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's right. -1
by default makes sense then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I want to go through the whole CI process again -- we want to merge ASAP -- could you add this in the followup PR? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default ReplayRendererConfiguration::gpuDeviceId
is 0
because the default SimulatorConfiguration::gpuDeviceId
is 0
. @0mdc , if you're making a change, consider making it in both places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments.
src/esp/sim/ReplayBatchRenderer.cpp
Outdated
environmentGridSize(cfg.numEnvironments)); | ||
if ((standalone_ = cfg.standalone)) | ||
renderer_.emplace<gfx_batch::RendererStandalone>( | ||
configuration, gfx_batch::RendererStandaloneConfiguration{}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default ReplayRendererConfiguration::gpuDeviceId
is 0
because the default SimulatorConfiguration::gpuDeviceId
is 0
. @0mdc , if you're making a change, consider making it in both places.
9c32b26
to
cadfa0f
Compare
22a5ba5
to
098e914
Compare
…ble. The comment stays there though, for historical records.
Motivation and Context
Decouples
gfx::replay::Player
fromSceneNode
in order to allow the batch renderer to be integrated, and integrates the batch renderer. Gradually taken over by @mosra.NodeHandle
type, which can be cast into eitherSceneNode*
or an index, depending on the implementation.gfx::replay::Player
implementation into a pure virtual interfaceAbstractReplayRenderer
class, moving the originalReplayBatchRenderer
to just aReplayRenderer
ReplayBatchRenderer
classreplayer
utility, to which you can pass a set of JSON replay files, which then get played back--classic
to it to switch to the classic one--profile
to print frame profiling info to the outputAbstractReplayRenderer
(which would be a no-op for the classic one), hooking that up into thereplayer
Showing batch renderer frame stats in the profiling outputpostponed, would require a change in Magnum'sFrameProfiler
The following shows running
with replay files taken from here (with the
.fixed.json
being patched to reference a real file instead of acubeSolid
placeholder) and composite files taken from this and this Slack thread:How Has This Been Tested
CI is not passing because the PR is done from a forked repo.I found a hack which makes it 🟢No idea what's up with the CI. It used to pass, now it fails on
AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'
again.