出现qt.qpa.plugin: Could not load the Qt platform plugin “xcb“,nsight computer打不开的问题

输入nv-nsight-cu或者ncu-ui后,最开始是等待一段时间没有反应,于是我重新安装了新版本的nsight computer:在root下输入sudo apt install nsight-computer 2022.2重新安装

安装完成后出现以下错误


Available platform plugins are: xcb.

Application could not be initialized!
    This is likely due to missing Qt platform dependencies.
    For a list of dependencies, please refer to https://doc.qt.io/qt-5/linux-requirements.html
    To view missing libraries, set QT_DEBUG_PLUGINS=1 and re-run the application.

 于是参照(2条消息) 出现“qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in ‘ ’even though it was found_消灭BUG鸭的博客-CSDN博客

中的方法添加环境变量,但是我的设备直接输入 sudo gedit ~/.bashrc打不开文件,可以使用vim或者直接在本地修改后上传到服务器。也可以直接在终端输入export QT_DEBUG_PLUGINS=1。然后又出现了以下错误:

QFactoryLoader::QFactoryLoader() checking directory path "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so"
Found metadata in lib /opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 393728
}


Got keys from plugin meta data QList("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/platforms" ...
Cannot load library /opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so" : "Cannot load library /opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

Application could not be initialized!
    This is likely due to missing Qt platform dependencies.
    For a list of dependencies, please refer to https://doc.qt.io/qt-5/linux-requirements.html
    To view missing libraries, set QT_DEBUG_PLUGINS=1 and re-run the application.

Warning: OpenGL Version check failed. Falling back to Mesa software rendering.
QFactoryLoader::QFactoryLoader() checking directory path "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so"
Found metadata in lib /opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 393728
}


Got keys from plugin meta data QList("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/platforms" ...
Cannot load library /opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so" : "Cannot load library /opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

/opt/nvidia/nsight-compute/2022.2.0/host/linux-desktop-glibc_2_11_3-x64/ncu-ui: line 26: 29071 Aborted                 (core dumped) "$NV_AGORA_PATH/CrashReporter" "NVIDIA Nsight Compute" "NVIDIA Nsight Compute" "2022.2.0.0 (build 31140043) (public-release)" "$NV_AGORA_PATH/ncu-ui.bin" "$@"

从以上信息中可以看到 更具体的错误位置,我的问题是找不到libxcb-xinput.so.0这个文件,于是

sudo apt-get install libxcb-xinput0

问题解决了。


 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这个错误信息通常表示Qt应用程序无法加载xcb平台插件,导致无法连接到显示器。这可能是由于缺少必要的库文件或配置问题引起的。为了解决这个问题,你可以尝试以下几个步骤: 1. 确保你的系统中已经安装了xcb平台插件所需的依赖库。你可以尝试安装libxcb和libxcb-xinerama这两个包,它们通常包含了所需的库文件。 2. 检查你的环境变量是否正确设置。确保QT_PLUGIN_PATH变量指向了包含xcb插件的目录。你可以通过运行命令`echo $QT_PLUGIN_PATH`来检查该变量的值。如果变量未设置或指向了错误的路径,你可以通过设置正确的路径来解决问题。 3. 如果以上步骤都没有解决问题,你可以尝试重新安装Qt应用程序。这可能会修复任何损坏的文件或配置。确保在重新安装之前先卸载旧版本的应用程序。 4. 如果你使用的是Ubuntu 18.04,你可以参考引用中提供的解决方案。这个文档专门介绍了在Ubuntu 18.04下解决Qt出现问题的方法。 总之,解决Linux中出现qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb"错误的方法包括安装依赖库、检查环境变量设置、重新安装应用程序以及参考特定操作系统版本的解决方案。希望这些方法能帮助到你解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform pluginxcb](https://blog.csdn.net/qq_15269787/article/details/126361820)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [opencv报错:qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform ...](https://blog.csdn.net/weixin_43986898/article/details/116484277)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Ubuntu18.04下解决Qt出现qt.qpa.plugin:Could not load the Qt platform pluginxcb问题](https://download.csdn.net/download/weixin_38695061/12841039)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值