运行OpenGL,与CentOS的AWS GPU实例 [英] Run OpenGL on AWS GPU instances with CentOS

查看:1072
本文介绍了运行OpenGL,与CentOS的AWS GPU实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要与CentOS的AWS EC2 GPU实例执行一些离屏渲染程序。然而,当我发现,Ubuntu是非常容易安装,我不能让正常的CentOS的工作。

I need to execute some off-screen rendering program on AWS EC2 GPU instance with CentOS. However, while I found that Ubuntu is very easy to setup, I cannot let CentOS work properly.

我们的目标是运行在EC2 GPU实例一些必要的工具/测试工具(无屏或X客户端)。在下面的文章中,我将介绍在Ubuntu怎么能设置和如何的CentOS /亚马逊的Linux AMI失败。

The goal is to run some essential utility/test tool on EC2 GPU instance (without screen or X client). In the following article, I will describe how the Ubuntu can be setup and how CentOS/Amazon Linux AMI fails.

在Ubuntu 12.04,一切都运行得非常顺利。 EC2环境我用的是:

On ubuntu 12.04, everything works very smoothly. The EC2 environment I used are:

  • 实例类型:两个CG1和G2进行了测试和工作正常。
  • AMI图像:Ubuntu的服务器12.04.3 LTS为HVM实例(AMI-b93264d0在美东)
  • 大多数其他设置为默认。

在该实例启动时,下面的命令执行:

After the instance is launched, the following commands are executed:

# Install the Nvidia driver
sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current
# Driver installation needs reboot
sudo reboot now

# Install and configure X window with virtual screen
sudo apt-get install xserver-xorg libglu1-mesa-dev freeglut3-dev mesa-common-dev libxmu-dev libxi-dev
sudo nvidia-xconfig -a --use-display-device=None --virtual=1280x1024
sudo /usr/bin/X :0 &

# OpenGL programs are now workable. Ex. glxinfo, glxgears
DISPLAY=:0 glxinfo

用glxgears 还可以在无需物理屏幕或X客户端后台运行:

The glxgears can also run in the background without physical screen or X client:

$ DISPLAY=:0 glxgears
95297 frames in 5.0 seconds = 19059.236 FPS
95559 frames in 5.0 seconds = 19111.727 FPS
94173 frames in 5.0 seconds = 18834.510 FPS

的CentOS或亚马逊的Linux AMI

两者CentOS的和亚马逊的Linux AMI来源于红帽企业版。但是,我不能让任何人工作。

CentOS or Amazon Linux AMI

Both "CentOS" and "Amazon Linux AMI" are derived from Red Hat Enterprise edition. However, I cannot make any of them work.

日前,AWS <一href="http://aws.typepad.com/aws/2013/11/build-3d-streaming-applications-with-ec2s-new-g2-instance-type.html">announced他们的新G2实例类型。在这篇文章中,亚马逊的Linux AMI与NVIDIA驱动程序被推荐用于Linux平台。在这个AMI,Nvidia驱动,X窗口和OpenGL库都安装。不过,我只是得到GLX错误信息试图执行OpenGL程序时。

A few days ago, AWS announced their new G2 instance type. In this article, the Amazon Linux AMI with NVIDIA Drivers is recommended for Linux platform. In this AMI, the Nvidia driver, X window and OpenGL libraries are all installed. However, I just get GLX error messages when trying to execute OpenGL programs.

EC2实例与以下设置启动:

The EC2 instance is launched with the following setting:

  • AMI图像:亚马逊的Linux AMI与NVIDIA GRID GPU的驱动程序(AMI-637c220a在美东)
  • 实例类型:G2
  • 大多数其他设置为默认

启动后,步骤来重现这个问题很简单:

After booted, the steps to reproduce this issue is very simple:

sudo X :0 & # Start the X window
glxinfo
glxgears

的输出是:

$ glxinfo
name of display: :0
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Error: couldn't find RGB GLX visual or fbconfig

Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".

$ glxgears
Xlib:  extension "GLX" missing on display ":0".
Error: couldn't get an RGB, Double-buffered visual

/var/log/Xorg.0.log 发现以下错误:

[139017.484] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)

我用Google搜索,并尝试了很多可能的解决方案,如:

I have googled and tried a lot of possible solution, such as:

  • 使用干净的CentOS HVM AMI并手动安装Nvidia驱动
  • 在尝试都CG1 / G2实例类型
  • 重新生成X窗口配置了NVIDIA-xconfig的
  • 使用的Xvfb而不是X的窗口
  • 在重新安装Nvidia驱动安装台面库后

...但他们没有工作。

... but none of them works.

有没有人有这个问题的一个具体的解决方案?一切我所提到的应该是可重复的(我试过很多次)。我将AP preciate如果您能提供可重复的指令做出的OpenGL(GLX)适用于在CentOS /亚马逊的Linux AMI EC2 GPU实例。

Does anyone have a concrete solution for this issue? Everything I mentioned should be reproducible (I tried many times). I'll appreciate if you can provide reproducible instructions to make OpenGL (GLX) works on EC2 GPU instances with CentOS/Amazon Linux AMI.

推荐答案

的lspci | grep的VGA

lspci | grep VGA

您应该看到busID为0:3:0

you should see the busID is 0:3:0.

将此到您的xorg.conf像这样:

Add this into your xorg.conf like so:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GRID K520"
    BusID           "0:3:0"
EndSection

火了X和远离你去...没有更多的GLX故障。

Fire up X and away you go... no more GLX failures.

这篇关于运行OpenGL,与CentOS的AWS GPU实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆