Updated 28-11-2010: Patch now includes support for 32-bit and 64-bit binaries.
When I read about nVidia’s Endless City demo, it appeared that it would only run on nVidia hardware. I found that a bit strange, as it is using only DirectX 11 tessellation, and as such shouldn’t be requiring nVidia hardware specifically.
When you try to run it on other hardware, you get this messagebox:
Cuda-enabled GPU? That piqued my interest, so I decided to poke around the code a bit, and see what it would be using Cuda for. After a quick look through the code, it seemed that while it did initialize Cuda, it didn’t appear to actually do anything with it. I decided to disable the initialization code, and see if it still worked, to make sure I didn’t overlook anything. And indeed, everything seemed to run just fine. My guess is that nVidia just used a stock graphics demo framework, and Cuda is always enabled by default. They just didn’t bother to take it out.
Anyway, if it doesn’t require Cuda (and I didn’t spot any other nVidia-specific things either), then it should be able to run on any DirectX 11 hardware. However, as I checked the code to see what could trigger the above messagebox, I also spotted a specific “nvidia” vendor string check. I decided to disable this as well.
Now it should work on any DirectX 11 hardware. I have prepared the following zip file for everyone to run the Endless City on their hardware: http://bohemiq.scali.eu.org/PatchEndlessCity.zip
I’ll explain what it is and what it does exactly. I have created a dummy NvCuda.dll, because that was the easiest way to make the demo run on systems without the actual DLL. It simply exists to stop Windows from complaining about a missing file, and doesn’t actually contain any code. You can put it anywhere in your path, but I would suggest placing it in the folder where the demo binares are installed (probably something like “C:\Program Files\NVIDIA Corporation\NVIDIA Demos\Endless City\bin”). Pick the NvCuda.dll from the x86 folder in the zip file if you want to run the 32-bit version, and pick NvCuda.dll from the x64 folder if you want to run the 64-bit version (since they have the same file name, they obviously cannot both be in the same folder at the same time. Normally the 32-bit version is installed in \Windows\SysWow64, and the 64-bit version is installed in the \Windows\System32 directory, in which case Windows will automatically handle the search order correctly).
The file PatchEndlessCity.exe should also be copied to the folder in which the demo binaries are installed. When you execute it (you might need to run it as administrator, because it needs to write to the EndlessCity.exe and EndlessCity64.exe files in Program Files), it will remove the above-mentioned vendor-check code. After you have run this patch, EndlessCity.exe and EndlessCity64.exe should work on any DirectX 11 hardware. If you have problems running the patch, make sure you have the Visual C++ 2010 redistributable for x86 installed.
For those who want to know the exact details of the patch:
Offsets 0x000C3A1E through 0x000C3A29 in EndlessCity.exe are overwritten with nop instructions (0x90) to disable the respective code. Likewise, in EndlessCity64.exe, offsets 0x000EE705 through 0x000EE71F are overwritten with nop (0x90). So if you don’t trust the patch, you could perform the patch manually with a hex editor.
I’d love to hear what framerates people will get on their Radeons. And it will be especially interesting to test this demo on the upcoming Radeon 6900 series, to see how much AMD managed to improve their tessellation.