Skip to content

cudadev

nvidia.svg

inherite from

abcdesktopio/oc.template.ubuntu.nvidia.22.04

Distribution

ubuntu ubuntu

PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Ubuntu packages

gnome-terminal dbus-x11 git cuda libnvidia-cfg1-525 libnvidia-common-525 libnvidia-compute-525 libnvidia-decode-525 libnvidia-encode-525 libnvidia-extra-525 libnvidia-fbc1-525 git libglu1-mesa libxi6 libxinerama1 libxmu6 libglu1-mesa mesa-utils freeglut3 x11-xserver-utils

Arguments

"--disable-factory --class=cudadev"

Displayname

cuda developper

Path

/usr/bin/gnome-terminal

ACL

{
    "permit": [
        "all"
    ]
}

WM_CLASS

gnome-terminal-server.cudadev

The WM_CLASS property (of type STRING without control characters) contains two consecutive null-terminated strings. These specify the Instance and Class names to be used by both the client and the window manager for looking up resources for the application or as identifying information. to get the WM_CLASS property of an application, use the command line wmctrl -lx

Desktopfile

/usr/share/applications/org.gnome.Terminal.desktop

A .desktop file is a simple text file that holds information about a program. It is usually placed in “/usr/share/applications/”.

PRE run command

PRE run command are run before the package install command

POST run command

POST run command are run after the package install comman

RUN mkdir -p /run/user
RUN chmod 777 /run/user
RUN cd /usr/local/cuda && git clone https://github.com/NVIDIA/cuda-samples.git && chmod 777 cuda-samples && cd cuda-samples && chmod -R 777 * 
RUN echo "export PATH=/usr/local/cuda-12.0/bin${PATH:+:${PATH}}" > /cuda.sh
RUN echo "export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> /cuda.sh

JSON dump

json source file cudadev.d.3.0.json

{
    "acl": {
        "permit": [
            "all"
        ]
    },
    "cat": "development",
    "preruncommands": [],
    "debpackage": "gnome-terminal dbus-x11 git cuda libnvidia-cfg1-525 libnvidia-common-525 libnvidia-compute-525 libnvidia-decode-525 libnvidia-encode-525 libnvidia-extra-525 libnvidia-fbc1-525 git libglu1-mesa libxi6 libxinerama1 libxmu6 libglu1-mesa mesa-utils freeglut3 x11-xserver-utils",
    "icon": "nvidia.svg",
    "keyword": "cuda nvidia dev",
    "launch": "gnome-terminal-server.cudadev",
    "name": "cudadev",
    "displayname": "cuda developper",
    "path": "/usr/bin/gnome-terminal",
    "args": "--disable-factory  --class=cudadev",
    "rules": {
        "homedir": {
            "default": true
        }
    },
    "template": "abcdesktopio/oc.template.ubuntu.nvidia.22.04",
    "desktopfile": "/usr/share/applications/org.gnome.Terminal.desktop",
    "abcdesktop_release": 3,
    "postruncommands": [
        "RUN mkdir -p /run/user",
        "RUN chmod 777 /run/user",
        "RUN cd /usr/local/cuda && git clone https://github.com/NVIDIA/cuda-samples.git && chmod 777 cuda-samples && cd cuda-samples && chmod -R 777 * ",
        "RUN echo \"export PATH=/usr/local/cuda-12.0/bin${PATH:+:${PATH}}\" > /cuda.sh",
        "RUN echo \"export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}\" >> /cuda.sh"
    ]
}

Install the builded image

Replace the ABCHOST var set to localhost by default to your own server ip address

ABCHOST=localhost
curl --output cudadev.d.3.0.json https://raw.githubusercontent.com/abcdesktopio/oc.apps/main/cudadev.d.3.0.json
curl -X PUT -H 'Content-Type: text/javascript' http://$ABCHOST:30443/API/manager/image -d @cudadev.d.3.0.json

Generated DockerFile source code

# Dynamic DockerFile application file for abcdesktopio generated by abcdesktopio/oc.apps/make.js
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
ARG TAG=dev
FROM abcdesktopio/oc.template.ubuntu.nvidia.22.04:$TAG
USER root
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y  --no-install-recommends gnome-terminal dbus-x11 git cuda libnvidia-cfg1-525 libnvidia-common-525 libnvidia-compute-525 libnvidia-decode-525 libnvidia-encode-525 libnvidia-extra-525 libnvidia-fbc1-525 git libglu1-mesa libxi6 libxinerama1 libxmu6 libglu1-mesa mesa-utils freeglut3 x11-xserver-utils && apt-get clean
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
LABEL oc.icon="nvidia.svg"
LABEL oc.icondata="PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9InN2ZzIiIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMzUxLjQ2cHgiDQoJIGhlaWdodD0iMjU4Ljc4NXB4IiB2aWV3Qm94PSIzNS4xODggMzEuNTEyIDM1MS40NiAyNTguNzg1IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDM1LjE4OCAzMS41MTIgMzUxLjQ2IDI1OC43ODUiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHRpdGxlICBp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jgyNC0wLjIxMS0xMC4xMS0wLjUyOHYxOS4zMDYNCgloMTU2LjAzMlYzMS41MTJIMTQ5LjY0OHogTTE0OS42NDgsODAuNjU2VjY1Ljc3N2MxLjQ0Ni0wLjEwMSwyLjkwMy0wLjE3OSw0LjM5MS0wLjIyNmM0MC42ODgtMS4yNzgsNjcuMzgyLDM0Ljk2NSw2Ny4zODIsMzQuOTY1DQoJcy0yOC44MzIsNDAuMDQzLTU5Ljc0Niw0MC4wNDNjLTQuNDQ5LDAtOC40MzgtMC43MTUtMTIuMDI4LTEuOTIyVjkzLjUyM2MxNS44NCwxLjkxNCwxOS4wMjgsOC45MTEsMjguNTUxLDI0Ljc4NmwyMS4xOC0xNy44NTkNCgljMCwwLTE1LjQ2MS0yMC4yNzctNDEuNTI0LTIwLjI3N0MxNTUuMDIxLDgwLjE3MiwxNTIuMzEsODAuMzcxLDE0OS42NDgsODAuNjU2Ii8+DQo8L3N2Zz4NCg=="
LABEL oc.keyword="cudadev,cuda nvidia dev"
LABEL oc.cat="development"
LABEL oc.desktopfile="org.gnome.Terminal.desktop"
LABEL oc.launch="gnome-terminal-server.cudadev"
LABEL oc.template="abcdesktopio/oc.template.ubuntu.nvidia.22.04"
ENV ARGS="--disable-factory  --class=cudadev"
LABEL oc.name="cudadev"
LABEL oc.displayname="cuda developper"
LABEL oc.path="/usr/bin/gnome-terminal"
LABEL oc.type=app
LABEL oc.rules="{\"homedir\":{\"default\":true}}"
LABEL oc.acl="{\"permit\":[\"all\"]}"
RUN for d in /usr/share/icons /usr/share/pixmaps ; do echo "testing link in $d"; if [ -d $d ] && [ -x /composer/safelinks.sh ] ; then echo "fixing link in $d"; cd $d ; /composer/safelinks.sh ; fi; done
ENV APPNAME "cudadev"
ENV APPBIN "/usr/bin/gnome-terminal"
LABEL oc.args="--disable-factory  --class=cudadev"
ENV APP "/usr/bin/gnome-terminal"
RUN mkdir -p /run/user
RUN chmod 777 /run/user
RUN cd /usr/local/cuda && git clone https://github.com/NVIDIA/cuda-samples.git && chmod 777 cuda-samples && cd cuda-samples && chmod -R 777 * 
RUN echo "export PATH=/usr/local/cuda-12.0/bin${PATH:+:${PATH}}" > /cuda.sh
RUN echo "export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> /cuda.sh
USER root
RUN mkdir -p /var/secrets/abcdesktop/localaccount
RUN for f in passwd shadow group gshadow ; do if [ -f /etc/$f ] ; then  cp /etc/$f /var/secrets/abcdesktop/localaccount; rm -f /etc/$f; ln -s /var/secrets/abcdesktop/localaccount/$f /etc/$f; fi; done
USER balloon
CMD [ "/composer/appli-docker-entrypoint.sh" ]

Rebuild the image manually

Download the Dockerfile manually

Dockerfile for application cudadev

wget https://raw.githubusercontent.com/abcdesktopio/oc.apps/main/cudadev.d

build the Dockerfile to create a container image

docker build --build-arg TAG=3.0 -f cudadev.d -t cudadev .

Install the new image

If you are using containerd as container runtime, use the ctr command line

If you are not running this bash command on your abcdesktop node Replace the ABCHOST variable set to localhost by default to your own server ip address

ABCHOST=localhost
docker inspect cudadev > cudadev.json
docker image save cudadev -o cudadev.tar
ctr -n k8s.io images import cudadev.tar
curl -X PUT -H 'Content-Type: text/javascript' http://$ABCHOST:30443/API/manager/image -d @cudadev.json