Getting started: Using VALERIA's GPU computational resources¶
GPU
A GPU (Graphics Processing Unit) is a powerful, specialized processor that accelerates complex tasks by performing many calculations simultaneously. It is particularly useful for challenging operations such as simulations, analysis of large datasets, and training AI models.
1. Best practices for using VALERIA's resources¶
Your use must comply with the rules and policies of Université Laval, particularly those concerning the use of computer resources, data confidentiality and intellectual property.
Accessing resources
Access will be withdrawn at the end of the course.
- The resources must be used exclusively to carry out class work requiring computational resources.
- All users are responsible for any activity carried out using their account, including misuse, unauthorized use or use contrary to the rules and policies in force. Only students registered for the class are authorized to use and interact with VALERIA’s computational resources.
- The VALERIA team reserves the right to revoke your access at any time in the event of inappropriate use.
Data storage and backup
VALERIA does not offer a recovery or backup service.
- Do not store important data on VALERIA.
- Make frequent backups of your data (e.g., datasets, scripts, notebooks, etc.) using your own backup tools.
Responsible use of resources
- Plan ahead and schedule your training sessions over the course of the semester, to reduce the risk of queues and delays. VALERIA cannot be held responsible for any impact on your work and your success in the class.
- In the interests of fairness, a maximum of one or two people per team is allowed to use the computational resources simultaneously.
- Limit resource use to the time you really need. It's better to run several short-duration jobs, rather than a single lengthy one.
- To ensure efficient use of VALERIA’s computational resources, limit your GPU memory (VRAM) consumption to 8 GB per session or task. This will help optimize resource sharing among users. For instructions on how to monitor your usage, visit this page.
- Close your Jupyter sessions when you're done working with them. Follow this link to find out how to close your session. We reserve the right to close any session that has been inactive for more than two hours.
2. Help & support resources¶
If you have any questions or problems relating to the course content or the instructions for the assignments to be completed, please write to the person teaching the class.
If your questions or problems are of a technical nature and relate to the use of VALERIA’s computational resources, please write to sse.aide@ulaval.ca.
Alternatively, we invite you to try the following solutions, which may help you get unstuck faster:
- Take the time to read the error message carefully. It may contain relevant information.
- Read this Getting Started Guide again, including section 6 “Frequently Asked Questions”, to see if your question or problem has been answered.
- Consult VALERIA’s online documentation at the following address: https://doc.s3.valeria.science/fr/index.html
- Consult the online documentation of the Digital Research Alliance of Canada at https://docs.alliancecan.ca/wiki/Technical_documentation These computational resources operate in a similar way to VALERIA’s (e.g., JupyterLab and Slurm), so you'll find a lot of applicable information there.
- Do a Google search for the problem you're experiencing (e.g., code or error message), or for your specific question. The tools available on VALERIA are very well known, and many online resources and support communities exist (e.g., https://discourse.jupyter.org/).
If you have any comments or suggestions, please write to us at sse.aide@ulaval.ca.
3. Logging in to VALERIA¶
A VALERIA account is required to use the VALERIA computational resources. Since you have access to VALERIA as part of a class, VALERIA accounts have automatically been created for you. To log in, visit https://valeria.science/tableau-de-bord and log in using your ULaval IDUL and password (see image 1). Once logged in, your dashboard will appear (see image 2).

Image 1. Logging in to VALERIA

Image 2. VALERIA dashboard
There are different ways to use the VALERIA computational platform.
- Using a Jupyter session (section 4).
- Using a Slurm session (“batch” mode) (section 4).
In both cases, the first step is to connect to the front-end node to create a virtual environment for your project.
Front-end node
A front-end node (also known as a login node) in a cluster is the entry point where users log in, submit jobs and manage data before the compute nodes handle the actual processing. It's like the reception desk that organizes and directs your work to the right place.
Step 1. Connecting to the Université Laval VPN¶
(step required when connected to an Internet network outside the ULaval campus)
If you are not connected to the ULaval campus network (eduroam) and are physically off campus, you must first ensure that you are connected to the Université Laval VPN (vpncampus.ulaval.ca).
To connect to the VPN, you'll need to install Cisco AnyConnect Secure Mobility Client on your device. To do this, please refer to the guide specific to your device type:
- AnyConnect Guide for Windows (PDF)
- AnyConnect guide for macOS (PDF)
- AnyConnect for Windows help vignette/capsule
Once installed, launch the Cisco AnyConnect Secure Mobility Client software and enter vpncampus.ulaval.ca, then click on “Login”. Then enter your address in the IDUL@ulaval.ca format along with your usual password and confirm your multi-factor authentication if necessary.
Step 2. SSH connection to VALERIA¶
Various SSH clients are available for different operating systems. Here are two suggestions, available by default on Windows and Mac:
- Windows: https://learn.microsoft.com/en-ca/windows/terminal/tutorials/ssh
- Mac: https://support.apple.com/en-ca/guide/terminal/welcome/mac
- Linux: OpenSSH provides a SSH client
SSH connection to VALERIA:
SSH client
A SSH client is a program that lets you establish secure connections with remote computers and servers using the SSH (Secure Shell) protocol.
- URL: login.valeria.science
- User name: your IDUL (in lower case, without @ulaval.ca)
- Password: same password/PIN as for other Université Laval applications
In your terminal, the command will look like this (don't forget to replace “idul” in the command with your own IDUL):
If you are logging in for the first time, the following message may appear:
ssh idul@login.valeria.science
The authenticity of host 'login.valeria.science (132.203.223.10)' can't be established.
ED25519 key fingerprint is SHA256:UDED7Y6748tClCNOBId014dGUn0Jt1QEXt0swKD6lp0.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Enter yes, then press “enter”. You'll then get the following message when you log in for the first time:
Warning: Permanently added 'login.valeria.science,132.203.223.10' (ED25519) to the list of known hosts.
Finally, you will be asked to enter your password.

Image 3. SSH login message
Don't be surprised, no characters will appear when you enter your password. Simply type in your password and press “enter” when you're finished.
Once you have entered your password, you will be connected to one of VALERIA's front-end nodes:

Image 4. SSH banner
Here, the screenshot shows “ul-val-pr-ssh01”, but “ul-val-pr-ssh02” is just as valid. By default, you'll find yourself in your “HOME” folder. To view the contents of this folder, type the following command:
A note on the “$” symbol: don't type this symbol yourself, it will already be present in the server command line. It is included in the commands here as a reference.
Step 3. Loading the custom module of the course¶
A module has been created specifically for the course. When logged in to VALERIA, the module can be loaded with the following command:
In Jupyter, the same module can also be loaded, through the "Softwares" tab on the left of the page:

Image 5. VALERIA dashboard
then searching and clicking "Load" next to the module (the load button will appear when the cursor is over the module name):

Image 6. VALERIA dashboard
Note that the module must be loaded before creating/opening a notebook.
Your environment is now ready. You can start using VALERIA’s GPU computational resources either with Jupyter (section 4), or with Slurm in “batch” mode (section 5).
Step 5. Data storage and transfer to VALERIA¶
Please note that for class purposes, you each have access to 50 GB of storage space. This storage is accessible both via a Jupyter session (section 4) and via a SSH connection to the front-end node, as you have just done.
Once you have accessed your storage space, you will find several locations/folders, but the main ones to be aware of are:
- HOME: Your personal space, accessible only by you. By default, you're in this folder when you open a Jupyter session or log in to the front node via SSH.
- PROJECT: Your shared space, which can be accessed by your team members and your professor. It's important to place your files in the subfolder associated with your team, which bears your professor's ID and your team's number.
- SCRATCH: A temporary personal space specific to your account.
- public A shared directory, available to everyone, used to distribute common elements.
Note: We would like to remind you that VALERIA does not offer a recovery or backup service, and that it is your responsibility to save your data (e.g., datasets, scripts, notebooks, etc.) using your own backup tools.
Data transfer from your local computer¶
Depending on the speed of your Internet connection, uploading large files (e.g., multi-GB datasets) from your local computer may take some time. We recommend that, whenever possible, you carry out these data transfers from the Université Laval campus and with a wired rather than a wireless connection, so as to obtain the best possible speed and performance.
You can upload files from your local computer to your VALERIA storage via a Jupyter session. To do this, navigate to the location where you wish to upload the file, then click on the “Upload” icon in the left-hand menu (see image 7). Alternatively, you can “drag & drop” them from your workstation to the left-hand menu in Jupyter.

Image 7. Uploading a file to your VALERIA storage space
You can also download data from your VALERIA storage to your local computer using a Jupyter session. To do this, right-click on the file of your choice in the left-hand navigation menu and select “Download” (see image 8) or drag & drop it.

Image 8. Downloading a file to your local computer
Using data already available in the shared storage space (PROJECT) of your class¶
Whenever possible, it's best to use datasets already available on VALERIA. If your professor has requested it, some datasets specific to your class may already have been deposited in the shared folder public/enseignement/IFT-4030/data/. You can load the datasets directly from this location.
Downloading publicly available data from the Internet directly to VALERIA¶
If the datasets you wish to use are publicly available on the Internet, it is preferable to download them directly through VALERIA, rather than transferring them locally to your computer and then uploading them to your VALERIA storage. To download a dataset available on the Internet directly to VALERIA, you can use wget, which is already installed on VALERIA. The simplest use of the command is to first navigate to the directory where you want your dataset :
cd path/to/directory
wget <url-of-your-dataset>
After the download has completed, your dataset will be in the directory you selected with the first command.
Using GPU computation with Jupyter¶
Jupyter is primarily intended for small tasks to prepare, debug and refine your training scripts. Sessions last up to 24 hours.
Step 1. Launching a JupyterLab session¶
To use GPU computation with Jupyter, the first step is to launch a JupyterLab session via your dashboard on the VALERIA portal, or by directly entering the address https://jupyter.valeria.science/ in your browser.
JupyterHub lets you launch your JupyterLab session on a compute server. Here you can book the resources you want and select the version of Python you want to use. By default, the most recent version is selected.
When you launch a Jupyter session, you can select several parameters in the “ Server options ” window (see image 9):
- Number of cores: We recommend that you start with 4 cores and increase as needed.
- Memory (MB): We recommend that you start with 8 to 16 GB (8192 to 16,384 MB) and increase as necessary.
- GPU configuration: Select WITH_GPU to launch a session with a GPU resource. You can also launch a session without a GPU by selecting NO GPU.
- Account: By default, the account should begin with “ext”. If this is not the case, choose the “ext” option from the drop-down menu.
- Time (hours): Select the desired Jupyter session duration. Permitted duration ranges from 0.5 to 24 hours in 0.5-hour increments.
- User interface: Select the latest version of Python.

Image 9. Server Options page
Once all these options have been configured, click on the “Start” button to launch your Jupyter session. A loading time of up to 2 or 3 minutes is normal; in the background, an allocation request is made to the Slurm scheduler (see image 10).!!! note "Chercheuses et chercheurs UL"

Image 10. Session loading page
JupyterLab is the recommended general-purpose user interface (image 11). Your remote files and directories can be managed directly from Jupyter, and you can launch applications such as a terminal, notebooks, RStudio and more. You'll also see your new virtual environment, which you created in section 3 of this guide. Once the notebook has been launched, you can change the kernel using the “Kernel” option and then “Change Kernel”.

Image 11. “Hub“ of the Jupyter session
Step 2. Creating a notebook (if required)¶
Jupyter notebooks are frequently used for interactive analysis in Python. These are electronic notebooks which, in the same document, can bring together text, images, mathematical formulas and executable computer code.
You already have your virtual environment created in section 3. If you wish to create a new notebook, simply click on the icon with the desired Python version, and it will automatically be added to the current folder.
To see an example of a Python notebook:
- Go to:
public/exemples/400/ - Open the notebook demonstration.ipynb file. Note: The files in that location are read-only. If you plan in editing it, make a copy in your personal space.
Notebooks are made up of cells that generally contain code or content formatted in Markdown, a lightweight markup language.
You can also launch an interactive Python console by clicking on the icon under “Console” in the Launcher menu in your JupyterLab session. For further information on this topic, please consult VALERIA's online documentation at: https://doc.s3.valeria.science/fr/calcul/python/python-general.html.
Additional resources¶
If you need to quickly find help on a particular library, you can use the Help menu in Jupyter to access documentation relating to the main libraries available.
For more information, you may also find the following references useful:
- Digital Research Alliance of Canada - Using modules
- Digital Research Alliance of Canada - Python
- Digital Research Alliance of Canada - JupyterLab
GPU computation with Slurm ("batch" mode)¶
For compute-intensive jobs, once your training scripts are ready, it's usually best to run them in Slurm in “batch” mode. Slurm's default “batch” partition is limited to 24 hours.
For Slurm job submission, you'll need to choose the partition that best matches the job you wish to submit. In the case of lengthier jobs, you can select partitions with higher time and resource requirements: “batch_48h”, “bigmem”, “bigmem_48h” and so on. You can view the list by using the “sinfo” command when connected to the front-end node. For GPU computations, which will be the case for your class, you need to select a partition that allows you to book a GPU resource. For your class, a partition has been allocated for GPU calculations: gpu_inter. It is essential that you use this partition.
Step 1. Preparing your submission script¶
To launch jobs with Slurm, you first need to use submission scripts to properly setup the jobs.
In your submission script, you must limit yourself to 1 GPU, otherwise your job won't start. You must also use shards. The number of shards refers to the GPU capacity requested. Possible values range from 1 to 4 shards. However, we ask you to limit the number of shards you request to your actual needs, so that other users can make fair use of the VALERIA compute resources. We suggest you start with one or two shards, then gradually increase the number as needed.
Example of a Slurm submission script would look like this (script.sh):
#!/bin/bash
#
#SBATCH --time=0-01:00:00
#SBATCH --cpus-per-task=2
#SBATCH --mem=4G
#SBATCH --partition=gpu_inter
#SBATCH --gres=shard:2
module load enseignement/IFT-4030
# Insert your computations here...
# For a complete examples, see subfolder 620 and the other examples in the folder '<your-home>/public/exemples'.
python script.py
Step 2. Submitting your script to Slurm¶
Once your submission script is ready, you can submit your job to a login node using the “sbatch” command:
All possible Slurm script parameters are available here: https://slurm.schedmd.com/sbatch.html
You can then display running jobs using
Additional resources¶
For more information, you may also find the following references useful:
- VALERIA - Quick reference - SLURM
- Digital Research Alliance of Canada - Running jobs
- Slurm User Guide (University of Michigan)
6. Frequently asked questions¶
I'm experiencing a bug when using Jupyter or Slurm. What should I do?¶
Please refer to section 2 of this guide.
I can't connect to VALERIA using SSH, and I get an error message. What's wrong?¶
If you get the following error message:
this is probably because you are connected to an off-campus Internet network but have not connected to the ULaval VPN. Make sure you connect to the VPN before trying to connect to VALERIA via SSH (see “Step 1. Connecting to the Université Laval VPN” in section 3 of this guide).
My script works when I run it in Jupyter, but not in Slurm. How come?¶
In this case, the main cause of the problem is usually due to the presence of libraries in Jupyter only. Make sure you create a virtual environment on the computing platform (see “Step 2. SSH connection to VALERIA” in section 3 of this guide) and activate it (‘source venv/bin/activate’ in the example for creating a virtual environment).
I'm having trouble installing a module or library when creating my virtual environment. What should I do?¶
Refer to section 3 of this guide (“Step 3. Loading the custom module of the course”). If you still have problems, check section 2 of this guide. If necessary, please write to sse.aide@ulaval.ca.
The 50 GB storage space is insufficient for my needs. What should I do?¶
If your default 50 GB storage space is insufficient for your needs, it is possible to increase it. Write to us at sse.aide@ulaval.ca to make your request.
How can I close my Jupyter session if I'm no longer using it?¶
To close your Jupyter session, click on “File” in the top left-hand corner, then on “Hub Control Panel” (see image 12). Then click on the “Stop My Server” button (see image 13). Your are now logged out of your Jupyter session.

Image 12. Hub Control Panel access

Image 13. Logging out of the Jupyter session
How can I cancel a job with Slurm if I've made a mistake?¶
First enter the “sq” command to find your job number. You can also use the “squeue” command to view the list of jobs for all users. If you use “squeue”, you'll be able to identify your jobs from the list of results, by looking at the “User”, “Account” and “Name” columns.
Once you've identified the job ID, you can enter the command “scancel” followed by the number (jobid) corresponding to your job to cancel the desired job.
I get a “Timeout” error when I launch a Jupyter session. What should I do?¶
If you get the “Timeout” error (see image 14), this indicates a lack of computational resources. Please try again later. If the error persists, please write to sse.aide@ulaval.ca.
!!! note "Chercheuses et chercheurs UL"
Image 14. "Timeout" error
Can I exceed the duration of my Jupyter interactive session?¶
No, you cannot exceed the duration of a Jupyter session. The length of the session set during initial configuration cannot be changed while you're working. At the end of the session, the progress of your work will be saved, and you'll be able to start a new one. If you start a task whose duration exceeds the time remaining in your Jupyter session, it will be interrupted when the Jupyter session expires. You'll have to restart it in a new session.
I can't find my Jupyter session. Where is it?¶
If you can no longer access your Jupyter session, this means that it has probably expired. Please launch a new one.
How can I save my work/files/etc.?¶
Your work on Jupyter is saved continuously in real time. Output sections are also saved. You can also choose to save manually by clicking on “File” and then on “Save Notebook” in your Jupyter session.
What happens if I exceed the CPU (cores)/memory (RAM)/GPU ratio available for my session?¶
In the case of a CPU or GPU limit, this should have no implications if the resources are available on VALERIA. In the case of memory (RAM), your process will be interrupted.
How can I check resource use while I'm doing my computational jobs or training?¶
Several Linux commands let you check resource usage during your training sessions.
- nvidia-smi: This command lets you view active GPUs and their attached processes. You must be connected to the compute node running your job.
- top or htop: These two commands allow you to view the active processes on a server. Notes: these commands display all processes running on a server, not just your own. Here too, you need to be connected to the compute node running your job.
- sq: This command displays your jobs in the Slurm scheduler.
- squeue: This command displays all jobs in the Slurm scheduler.
- See the following page for more Slurm commands: https://doc.s3.valeria.science/fr/calcul/slurm.html
- To monitor a job in progress: https://docs.alliancecan.ca/wiki/Running_jobs
I'd like to use the VALERIA GPU compute resources and the various VALERIA tools and resources beyond this class. Is this possible?¶
We invite you to contact us at sse.aide@ulaval.ca to express your interest. Although we cannot guarantee immediate access, your input will help us assess the request.