Models Can't Fix Everything
This video describes how the creator used an AI model to debug a high GPU utilization issue in their software. Instead of relying on the AI to solve the problem directly, the creator leveraged it to build a custom tool. This tool allowed for rapid experimentation and testing of different theories by enabling quick changes and observations, ultimately leading to the identification of a tiny, useless animation as the culprit.
read more
The speaker encountered a problem in their application where GPU utilization was excessively high, even when the app was in an idle or 'ultrathink' state. Initially, the goal was to have the AI model solve the problem directly. However, the speaker soon realized that the AI was not going to directly pinpoint or fix the issue. This led to a shift in mindset: instead of asking the AI for the solution, the speaker began to think about how the AI could be used as a debugging assistant to efficiently test various theories.
The core request to the AI was to create a mechanism for quickly testing changes in a production environment, ideally using simple console commands, to observe immediate differences. The AI responded by generating a JavaScript function that could be bound to the `window` object, specifically `window.__t3gpu.destroy()`. This function, when executed in the browser's developer console, would apply a set of CSS rules designed to disable potential GPU-intensive elements.
The generated CSS rules targeted several areas: `body::after`: `display: none !important;` - This was intended to remove any pseudo-elements that might be causing rendering overhead. `.chat-composer-shared-blur`: `none !important;` and `webkit-backdrop-filter: none !important; backdrop-filter: none !important;` - These rules specifically aimed at disabling blur effects, which are often GPU-intensive, particularly those related to chat components. `animations`: `, ::before, ::after { animation: none !important; transition: none !important; }` - This broad rule was designed to turn off all animations and transitions across the entire application, as animations are a common source of GPU load.
This custom tool, created with the AI's assistance, allowed the speaker to quickly toggle these GPU-intensive features on and off without needing to redeploy code or restart the application. By iteratively applying and reverting these changes through the console, the speaker could observe the immediate impact on GPU usage. This rapid experimentation workflow was crucial in narrowing down the potential causes of the high GPU utilization. The speaker noted that the AI was proficient at finding relevant code sections faster and building custom tools to test theories, while the human developer was still responsible for interpreting the results and formulating the underlying theories to be tested.