Skip to content

Commit

Permalink
Set environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nandantumu committed Oct 2, 2024
1 parent dfe00de commit 67d72cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
env:
QT_QPA_PLATFORM: offscreen
# env:
# QT_QPA_PLATFORM: offscreen

steps:
- name: Update apt
Expand Down
2 changes: 2 additions & 0 deletions f1tenth_gym/envs/rendering/rendering_pyqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import math
from typing import Any, Callable, Optional
import signal
import os

import cv2
import numpy as np
Expand Down Expand Up @@ -164,6 +165,7 @@ def __init__(
signal.signal(signal.SIGINT, signal.SIG_DFL)
self.window.show()
elif self.render_mode == "rgb_array":
os.environ["QT_QPA_PLATFORM"] = "offscreen"
self.exporter = ImageExporter(self.canvas)

def update(self, state: dict) -> None:
Expand Down

0 comments on commit 67d72cf

Please sign in to comment.