Skip to content
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

Empty buffers, "detected target change, someone else is screwing with our functions" #2

Open
dominikandreas opened this issue May 6, 2017 · 30 comments

Comments

@dominikandreas
Copy link

Hi,

for some reason I'm not able to get the depth and stencil buffers. I'm not sure if this is connected, but the log often shows the message "detected target change, someone else is screwing with our functions".
The returned buffer size by the exported functions is often -1 and if it isn't, the buffer is just filled with 0s (except for the color buffer, that usually works fine).

Could you explain what the error message means and what the reason of this may be?

Thanks!

@rmalav15
Copy link

rmalav15 commented Jun 5, 2017

Did you get any solution? I am planning to use this code for image sequence and depth map sequence extraction. Please let me know.

@dominikandreas
Copy link
Author

It actually seems to work for me now, but I'm not sure what actually caused the problem. Make sure that there's nothing else accessing the DirectX buffers or window information, no steam overlay or borderless gaming, remote desktop or anything alike. I run it in window mode with 800x600 resolution.

It would be nice if the authors could comment on this though. This work could be really helpful for other researchers if one would just know how to use it correctly. I also don't know yet how to display the buffers correctly

@rmalav15
Copy link

rmalav15 commented Jun 5, 2017

Thanks for the quick reply :)
I will update you if I am able to do display thing smoothly.

@muaz-git
Copy link

Thank you @dominikandreas for helping me building this project.
So I tried to run it and here is my asiloader.log, ScriptHookV.log and GTANativePlugin.log.
In my GTANativePlugin.log and in my case it always outputs detected target change, someone else is screwing with our functions no matter what. Previously, I was using DeepGTA, so I tried removing all components related to it as well but still GTANativePlugin.log outputs the same. I also tried to run the game in windowed mode with 800x600, but it didn't help either.
Then I tried look in to the file GTAVisionExport-master/native/src/main.cpp and it seems like there is a function hook_function(...) which is generating this error under the code if(targets<offset, T> != nullptr && targets<offset, T> != *vtbl), I have no clue what this is.
Also when I try to hit L key, as OnKeyboardMessage function in main.cpp is handling this, game crashes with just one empty file depth.raw.
I would really appreciate if any of you could help me in using this project.

@muaz-git
Copy link

Can anyone please help me in running this repository by answering my above question. Thank you.

@rmalav15
Copy link

rmalav15 commented Jun 24, 2017

Hi @muaz-git,

I wanted to collect RGBD dataset using this repo. Since I found two very great virtual dataset available online, I left this idea.
I suggest you take a look at these dataset
https://robotvault.bitbucket.io/scenenet-rgbd.html Indoor
http://www.sira.diei.unipg.it/supplementary/ral2016/extra.html outdoor

If you still want to use this repo, then I suggest personally mail the authors for providing the documentation.

Sorry I cant help you more.

@barcharcraz
Copy link
Contributor

Hello! I'm the author of this code. The messages in the log are simply warnings that your graphics drivers are messing with Direct3d's vtables.

Can you upload a crashdump (or minidump). To do this simply set the registry values detailed here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx

@barcharcraz
Copy link
Contributor

Also: targets is a tempate variable where I store pointers to the original functions. This comparison checks if the vtable has been modified. Us replacing the functions does not modify the vtable because we modify the beginning of the function itself.

Also can you send over some system information. Espicially what graphics card and drivers you have installed.

@barcharcraz
Copy link
Contributor

I suspect that you aare running into the depth format issues that we've seen on some hardware. Nvidia cards tend to have the depth in a 64bit format (32F depth and 8UI stencil, with 24 unused). I suspect that this is a driver optimization. I have a modified version of the code working on intel cards (with a more standard 24D8S format), but I'd like to know if you are having similar problems. A full dump would actually be great, but bandwidth is a thing and a full dump will be quite large.

@muaz-git
Copy link

Thank you @rmalav15 and @barcharcraz for your replies. I tried to generate both mini and full dumps. Normally, when I run the game it keeps generating the same log detected target change, someone else is screwing with our functions and game works fine, but when I hit L, game crashes and generates the dump files.

Here is my PC specs. I am trying to understand these dumps, but it seems like I am not able to understand them easily, it would be great if you could help me out. Thank you.

@barcharcraz
Copy link
Contributor

that log message is just letting you know that your driver is indeed modifying the virtual tables. It should not break anything. I'll take a look at those dumps and get back to you

@IanKirwan
Copy link
Contributor

IanKirwan commented Aug 3, 2017

@i manage to get color.raw, stencil.raw and depth.raw files out upon pressing 'L' but when I view them with Photoshop they look like an old UHF TV with the antenna unplugged. I'm guessing something is wrong. Any pointers?

@muaz-git
Copy link

muaz-git commented Aug 3, 2017

@IanKirwan did you receive any errors mentioned above before or did this repo. worked for out of the box?

@IanKirwan
Copy link
Contributor

IanKirwan commented Aug 3, 2017 via email

@muaz-git
Copy link

muaz-git commented Aug 3, 2017

@IanKirwan, thank you for your detailed response. And yes it would be great if you could please post those steps in detail, for me and for others who plan to use this repo in future.

@barcharcraz
Copy link
Contributor

barcharcraz commented Aug 3, 2017 via email

@IanKirwan
Copy link
Contributor

IanKirwan commented Aug 4, 2017

muaz-git These were my build steps
moved this into the documentation issue thread

@barcharcraz
Copy link
Contributor

barcharcraz commented Aug 4, 2017 via email

@IanKirwan
Copy link
Contributor

Would be happy to if I knew how. I'm a bit of a git virgin. Feel free to copy it and do it otherwise. I'll have a go at creating a pull request in the mean time.

@IanKirwan
Copy link
Contributor

OK, have created a pull request (I think) with new file GTAVisionExport/native/README.md for the build steps. I think it's in your hands from here?

@IanKirwan
Copy link
Contributor

IanKirwan commented Aug 4, 2017

@barcharcraz I have changed my Eigen3 from 3.3.4 to 3.3.1 as you specified if conan.txt and, though I don't know if it's related, it looks like my raw files might contain something useful now (though still barely intelligible to the eye). What do I need to process these files (create training data, annotations etc)? Does the managed code do this? I see some bounding box stuff in the code so I'm inclined to think so but c# is not my langauge.

@IanKirwan
Copy link
Contributor

@barcharcraz Hopefully you will have noticed the pull request. I can't merge it as i don't have sufficient permissions so it's in your hands.

Cheers
Ian

@muaz-git
Copy link

@barcharcraz yes I tried it. The issue persist unfortunately.

@barcharcraz
Copy link
Contributor

I merged said pull request.

Can you try using a debug build of the library? Hopefully that will make the error easier to see (or fix it which is always annoying)...

@dominikandreas
Copy link
Author

dominikandreas commented Aug 31, 2017

I found some time to debug why the buffers are not extracted using recent Nvidia cards (10xx series in my case). The reason is that apparently desc.Width and desc.Height are often as low as 128 in clear_depth_stencil_view_hook. Therefore the function never extracts the buffer. Could you elaborate why this could be the case and what this means?

By the way the library works fine on my Surface Book with dedicated GPU (something like a GTX 960m I believe, a customized version by Microsoft and the drivers may be different)

Another note: Buffer extraction works if I just disable the size checks of desc.Width and desc.Height. Looking at the buffers and comparing them to the ones I've obtained on the Surface Book, I notice that the size of depth and stencil buffers has been reduced (width, height are now half of what they were).

@Cuky88
Copy link

Cuky88 commented Oct 4, 2017

Did someone solve this issue?
I got the same problem on Win 10 with Nvidia GTX 960m. Is it enough to disable the size check?

@dominikandreas
Copy link
Author

The message "detected target change..." itself is not an issue, but expected behavior as I understand. If something doesn't work for you, place some logs in the code to see where it fails. It may well be the size check, so you could try disabling that and see if it helps.

@Cuky88
Copy link

Cuky88 commented Oct 4, 2017

Ok, my question wasn't exact! The game crashes as soon as I press "L" and creates an empty depth.raw file. @muaz-git could you solve the issue with the crash?

@Cuky88
Copy link

Cuky88 commented Oct 4, 2017

Update:
Crash can be easily fixed by changing if (desc.Format == DXGI_FORMAT_B8G8R8A8_UNORM && desc.Width > 1000 && desc.Height > 1000) in main.cpp to something lower then your current resolution, e.g. desc.Width > 600 && desc.Height > 600. All 3 files will be generated.

@muaz-git
Copy link

muaz-git commented Oct 4, 2017

@Cuky88 as far as I understood, Width and Height should match the resolution of game. So if you're running the game in 800x600 then default code (here and here) fails and returns -1. So either change the game resolution to have at least 1000 in both width and height. Or simply change the code. And prefer to run managed repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants