Skip to content

Instantly share code, notes, and snippets.

@smolin
Last active February 4, 2023 09:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smolin/ea1f506b74e90bcb729007c50dbe25b7 to your computer and use it in GitHub Desktop.
Save smolin/ea1f506b74e90bcb729007c50dbe25b7 to your computer and use it in GitHub Desktop.
configure GCE instance with Nvidia drivers and NoMachine NX
# other options include teradici, paperspace and fram.me
# variables
instance = instance5
image = ubuntu-1604-xenial-v20171107b
# get update to this file
update:
curl -L https://gist.github.com/smolin/ea1f506b74e90bcb729007c50dbe25b7/raw/ > Makefile
# create instance, no gpu
instance:
gcloud beta compute --project "vc-dev-smolin-f263" instances create $(instance) --zone "us-west1-b" --machine-type "n1-standard-1" --subnet "default" --maintenance-policy "MIGRATE" --service-account "637863666619-compute@developer.gserviceaccount.com" --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring.write","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --min-cpu-platform "Automatic" --image $(image) --image-project "ubuntu-os-cloud" --boot-disk-size "10" --boot-disk-type "pd-standard" --boot-disk-device-name $(instance)
# connect to new instance
connect:
gcloud compute --project "vc-dev-smolin-f263" ssh --zone "us-west1-b" $(instance)
# install useful stuff
useful:
apt-get update
apt-get install -y xfce4 mesa-utils glmark2 firefox gcc make ubuntu-drivers-common pkg-config
# insert nomachine .deb
# or: curl -L http://download.nomachine.com/download/6.0/Linux/nomachine_6.0.66_2_i686.rpm --output nomachine.deb
add-nx:
curl -L https://www.dropbox.com/s/s83jr33bsucka88/nomachine_5.3.12_10_amd64.deb?dl=0 --output nomachine.deb
dpkg --install nomachine*deb
passwd ${USER}
test-glx:
glxgears # apx 750 fps before installing nvidia drivers
# install nvidia drivers, mod from https://cloud.google.com/compute/docs/gpus/add-gpus#install-gpu-driver
add-nvidia:
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
apt-get update
apt-get install -y cuda-8-0 lightdm- # "lightdm-" to prevent installing (has PAM issues with NoMachine)
nvidia-xconfig
# fail: glxinfo reports no Pbuffer in the "caveat" column; still using Mesa
# alternate nvidia install
add-nvidia-alt:
dpkg --add-architecture i386
apt-get update
apt-get install -y lib32z1 lib32ncurses5
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/384.90/NVIDIA-Linux-x86_64-384.90.run
sh NVIDIA-Linux-x86_64-384.90.run -q -a -n -X -s
nvidia-xconfig
# fail: glxinfo reports no Pbuffer in the "caveat" column; still using Mesa
# install virtualGL
add-virtualgl:
curl -L 'https://downloads.sourceforge.net/project/virtualgl/2.5.2/virtualgl_2.5.2_amd64.deb?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fvirtualgl%2Ffiles%2F2.5.2%2F&ts=1510708049&use_mirror=versaweb' > virtualgl.deb
dpkg -i virtualgl.deb
/usr/NX/scripts/vgl/vglserver_config
# blocked: can't get glxinfo to show that pbuffer is available ('P' in last column)
add-maya:
mkdir Maya
cd Maya
curl -O https://storage.googleapis.com/vc-software/autodesk/maya/2017/Autodesk_Maya_2017_Update4_EN_Linux_64bit.tgz --output Maya/maya.tgz
tar xvfz Autodesk_Maya_2017_Update4_EN_Linux_64bit.tgz
# blocked: can't get installer to run w/out serial and license key, even when selecting "use license server"
show-ip:
curl icanhazip.com
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment