GPUOpen-Tools / radeon_gpu_analyzer

The Radeon GPU Analyzer (RGA) is an offline compiler and code analysis tool for Vulkan, DirectX, OpenGL, and OpenCL.
MIT License
405 stars 53 forks source link

Temporary shader files can overlap each other #107

Closed TIMONz1535 closed 1 year ago

TIMONz1535 commented 1 year ago

I run a lot of RGA instances to generate all my shaders, however, if the log files have a timestamp that somehow guarantees uniqueness for each instance with the same pid

rga_cli7040-20230216-194032.log
rga_cli7040-20230216-194043.log

then the temporary DXIL files are created only using pid. So statistics may be collected for the wrong shader BUT I'm not sure.

dxil_rga-temp-out7040_vert.obj
dxil_rga-temp-out7040_pixel.obj

// used by rga_cli7040-20230216-194032.log with isa, livereg, stats for "object.0063"
// used by rga_cli7040-20230216-194043.log with isa, livereg, stats for "object.0024"

rga_cli7040-20230216-194032.log rga_cli7040-20230216-194043.log

Perhaps temporary DXIL files should also have a timestamp. At the moment I can compile DXIL shaders myself with unique filenames and specify the correct binary shaders in RGA.

p.s. It seems like this can't happen. But I get varying data in the statistics table. I will answer later

TIMONz1535 commented 1 year ago

okay I realized that described problem only occurs if I use a hidden parameter --retain so I don't need binary files. the statistics that are obtained at the output are always correct - because until one instance with some pid ends, another with the same pid will not start

I found an error in my code because due to the RGA crash I restarted it with incorrect shader "id". but I don't understand why because the crash happens randomly:

it seems to be related to the system issues, like #103 because on another computer it happens much less often and it is observed only after multiple launches

well, I just restart it and everything is fine. I don't think it's possible to catch it. so I'm closing this ticket