How to use the preinstalled environment
GPU Instances have different types of preinstalled environment, depending on the OS image you chose during creation of the Instance:
|OS image||Image release type||Preinstalled on image||Working environment|
|Ubuntu Focal GPU OS 11||Latest||Nvidia drivers, Nvidia Docker environment (launch Docker container to access working environment)||pipenv virtual environment accessed via Docker|
Using the latest Ubuntu Focal GPU OS11 image gives you a minimal OS installation on which you can launch one of our ready-made Docker images. This gives you access to a preinstalled Python environment managed with pipenv. A number of useful AI core packages and tools are installed, including
tensorflow and the Scaleway SDK. Depending on the Docker image you choose, other packages and tools will also be preinstalled, providing a convenient framework environment for you so that you can begin work immediately.
You may need certain IAM permissions to carry out some actions described on this page. This means:
You are now directly within the conda
Use the official conda documentation if you need any help managing your conda environment.Tip:
For a full, detailed list of the Python packages and versions preinstalled in this environment, look at the content of the
As Docker is also preinstalled, you could choose to launch one of Scaleway’s ready-made Docker images to access our latest working environments, if you wish.
exitto disconnect from your GPU Instance when you have finished your work.
You are now connected to your Instance, and see your OS. A minimum of packages, including Docker, are installed. Pipenv is not preinstalled here. You must launch a Scaleway AI Docker container to access the preinstalled Pipenv environment.
You are now in the
aidirectory of the Docker container, in the activated pipenv virtual environment, and can get right to work!Tip:
Use the command
pipenv graphto see a list of all installed packages and their versions, as well as all the dependencies of each package. For more help with pipenv, see our dedicated documentation.
Some applications, such as Jupyter Lab, Tensorboard and Code Server, require a browser to run. You can launch these from the
ai virtual environment of your Docker container, and view them in the browser of your local machine. This is thanks to the possibility to add port mapping arguments when launching a container with the
docker run command. In our example, we added the port mapping arguments
-p 8888:8888 -p 6006:6006 when we launched our container, mapping
8888:8888 for Jupyter Lab and
6006:6006 for Tensorboard.
Code Server runs in Jupyter Lab via Jupyter Hub, so does not need port mapping in this case. You can add other port mapping arguments for other applications as you wish.
Launch an application. Here, we launch Jupyter Lab:
Within the output, you should see something similar to the following:[I 2022-04-06 11:38:40.554 ServerApp] Serving notebooks from local directory: /home/jovyan/ai[I 2022-04-06 11:38:40.554 ServerApp] Jupyter Server 1.15.6 is running at:[I 2022-04-06 11:38:40.554 ServerApp] http://7d783f7cf615:8888/lab?token=e0c21db2665ac58c3cf124abf43927a9d27a811449cb356b[I 2022-04-06 11:38:40.555 ServerApp] or http://127.0.0.1:8888/lab?token=e0c21db2665ac58c3cf124abf43927a9d27a811449cb356b[I 2022-04-06 11:38:40.555 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).Tip:
Jupyter Lab is launched automatically when you run any Scaleway container image. You will see a message upon start up telling how to access the notebook in your browser. To override Jupyter Lab being launched automatically in this way, add
/bin/bashto the end of your
docker runcommand, e.g.
docker run --runtime=nvidia -it --rm -p 8888:8888 -p 6006:6006 rg.fr-par.scw.cloud/scw-ai/pytorch:latest /bin/bash. This preempts the launch of Jupyter Lab at container startup, and replaces it with the specified command, in this case a bash shell.
Open a browser window on your local computer, and enter the following URL. Replace
<ip-address>with the IP address of your Scaleway GPU Instance, and
<my-token>with the token shown displayed in the last lines of terminal output after the
You can find the IP address of your Instance in the Scaleway console. In the side menu, click Instances to see a list of your Instances. The IP address of each of them is shown in the list that displays.
Jupyter Lab now displays in your browser. You can use the Notebook, Console, or other features as required:
You can display the GPU Dashboard in Jupyter Lab to view information about CPU and GPU resource usage. This is accessed via the System Dashboards icon on the left side menu (the third icon from the top).
Use CTRL+C in the terminal window of your GPU Instance / Docker container to close the Jupyter server when you have finished.
When you are in the activated pipenv virtual environment, your command line prompt will normally be prefixed by the name of the environment. Here, for example, from
(ai) jovyan@d73f1fa6bf4d:~/ai we see that we are in the activated
ai environment, and from
jovyan@d73f1fa6bf4d:~/ai that we are in the
~/ai directory of our container:
exitto leave the preinstalled
You are now outside the preinstalled virtual environment.
exitagain to exit the Docker container.
Your prompt should now look similar to the following. You are still connected to your GPU Instance, but you have left the Docker container:root@scw-name-of-instance:~#
exitonce more to disconnect from your GPU Instance.