IronPDF 中的 GPU 流程問題:解決方案

This article was translated from English: Does it need improvement?
Translated
View the article in English
[0110/094441.173:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service.
[0110/094442.261:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=255
[0110/094442.261:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 3 time(s)
[0110/094442.261:FATAL:gpu_data_manager_impl_private.cc(440)] GPU process isn't usable. Goodbye.

如果您在使用 IronPDF 時遇到與上述類似的錯誤,尤其是在 Azure 上部署時,您並不孤單。 已知此錯誤會導致應用程式崩潰,通常與執行時間資料夾中的IronCefSubprocess.exe有關,它是 IronPDF 的關鍵元件。

可能的原因

導致此GPU進程錯誤的原因有很多。 以下是一些最常見的原因:

  1. IronCefSubprocess 缺少執行權限

    IronCefSubprocess.exe必須具有執行權限,IronPDF 才能正確初始化ChromePdfRenderer類別。

  2. Azure 部署步驟錯誤

    IronPDF 在 Azure 中 Linux 和 Windows 上的部署流程有所不同。 依照錯誤步驟操作可能會觸發此錯誤。

3.缺少 DLL 依賴項

IronCefSubprocess.exe需要某些 DLL 檔案才能正常運作。 缺少 DLL 文件,尤其是在非 Windows 環境下,可能會導致進程失敗。

解決方案

當地環境

如果您在本機遇到此錯誤,請嘗試以下步驟:

1.關閉 GPU 模式

若要停用 IronPDF 的 GPU 模式,請在程式碼中新增以下行:

   // Disables GPU mode to prevent issues with GPU process crashes
   IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
   // Disables GPU mode to prevent issues with GPU process crashes
   IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
$vbLabelText   $csharpLabel

2.授予執行權限

請確保IronCefSubprocess.exe具有執行權限。 對於 Linux 系統,請使用以下命令:

   # Grants execute permissions to IronCefSubprocess.exe
   chmod 755 IronCefSubprocess 
   # You may need to specify an exact path
   # IronCefSubprocess is typically found at bin/runtimes/linux-x64/
   # chmod 755 /bin/runtimes/linux-x64/native/IronCefSubprocess
   # In some cases you may need to use chmod 777 for broader permissions.
   # Grants execute permissions to IronCefSubprocess.exe
   chmod 755 IronCefSubprocess 
   # You may need to specify an exact path
   # IronCefSubprocess is typically found at bin/runtimes/linux-x64/
   # chmod 755 /bin/runtimes/linux-x64/native/IronCefSubprocess
   # In some cases you may need to use chmod 777 for broader permissions.
SHELL

3.檢查是否缺少 DLL 文件

如果以上步驟無法解決問題,請手動執行IronCefSubprocess.exe檢查是否缺少 DLL 檔案。 系統將顯示一個錯誤框,指出缺少的 DLL 檔案。 安裝所需的 DLL 檔案並重新執行應用程式。

Azure部署

如果將應用程式部署到 Azure 後發生錯誤,請依照下列步驟操作:

1.使用 ZipDeploy

使用 ZipDeploy 部署您的應用程序,以確保所有檔案都已正確打包。

2.取消選取"從套件檔案運行"

部署期間,請確保取消選取"從程式包檔案執行"選項。

  1. Linux容器化

    如果您的應用程式面向 Linux 環境,請考慮在部署到 Azure 之前使用 Docker 進行容器化。 請參閱Docker 安裝指南以取得詳細說明。

4.啟用單一進程模式

新增以下程式碼以強制 IronPDF 以單一進程模式運作:

   // Forces IronPDF to run in single-process mode to improve stability on Azure
   IronPdf.Installation.SingleProcess = true;
   // Forces IronPDF to run in single-process mode to improve stability on Azure
   IronPdf.Installation.SingleProcess = true;
$vbLabelText   $csharpLabel

如果以上方法均無法解決問題,請提交工程請求以獲得個人化協助。

柯蒂斯·週
技術撰稿人

Curtis Chau擁有卡爾頓大學電腦科學學士學位,專長於前端開發,精通Node.js、TypeScript、JavaScript和React。他熱衷於打造直覺美觀的使用者介面,喜歡使用現代框架,並擅長撰寫結構清晰、視覺效果出色的使用者手冊。

除了開發工作之外,柯蒂斯對物聯網 (IoT) 也抱有濃厚的興趣,致力於探索硬體和軟體整合的創新方法。閒暇時,他喜歡玩遊戲和製作 Discord 機器人,將他對科技的熱愛與創造力結合。

準備好開始了嗎?
Nuget 下載 17,012,929 | 版本: 2025.12 剛剛發布