Skip to content

Instantly share code, notes, and snippets.

View Neo-X's full-sized avatar

Glen Berseth Neo-X

View GitHub Profile
# Base container that includes all dependencies but not the actual repo
# Updated from templates in the [softlearning (SAC) library](https://github.com/rail-berkeley/softlearning)
FROM nvidia/cudagl:11.4.2-base-ubuntu20.04 as base
# ARCH and CUDA are specified again because the FROM directive resets ARGs
# (but their default value is retained if set previously)
SHELL ["/bin/bash", "-c"]
@Neo-X
Neo-X / git_info.py
Created May 14, 2021 23:39 — forked from vitchyr/git_info.py
Save Git Info in Python for Reproducible Experiments
"""
Helper functions to save git information every time you
Requirements:
- GitPython==2.1.12
(Probably works on other GitPython versions, but this is the version I've tested.)
Usage:
```
import time
# import roboverse.bullet as bullet
import pybullet as p
import numpy as np
def connect():
clid = p.connect(p.SHARED_MEMORY)
if (clid < 0):
p.connect(p.GUI)
@Neo-X
Neo-X / KERASAlgorithm
Created September 24, 2018 18:24
model saving code for keras
import numpy as np
import h5py
# import lasagne
import sys
import copy
sys.path.append('../')
from model.ModelUtil import norm_state, scale_state, norm_action, scale_action, action_bound_std, scale_reward, norm_reward
from algorithm.AlgorithmInterface import AlgorithmInterface
from model.LearningUtil import loglikelihood_keras, likelihood_keras, kl_keras, kl_D_keras, entropy_keras
from keras.optimizers import SGD
@Neo-X
Neo-X / ExperienceMemory
Created September 24, 2018 18:18
experience memory buffer for RL
import numpy as np
import random
import h5py
from model.ModelUtil import validBounds, fixBounds, anneal_value, norm_state, norm_action, norm_reward, checkValidData
import copy
import sys
class ExperienceMemory(object):
@Neo-X
Neo-X / egl_notes.md
Last active July 4, 2018 21:03 — forked from andyneff/egl_notes.md
EGL Notes.md

Gotchas

  • Nvidia Driver 375.39 on ubuntu is broken when it comes to EGL. Follow comment #11 to fix the host machine.
    • To fix an nvidia-docker driver mount, you need to either fix /var/lib/nvidia-docker/volumes/nvidia_driver/375.39/lib64 or use a docker via docker run -it --rm -v nvidia_driver_375.39:/nvidia_driver debian to gain write permissions to the drivers, and patch them.
      • Copy /usr/lib/nvidia-375/libEGL.so.375.39 into the {nvidia_driver}/lib64/ directory
      • Make sure the symlinks for {nvidia_driver}/lib64/libEGL.so.1 and {nvidia_driver}/lib64/libEGL.so eventually link to the libEGL.so.375.39 file.
  • If you have the environment variable DISPLAY set, EGL will try and use the actual Display for offscreen OpenGL rendering instead of the headless route. This is difficult (but not impossible) because now you must run the command as the same user as the graphically logged in user.