当前位置: 首页 > news >正文

记录一次ubuntu系统下ovito无法调用显卡驱动报错

#报错内容
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create temporary context
QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create context
Failed to create QRhi for QBackingStoreRhiSupport
QOpenGLWidget is not supported on this platform.
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create temporary context
QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create context
Failed to create QRhi for QBackingStoreRhiSupport
QOpenGLWidget is not supported on this platform.
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create temporary context
QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create context
Failed to create QRhi for QBackingStoreRhiSupport
QOpenGLWidget is not supported on this platform.
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create temporary context
QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QRhiGles2: Failed to create context
Failed to create QRhi for QBackingStoreRhiSupport
QOpenGLWidget is not supported on this platform.
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QOpenGLWidget: Failed to create context
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

opengl的集成包括GLX和EGL,报错原因 ovito 默认调用GLX集成,而不是EGL集成。这里ovito与系统的GLX集成不兼容。需要手动改为调用EGL集成

QT_XCB_GL_INTEGRATION=xcb_egl ovito dump.end2.lammpstrj

解决方法1_设置别名:在 shell 配置文件中添加别名:打开环境变量文件,在最后添加

alias ovito='QT_XCB_GL_INTEGRATION=xcb_egl ovito'
  1. QT_XCB_GL_INTEGRATION:Qt环境变量,控制XCB(X11协议C语言绑定)的OpenGL集成方式

  2. xcb_egl:指定使用EGL而不是默认的GLX来管理OpenGL

创建别名是在shell中为常用命令创建快捷方式的简单方法,适合个人使用且不需要系统级权限。

解决方法2——创立运行脚本:在脚本中设定采用EGL集成,然后把脚本的地址添加到环境变量中

新建脚本文件ovito_egl如下:

#!/bin/bash
# 设置使用EGL而不是GLX
export QT_XCB_GL_INTEGRATION=xcb_egl# 启动OVITO
exec /usr/bin/ovito "$@" #这一列写ovito运行文件的位置

将脚本文件的路径添加到环境变量----终端属土ovito_egl可运行ovito

  • exec = "变成这个程序,我不再是脚本了"

  • /usr/bin/ovito = "要变成的程序位置"

  • "$@" = "把所有用户给的参数都传过去"

http://www.dtcms.com/a/341505.html

相关文章:

  • keepalived的配置
  • Java内置注解
  • 区块链技术:重塑未来互联网的伟大动力
  • 中金所股指期货交易规则
  • c++之指针和引用
  • 第三十三天(信号量)
  • 大模型—— DeepSeek V3.1 Base / Instruct 发布
  • Mqtt — 使用详解EMQX,MQTTX
  • Annexin V应用指南--多领域应用与实验陷阱规避
  • MySQL之分区功能
  • 《算法导论》第 33 章 - 计算几何学
  • 分布式事务之Seata与RocketMQ
  • 【Java SE】初识Java:从语言特性到实战入门
  • 整体设计 之定稿 “凝聚式中心点”原型 --整除:智能合约和DBMS的在表层挂接 能/所 依据的深层套接
  • 盲盒商城h5源码搭建可二开幸运盲盒回收转增定制开发教程
  • Python的collections引入的类型介绍(Python中的map, unordered_map, struct, 计数器, chainmap)
  • 元宇宙的硬件设备:从 VR 头显到脑机接口
  • IT运维背锅权限泄露?集中式管控如何化解风险?
  • 【PostgreSQL内核学习:WindowAgg 节点对 Tuplestore 的复用机制】
  • RAG 每日一技(十八):手写SQL-RAG太累?LangChain的SQL智能体(Agent)前来救驾!
  • 动态规划面试真题解析
  • Linux网络服务(三)——DNS域名解析服务
  • 学习中需不需要划线、做笔记
  • 2-1.利用框架构建一个easy的web应用
  • CISP-PTE之路--09文
  • 拓扑排序判断环 P1347 排序题解
  • LeetCode 刷题【47. 全排列 II】
  • k8s笔记01
  • WIFI国家码修改信道方法_高通平台
  • 如何将数据从 iPhone 转移到 vivo?