Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

random sample generation #9

Merged
merged 2 commits into from Jan 19, 2018
Merged

Conversation

mr-lubo
Copy link
Contributor

@mr-lubo mr-lubo commented Jan 12, 2018

I'm trying to figure out how I can multithread the loading of these houses, since the metadata (JSON) processing in house.py is taking the most amount of time when trying to iterate through a lot of houses. I was trying this code out (apologies for being a bit messy, but you can start looking @ L139 of test-samples.py). When I run this code, though, it results in a segfault as soon as I start trying to render images (L149). Do you have any idea what I could try to fix this issue?

@ppwwyyxx
Copy link
Contributor

An OpenGL context can only be used in the same thread. Try objrender.RenderAPIThread. It forwards all the calls to a dedicated thread.

@mr-lubo
Copy link
Contributor Author

mr-lubo commented Jan 12, 2018

Ah, thanks!

@mr-lubo
Copy link
Contributor Author

mr-lubo commented Jan 12, 2018

Updated... seems like there might be some kind of memory leak or something else - I'm getting this error when I run this latest code:

python(61445,0x70000ee7d000) malloc: *** error for object 0x7fe709b6c558: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Still looking into it, but it doesn't seem like it's in the python code... not sure whether you have any pointers on debugging!

@ppwwyyxx
Copy link
Contributor

Although this never caused issues to us, we probably need to do copy=True in Environment.render(). Could you try if this fixes the problem?

@mr-lubo
Copy link
Contributor Author

mr-lubo commented Jan 13, 2018

Tried that out (see code), but still getting the same error!

@ppwwyyxx
Copy link
Contributor

I found that you're using the same API instance in different threads concurrently. This is not allowed. If different threads render different houses, it's better to create one API for each thread.

@mr-lubo
Copy link
Contributor Author

mr-lubo commented Jan 15, 2018

Okay! Updated. It seems to be working just fine now. Thanks a lot for the help!

@mr-lubo mr-lubo changed the title [in progress] random sample generation random sample generation Jan 15, 2018
@mr-lubo
Copy link
Contributor Author

mr-lubo commented Jan 15, 2018

Also, I will probably send 2 other pull requests:

  1. Having the setTarget(...) and other pre-processing be optional (it's wasting quite a bit of time for pre-processing some things that might not end up being useful in certain scenarios)
  2. Refactoring the code for sampling the valid locations in a room to get rid of redundant computations in subsequent calls

@ppwwyyxx
Copy link
Contributor

Cool and thanks a lot! Indeed there are some waste of time at initialization that's specific to our tasks but not useful in general. cc @jxwuyi

@ppwwyyxx ppwwyyxx merged commit 846f8fe into facebookresearch:master Jan 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants