Access a GPU Container Job
Open an interactive shell into a running GPU Container Job with the CLI.
Open an interactive shell into a running GPU Container Job. From the shell, you can run commands directly on the container.
Prerequisites
You need the following before you start:
- The CosmicAC CLI installed and configured. See Install the CLI.
- A running GPU Container Job. See Create a GPU Container Job or Create a GPU Container Job (web interface).
Steps
Find the container index
View the job's details, replacing <jobId> with the ID from the previous step:
cosmicac jobs detail <jobId>The Containers section lists each container with its index, starting at 0. Note the index of the container you want to access.
Open the container shell
Open a shell into the container. Replace <jobId> and <containerId> with the values from the previous steps:
cosmicac jobs shell <jobId> <containerId>You connect as the appuser user. Run sudo for root access, and type exit to close the shell.
The shell requires the job's status to be running. If the container is still booting, wait, then try again.
Help and troubleshooting
nvidia-smi fails with "Failed to initialize NVML: Unknown Error"
The container has not loaded the GPU, even though the NVIDIA device files under /dev and /proc/driver/nvidia/version are present. Restart the container with kill 1 in the shell, using sudo if needed, then reconnect with cosmicac jobs shell and run nvidia-smi again.