{"record":{"id":"4666cac5f00a32b4","repo":"zed-industries/zed","slug":"failed-to-get-agsinitialize-address","errorCode":null,"errorMessage":"Failed to get agsInitialize address","messagePattern":"Failed to get agsInitialize address","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/src/directx_renderer.rs","lineNumber":1909,"sourceCode":"\n    use crate::with_dll_library;\n\n    // https://github.com/NVIDIA/nvapi/blob/7cb76fce2f52de818b3da497af646af1ec16ce27/nvapi_lite_common.h#L180\n    const NVAPI_SHORT_STRING_MAX: usize = 64;\n\n    // https://github.com/NVIDIA/nvapi/blob/7cb76fce2f52de818b3da497af646af1ec16ce27/nvapi_lite_common.h#L235\n    #[allow(non_camel_case_types)]\n    type NvAPI_ShortString = [c_char; NVAPI_SHORT_STRING_MAX];\n\n    // https://github.com/NVIDIA/nvapi/blob/7cb76fce2f52de818b3da497af646af1ec16ce27/nvapi_lite_common.h#L447\n    #[allow(non_camel_case_types)]\n    type NvAPI_SYS_GetDriverAndBranchVersion_t = unsafe extern \"C\" fn(\n        driver_version: *mut c_uint,\n        build_branch_string: *mut NvAPI_ShortString,\n    ) -> c_int;\n\n    pub(super) fn get_driver_version() -> Result<String> {\n        #[cfg(target_pointer_width = \"64\")]\n        let nvidia_dll_name = s!(\"nvapi64.dll\");\n        #[cfg(target_pointer_width = \"32\")]\n        let nvidia_dll_name = s!(\"nvapi.dll\");\n\n        with_dll_library(nvidia_dll_name, |nvidia_dll| unsafe {\n            let nvapi_query_addr = GetProcAddress(nvidia_dll, s!(\"nvapi_QueryInterface\"))\n                .ok_or_else(|| anyhow::anyhow!(\"Failed to get nvapi_QueryInterface address\"))?;\n            let nvapi_query: extern \"C\" fn(u32) -> *mut () = std::mem::transmute(nvapi_query_addr);\n\n            // https://github.com/NVIDIA/nvapi/blob/7cb76fce2f52de818b3da497af646af1ec16ce27/nvapi_interface.h#L41\n            let nvapi_get_driver_version_ptr = nvapi_query(0x2926aaad);\n            if nvapi_get_driver_version_ptr.is_null() {\n                anyhow::bail!(\"Failed to get NVIDIA driver version function pointer\");\n            }\n            let nvapi_get_driver_version: NvAPI_SYS_GetDriverAndBranchVersion_t =\n                std::mem::transmute(nvapi_get_driver_version_ptr);\n\n            let mut driver_version: c_uint = 0;","sourceCodeStart":1891,"sourceCodeEnd":1927,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/gpui_windows/src/directx_renderer.rs#L1891-L1927","documentation":"Raised in `get_driver_version` when GetProcAddress for `agsInitialize` on amd_ags_x64.dll (or x86) returns null: the AMD AGS DLL was found/loaded but does not export the expected symbol, usually meaning an incompatible or truncated amd_ags DLL version is on the path. Only affects reporting AMD driver versions.","triggerScenarios":"Thrown at crates/gpui_windows/src/directx_renderer.rs:1909 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as non-fatal: return an unknown/empty driver version string instead of failing rendering.","Verify the bundled amd_ags_x64.dll version matches the AGS SDK headers used.","Check the DLL architecture matches the process (x64 vs x86).","Log the DLL path to detect a conflicting copy being loaded from PATH."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}