shocker-0x15 / gfxexp Goto Github PK
View Code? Open in Web Editor NEWSandbox for graphics paper implementation
License: Other
Sandbox for graphics paper implementation
License: Other
Is it possible to pass Texture objects to CUDA kernels
or are only Buffers (typed and untyped) supported?
For the neural radiance caching example, the paths of the mesh and texture are required in the No.808 line of "neural_radiance_caching_main.cpp" with function "parseCommandline(argc, argv);". However, I failed several times in giving the file path by command line parameters.
Can you give an example of the command line parameters? like "-inst /ZeroDay_v1/MEASURE_ONE/MEASURE_ONE.fbx"
What does DynamicFunction class do? Is it an equivalent to a function pointer on a device?
I am interested in using this abstraction (function pointer) for one of my projects.
Is there a simple example of how it's used in a kernel?
Thanks!
I'm getting some NaN in optix_pathtracing_kernels.cu line 201
RGB colorResult = (1 - curWeight) * prevColorResult + curWeight * contribution;
I add these lines after line 201 to color the NaN pixels super red
RGB colorResult = (1 - curWeight) * prevColorResult + curWeight * contribution;
if (isnan(colorResult.r) || isnan(colorResult.g) || isnan(colorResult.b))
{
printf("contribution: %f, %f, %f\n", contribution.r, contribution.g, contribution.b);
colorResult = RGB(make_float3(1000000.0f, 0.0f, 0.0f)); // super red
}
And here is the output after rendering for a few minutes. Do you know what the problem might be? It is still so hard to debug OptiX. It seems it gets harder and harder with each new release.
Howdy,
Thanks for making these interesting experiments available! Will you be making a license file for this project?
I think I found a bug in createGeometryInstance() starting on line 1599 of common_host.cpp where the aabb is being created.
for (int triIdx = 0; triIdx < triangles.size(); ++triIdx) {
const shared::Triangle &tri = triangles[triIdx];
const shared::Vertex (&vs)[3] = {
vertices[tri.index0],
vertices[tri.index1],
vertices[tri.index2],
};
geomInst->aabb
.unify(vertices[0].position)
.unify(vertices[1].position)
.unify(vertices[2].position);
}
I think the correct code should be:
geomInst->aabb
.unify(vs[0].position)
.unify(vs[1].position)
.unify(vs[2].position)
LIne 2922 of basic_types.h
passed in array size is too small. Should be 16
CUDA_COMMON_FUNCTION CUDA_INLINE constexpr Matrix4x4_T(const F array[9]) :
m00(array[0]), m10(array[1]), m20(array[2]), m30(array[3]),
m01(array[4]), m11(array[5]), m21(array[6]), m31(array[7]),
m02(array[8]), m12(array[9]), m22(array[10]), m32(array[11]),
m03(array[12]), m13(array[13]), m23(array[14]), m33(array[15]) { }
Hi there,
I just built the TFDM sample you've showcased on Twitter: https://twitter.com/Shocker_0x15/status/1725546495423001032?s=20
And for some reason my render time is a lot slower compared to yours. I have tested both RTX 4090 and RTX 3090, with 180ms and 250ms render times, respectively.
NVIDIA Driver: 546.17
RTX 4090 & 3090 GPUs
Windows 11 23H2
Visual Studio Community 17.7.6
OptiX 8.0.0
CUDA 12.3.1 toolkit
Thanks for sharing this excellent work.
Hi,
I'm getting a consistent crash in all scenes I try using the path_tracing project in Debug mode only. Release mode works fine. The error message that appears using Nsight->CUDA Debugging is [Error 700: Illegal address during kernel execution].
And the debugger usually stops at this line
CUDA_DEVICE_KERNEL void RT_CH_NAME(pathTraceBaseline)() {
pathTrace_closestHit_generic();
}
OptiX 7.40 / CUDA 11.7
Driver: 516.59
Visual Studio 2022 17.2.4
Windows 10
RTX 2070 SUPER
Can you confirm this using your environment? I wonder if it has anything to do with this thread.
https://forums.developer.nvidia.com/t/illegal-address-error-when-using-both-geometrytriangles-and-geometry-nodes/218956/18
The VS solution compiles just fine, but when I run neural_radiance_cache.exe with the correct parameters, I get the following error:
Error: CUDA call (cuGraphicsGLRegisterImage(&m_cudaGfxResource, glTexID, GL_TEXTURE_2D, flags) ) failed with error: 'OS call failed or operation not supported on this OS' (...\GfxExp\utils\cuda_util.cpp:677)
As a note, the program is able to identify my RTX 3060 card.
Hi,
GfxExp/restir/optix_kernels.cu
Line 868 in ec95e56
GfxExp/restir/optix_kernels.cu
Line 1403 in ec95e56
Here I am hovering a pixel for which the primary hit is an emitter with values (1.0, 1.0, 1.0) as you can see in the debug info. I think the pixel in that case should also have value (1.0, 1.0 ,1.0) unless I understand wrong.
My project allows user to interactively change HDR environment image so I need to initialize and finalize the
RegularConstantContinuousDistribution2D envLightImportanceMap each time a new environment hdr is selected. Currently the finalize() functions do not reset the m_isInitialized flag to false, so I hit this assert when I try to initialize the envLightImportanceMap a second time.
// Assert that we're not already initialized
Assert (!m_isInitialized, "Already initialized!");
Thanks for your implementation of this algorithm!
Beginner's question: I am trying to understand the training part of the NRC algorithm.
I have read the paper several times and it's still not clear to me.
Say, you have a path x0 x1 x2 (x0 - camera, x1 - surface, x2 - surface). How do you train the cache?
Hi there, thank you so much for your great work!
I have a question when looking into the implementation of NRC, specifically, the immediate prediction of NRC network obtained via the "directly visualized prediction" option seems to result in a much darker rendering compared to the path tracing/path tracing + NRC. For example, below is the result of path tracing + NRC:
While according to the figure 4 of the original paper, visualizing NRC output at first vertex would give frequency artifacts in early frames (seems to be resolved with hash grid encoding tho), but the overall brightness should be the same:
When looking into the details of the implementation, I realized that the path tracing + NRC result is obtained by summing the direct light sampling through the next event estimation with the predicted radiance of NRC. However, the training target of NRC seems to already include both (direct contribution + indirect contribution from next NRC output). I'm quite confused by this, because if my understanding is correct, then it would be unnecessary to sum direct light sampling contribution to the rendering again and the NRC output should be much brighter. May I ask if you could provide any insight on this? Any comments would be much appreciated!
Many thanks.
Hi,
When using a scene such as lost-empire I get the following error : Error: CUDA call (cuArray3DCreate(&m_array, &arrayDesc) ) failed with error: 'out of memory' (C:\Users\X\Documents\Shocker\GfxExp\utils\cuda_util.cpp:693)
. I think what is happening is that for every material in the mtl file the map_Ka and map_Kd attributes are loaded into memory even if those same textures have been loaded into memory already for another material. This is confirmed by the console output:
[ 4][ DISK CACHE]: Opened database: "C:\Users\X\AppData\Local\NVIDIA\OptixCache\optix7cache.db"
[ 4][ DISK CACHE]: Cache data size: "1.8 MiB"
[ 4][ DISKCACHE]: Cache hit for key: ptx-538030-keyf4770f7ee17acca7955c0792d6c5b076-sm_61-rtc0-drv496.76
[ 4][COMPILE FEEDBACK]:
[ 4][ DISKCACHE]: Cache hit for key: ptx-40534-keyf6edc5a05105d08ef92e4c8cff25c7c6-sm_61-rtc0-drv496.76
[ 4][COMPILE FEEDBACK]:
[ 4][COMPILE FEEDBACK]: Info: Pipeline has 1 module(s), 35 entry function(s), 32 trace call(s), 0 continuation callable call(s), 54 direct callable call(s), 707 basic block(s) in entry functions, 19309 instruction(s) in entry functions, 0 non-entry function(s), 0 basic block(s) in non-entry functions, 0 instruction(s) in non-entry functions
Reading: ../scenes/lost-empire/lost_empire.obj ... done.
DefaultMaterial:
Stone:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Grass_Block:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Dirt:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Cobblestone:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Oak_Planks:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Stationary_Water:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Stationary_Lava:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Sand:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Gravel:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Iron_Ore:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Coal_Ore:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Oak_Log:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Oak_Leaves:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Bed:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Powered_Rail:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Detector_Rail:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Sticky_Piston:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Wool:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Dandelion:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Poppy:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Brown_Mushroom:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Double_Stone_Slab:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Stone_Slab:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Obsidian:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Torch:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... done.
Oak_Stairs:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Chest:
Reading: ../scenes/lost-empire/lost_empire-RGB.png ... done.
Redstone_Wire:
Reading: ../scenes/lost-empire/lost_empire-RGBA.png ... Error: CUDA call (cuArray3DCreate(&m_array, &arrayDesc) ) failed with error: 'out of memory' (C:\Users\X\Documents\Shocker\GfxExp\utils\cuda_util.cpp:693)
As you can see the same textures are loaded over and over.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.