How to use the PyOpenGL for python3.6 on the nano?

I want to run a opengl code for python3.6 on the nano. I run some examples, and these examples I could run on my computer(ubuntu or windows) successfully, but failed to run on the nano.

The errors are:

err = 1282,
description = b’invalid operation’,


I installed the pyopengl and pyopengl-accelerate module(version 3.1.0) using the pip command.

I need your help.


PyOpenGL is a wrapper of GL library.
It’s recommended to verify if OpenGL can work correctly on your environment first.

OpenGL is not available on Jetson. Please use EGL or OpenGLES instead.
Both EGL and OpenGLES are supported by PyOpenGL:


Should get the wiki updated, It says it supports opengl 4.6

The EGL and OpenGLES are not very similar to OpenGL, and I must change my code.It is not good.


Sorry that let me confirm this with our internal team first.
Will update information with you later.


Ok, I help the OpenGL can be also used on the jetson nano board.

I have tried to solve this problem by changing my OpenGL codes , but it don’t work. Maybe the OpenGL is not supported.


OpenGL 4.6 is supported by Jetson Nano. I have corrected my comment above.
If your app cannot be executed successfully, could you share it with us?


This is a example based on python-opengl and pyqt5.
It is not work.
The errors are:

err = 1282,
description = b’invalid operation’,


I didn’t spend a whole lot of time on it but something is broken with that example. For some reason it initializes OpenGL ES instead of OpenGL.

My quick hack with pyopengl returns

Vendor: NVIDIA Corporation
            Renderer: NVIDIA Tegra X1 (nvgpu)/integrated
            OpenGL Version: 4.6.0 NVIDIA 32.1.0
            Shader Version: 4.60 NVIDIA

The example given returns

Vendor: NVIDIA Corporation
            Renderer: NVIDIA Tegra X1 (nvgpu)/integrated
            OpenGL Version: OpenGL ES 3.2 NVIDIA 32.1.0
            Shader Version: OpenGL ES GLSL ES 3.20

Maybe the jetson nano initializes OpenGL ES instead of OpenGL in a default way.

Like I said I think its something in the example you gave not with the jetson nano. Here is a test I hacked together using snippets from this site

#!/usr/bin/env python
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *

window = 0                                             # glut window number
width, height = 500, 400                               # window size

def draw_rect(x, y, width, height):
    glBegin(GL_QUADS)                                  # start drawing a rectangle
    glVertex2f(x, y)                                   # bottom left point
    glVertex2f(x + width, y)                           # bottom right point
    glVertex2f(x + width, y + height)                  # top right point
    glVertex2f(x, y + height)                          # top left point

def refresh2d(width, height):
    glViewport(0, 0, width, height)
    glOrtho(0.0, width, 0.0, height, 0.0, 1.0)
    glMatrixMode (GL_MODELVIEW)

def draw():                                            # ondraw is called all the time
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # clear the screen
    glLoadIdentity()                                   # reset position
    refresh2d(width, height)                           # set mode to 2d

    print """
            Vendor: {0}
            Renderer: {1}
            OpenGL Version: {2}
            Shader Version: {3}
    glColor3f(0.0, 0.0, 1.0)                           # set color to blue
    draw_rect(10, 10, 200, 100)                        # rect at (10, 10) with width 200, height 100
    glutSwapBuffers()                                # important for double buffering

# initialization
glutInit()                                             # initialize glut
glutInitWindowSize(width, height)                      # set window size
glutInitWindowPosition(0, 0)                           # set window position
window = glutCreateWindow("")              # create window with title
glutDisplayFunc(draw)                                  # set draw function callback
glutIdleFunc(draw)                                     # draw all the time

What you said is right. I could run this example on my computer(ubuntu or windows) successfully, but failed to run on the jetson nano. I want to know why. This example should run well because the OpenGL is supported according to the wiki. Could you please give me some OpenGL(not OpenGL ES) examples which run successfully on the jetson nano? Thank you.

It runs fine on my nano.

If the example you gave ( run fine on your nano, and the code I gave( did not work. Maybe the Pyqt5 is not supported well or it has a conflict with glut.


It looks like there is no official PyQT5 prebuilt for ARM system yet.
If acceptable, you can use PyQT4 instead.

Try to install it with the following commands:

sudo apt-get install libqt4-dev qt4-dev-tools python-qt4-dev pyqt4-dev-tools
sudo apt-get install python-qt4
sudo apt-get install python3-pyqt4


Thanks, I will try what you said, and I also found the website incluing pyqt5 on arm


is finally PyQT5 ok for the Jetson Nano ? Did someone try it ?

Many thanks for your reply.



i answer to myself :

i have just installed pyopengl and pyqt5 on the Nano and everything seem to work fine.


1 Like