Skip to content

Instantly share code, notes, and snippets.

@gfodor
Created October 4, 2019 04:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gfodor/3c88700ee81a10e01c783019b8a6420a to your computer and use it in GitHub Desktop.
Save gfodor/3c88700ee81a10e01c783019b8a6420a to your computer and use it in GitHub Desktop.
apt install build-essential pkg-config autoconf libtool unzip gtk+2.0 xserver-xorg libglu1-mesa-dev freeglut3-dev mesa-common-dev libxmu-dev libxi-dev libasound2 libasound2-plugins alsa-utils alsa-oss pulseaudio pulseaudio-utils libpulse-dev chromium-browser
http://us.download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run
nvidia-xconfig --query-gpu-info
sudo nvidia-xconfig --busid=PCI:0:3:0 --use-display-device=none --virtual=1280x1024
nodejs
sudo usermod -aG pulse,pulse-access root
/etc/pulse/default.pa
load-module module-stream-restore restore_device=false
https://gist.github.com/jniltinho/9c009e9771651aa4a004ad3d1f6857e3
https://bitbucket.org/goempirical/bullman/get/bcc1b7ae6eb9.zip
flip gpu disable off
ffmpeg hardware streaming: https://gist.github.com/jniltinho/9c009e9771651aa4a004ad3d1f6857e3
https://gist.github.com/Brainiarc7/988473b79fd5c8f0db54b92ebb47387a
https://gist.github.com/Brainiarc7/4636a162ef7dc2e8c9c4c1d4ae887c0e
https://gist.github.com/gfodor/d8840537bb5ca35624d7f596e9835ee0
https://gist.github.com/Brainiarc7/2afac8aea75f4e01d7670bc2ff1afad1
https://gist.github.com/Brainiarc7/4b49f463a08377530df6cecb8171306a
https://github.com/NVIDIA/nvidia-docker
working:
ffmpeg -f x11grab -s 1280x1024 -framerate 60 -r 60 -i :0.0 -c:v h264_nvenc -preset:v llhq -qmin:v 19 -b:v 2.5M -r 60 -f flv rtmp://live-sjc.twitch.tv/app/live_412525932_wO1nhr86yCqbAxl45RGHAXLws912el
ffmpeg -f pulse -i chrome.monitor -acodec aac -f x11grab -s 1920x1080 -framerate 60 -r 60 -i :0.0 -c:v h264_nvenc -preset:v llhq -qmin:v 19 -b:v 2.5M -r 60 -c:a aac -acodec aac -strict experimental -ab 126k -ac 2 -ar 44100 -f flv rtmp://live-sjc.twitch.tv/app/live_412525932_wO1nhr86yCqbAxl45RGHAXLws912el
--disable-translate --disable-extensions --disable-background-networking --disable-sync --safebrowsing-disable-auto-update --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --ignore-certificate-errors --autoplay-policy=no-user-gesture-required --start-fullscreen --window-position=0,0 --window-size=1920,1080 --user-data-dir=./chrome2
full docker example:
https://blog.cloudsight.ai/deep-learning-image-recognition-using-gpus-in-amazon-ecs-docker-containers-part-ii-56748701b116
run x11 in host
techinque that works for multiple screens, just set DISPLAY=0.x and unique user-data-dir: http://us.download.nvidia.com/XFree86/Linux-x86/173.14.12/README/chapter-15.html
nvidia base image for GL:
https://gitlab.com/nvidia/cudagl
to get nvidia docker 2:
https://github.com/NVIDIA/nvidia-docker/issues/643
add
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
to /etc/apt/sources.list
then
update &
car demo for nvidia docker 2:
https://github.com/osrf/car_demo/blob/master/Dockerfile
sudo apt-get install docker-ce=18.06.1~ce~3-0~ubuntu
docker run --runtime=nvidia --rm nvidia/cudagl:10.0-base nvidia-smi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment