Commit 6b2254ff authored by root's avatar root Committed by YaningGao
Browse files

alfworld update

parent 06f2e818
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -77,15 +77,19 @@ pip install ai2thor==2.1.0
pip install alfworld==0.3.2
pip3 install numpy==1.23.5
pip3 install protobuf==3.20.3
pip3 install pydantic==1.10.14
pip3 install pydantic==2.10.6
pip3 install pydantic-core==2.16.3
pip3 uninstall frozenlist gradio murmurhash preshed spacy srsly thinc weasel aiosignal annotated-types blis catalogue cloudpathlib cymem

#skip this two install if you already installed in navigation
apt-get install -y pciutils
apt-get install -y xorg xserver-xorg-core xserver-xorg-video-dummy

# Set the data path and download before running the server
export ALFWORLD_DATA=<storage_path>
alfworld-download

# on a new window, start a startx port and then start server
python vagen/env/alfworld/startx.py
python vagen/env/server.py
python vagen/env/alfworld/startx.py 0
python vagen/server/server.py
```
+25 −0
Original line number Diff line number Diff line
@@ -110,13 +110,19 @@ def start(display=0, width=1280, height=1024):
    buses = []
    for r in pci_records():
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> a8c743f (alfworld update)
        if r.get('Vendor') == 'NVIDIA Corporation' and (
            r.get('Class','').startswith('VGA') or 
            r.get('Class','').startswith('3D')
        ):
<<<<<<< HEAD
=======
        if r.get('Vendor') == 'NVIDIA Corporation' and r.get('Class','').startswith('VGA'):
>>>>>>> 6b8f828 (alfworld update)
=======
>>>>>>> a8c743f (alfworld update)
            slot = r['Slot']  # e.g. '01:00.0'
            parts = re.split(r'[:\.]', slot)
            buses.append('PCI:' + ':'.join(str(int(x,16)) for x in parts))
@@ -130,15 +136,20 @@ def start(display=0, width=1280, height=1024):
    with os.fdopen(fd, 'w') as f:
        f.write(conf)

<<<<<<< HEAD
<<<<<<< HEAD
    # launch Xorg in the foreground
=======
    # launch Xorg silently
>>>>>>> 6b8f828 (alfworld update)
=======
    # launch Xorg in the foreground
>>>>>>> a8c743f (alfworld update)
    cmd = (
        f"Xorg -noreset +extension GLX +extension RANDR +extension RENDER "
        f"-config {path} :{display}"
    )
<<<<<<< HEAD
<<<<<<< HEAD
    process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    print(f"Started Xorg on DISPLAY=:{display}")
@@ -155,12 +166,26 @@ def start(display=0, width=1280, height=1024):
    print(f"Xorg is running on DISPLAY=:{display}. You can stop it by killing the process.")
=======
    subprocess.Popen(shlex.split(cmd), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
=======
    process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>>>>>>> a8c743f (alfworld update)
    print(f"Started Xorg on DISPLAY=:{display}")
    
    # wait for Xorg process to complete (or manually stop it)
    out, err = process.communicate()
    
    if process.returncode != 0:
        print(f"Error starting Xorg: {err.decode()}")
        return
    
    # export DISPLAY for this process
    os.environ['DISPLAY'] = f":{display}"
<<<<<<< HEAD

>>>>>>> 6b8f828 (alfworld update)
=======
    print(f"Xorg is running on DISPLAY=:{display}. You can stop it by killing the process.")
>>>>>>> a8c743f (alfworld update)

if __name__ == '__main__':
    import sys