如何在 Flatpak 应用程序中使用可切换的 Radeon HD 显卡?

如何在 Flatpak 应用程序中使用可切换的 Radeon HD 显卡?

如何将可切换的 Radeon HD 显卡用于 Flatpak 应用程序?HP Pavilion G6 与 Windows 7 双启动 操作系统:Kubuntu 18.04 64 位 处理器:4x Core i3-2310M 2.10GHz 显卡:AMD Radeon HD 6470M 内存:2.8 Gib 已安装专有 amd gpu 驱动程序。

> sayanstr@sayanstr-HPg6:~$ DRI_PRIME=1 | flatpak run com.valvesoftware.Steam
https://github.com/flathub/com.valvesoftware.Steam/wiki/Frequently-asked-questions
Overriding TZ to Asia/Kolkata
Running Steam on org.freedesktop.platform 19.08.7 64-bit
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
/home/sayanstr/.local/share/Steam/ubuntu12_32/steam
Installing breakpad exception handler for appid(steam)/version(1579321278)
libGL error: MESA-LOADER: failed to open i965 (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open i965 (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: swrast
Installing breakpad exception handler for appid(steam)/version(1579321278)
libGL error: MESA-LOADER: failed to open i965 (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open i965 (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: swrast
Steam: An X Error occurred
X Error of failed request:  GLXBadContext
Major opcode of failed request:  152
Serial number of failed request:  51
xerror_handler: X failed, continuing
Steam: An X Error occurred
X Error of failed request:  BadValue (integer parameter out of range for operation)
Major opcode of failed request:  152
Value in failed request:  0x0
Serial number of failed request:  50
xerror_handler: X failed, continuing
Steam: An X Error occurred
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  152
Serial number of failed request:  52
xerror_handler: X failed, continuing
crash_20200210224208_1.dmp[144]: Uploading dump (out-of-process)
/tmp/dumps/crash_20200210224208_1.dmp                                                                                                                                                           
/home/sayanstr/.local/share/Steam/steam.sh: line 722:   139 Segmentation fault      (core dumped) $STEAM_DEBUGGER "$STEAMROOT/$STEAMEXEPATH" "$@"                                               
crash_20200210224208_1.dmp[144]: Finished uploading minidump (out-of-process): success = no
crash_20200210224208_1.dmp[144]: error: Couldn't connect to server
crash_20200210224208_1.dmp[144]: file ''/tmp/dumps/crash_20200210224208_1.dmp'', upload no: ''Couldn't connect to server''

> sayanstr@sayanstr-HPg6:~$ DRI_PRIME=1 | flatpak run org.blender.Blender
/run/user/1000/gvfs/ non-existent directory
Read prefs: /home/sayanstr/.var/app/org.blender.Blender/config/blender/2.81/config/userpref.blend
libGL error: MESA-LOADER: failed to open i965 (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open i965 (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri)
libGL error: failed to load driver: swrast
Received X11 Error:
        error code:   167
        request code: 152
        minor code:   34
        error text:   GLXBadFBConfig
Received X11 Error:
        error code:   167
        request code: 152
        minor code:   34
        error text:   GLXBadFBConfig
Received X11 Error:
        error code:   167
        request code: 152
        minor code:   34
        error text:   GLXBadFBConfig
Received X11 Error:
        error code:   167
        request code: 152
        minor code:   34
        error text:   GLXBadFBConfig
Received X11 Error:
        error code:   167
        request code: 152
        minor code:   34
        error text:   GLXBadFBConfig
Received X11 Error:
        error code:   167
        request code: 152
        minor code:   34
        error text:   GLXBadFBConfig
Received X11 Error:
        error code:   167
        request code: 152
        minor code:   34
        error text:   GLXBadFBConfig
Error! Unsupported graphics card or driver.
A graphics card and driver with support for OpenGL 3.3 or higher is required.
The program will now close.

答案1

我的系统中的桌面文件包含运行 flatpak steam 的代码:-

/usr/bin/flatpak 运行 --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper --file-forwarding com.valvesoftware.Steam @@u %U @@

我检查了flatpak 手册上面画着这面旗帜——

--env=VAR=VALUE

在应用程序中设置环境变量。这会更新元数据中的 [环境] 组。这会覆盖应用程序元数据中的上下文部分。此选项可多次使用。

由于 DRI_PRIME=1 可以设置为应用程序的环境变量,以便使用专用 GPU,例如

env DRI_PRIME=1 program_to_run

我修改了我的 steam 桌面文件中的命令如下 -

/usr/bin/flatpak 运行 --branch=stable --arch=x86_64 --env=DRI_PRIME=1--command=/app/bin/steam-wrapper --file-forwarding com.valvesoftware.Steam @@u %U @@

现在,DRI_PRIME=1 已为整个 Steam 启用,在启动时将自动用于游戏。希望这对您有所帮助 :-)

相关内容