@@ -115,7 +115,7 @@ $ apptainer exec lolcow_latest.sif which fortune
115
115
116
116
- Apptainer bind mounts these host directories at runtime:
117
117
- Personal directories: ` /home ` , ` /scratch `
118
- - Leased storage shared by your research group: ` /project ` , ` /standard ` , ` /nv `
118
+ - Leased storage shared by your research group: ` /project ` , ` /standard `
119
119
- Your current working directory
120
120
- To bind mount additional host directories/files, use ` --bind ` /` -B ` :
121
121
@@ -170,11 +170,11 @@ The corresponding `run` command is displayed upon loading a module.
170
170
``` bash
171
171
$ module load tensorflow
172
172
To execute the default application inside the container, run:
173
- apptainer run --nv $CONTAINERDIR /tensorflow-2.10 .0.sif
173
+ apptainer run --nv $CONTAINERDIR /tensorflow-2.13 .0.sif
174
174
175
175
$ module list
176
176
Currently Loaded Modules:
177
- 1) apptainer/1.2.2 2) tensorflow/2.10 .0
177
+ 1) apptainer/1.2.2 2) tensorflow/2.13 .0
178
178
```
179
179
180
180
- ` $CONTAINERDIR ` is an environment variable. It is the directory where containers are stored.
@@ -204,7 +204,7 @@ Currently Loaded Modules:
204
204
Copy these files:
205
205
206
206
` ` ` bash
207
- cp /share/resources/tutorials/apptainer_ws/tensorflow-2.10 .0.slurm .
207
+ cp /share/resources/tutorials/apptainer_ws/tensorflow-2.13 .0.slurm .
208
208
cp /share/resources/tutorials/apptainer_ws/mnist_example.{ipynb,py} .
209
209
` ` `
210
210
@@ -213,36 +213,37 @@ Examine Slurm script:
213
213
` ` ` bash
214
214
#! /bin/bash
215
215
# SBATCH -A hpc_training # account name
216
- # SBATCH -p gpu # partition/queue
217
- # SBATCH --gres=gpu:1 # request 1 gpu
218
- # SBATCH -c 1 # request 1 cpu core
219
- # SBATCH -t 00:05:00 # time limit: 5 min
220
- # SBATCH -J tftest # job name
221
- # SBATCH -o tftest-%A.out # output file
222
- # SBATCH -e tftest-%A.err # error file
223
-
216
+ # SBATCH -p gpu # partition/queue
217
+ # SBATCH --gres=gpu:1 # request 1 gpu
218
+ # SBATCH -c 1 # request 1 cpu core
219
+ # SBATCH -t 00:05:00 # time limit: 5 min
220
+ # SBATCH -J tftest # job name
221
+ # SBATCH -o tftest-%A.out # output file
222
+ # SBATCH -e tftest-%A.err # error file
223
+
224
+ VERSION=2.13.0
224
225
# start with clean environment
225
226
module purge
226
- module load apptainer tensorflow/2.10.0
227
+ module load apptainer tensorflow/$VERSION
227
228
228
- apptainer run --nv $CONTAINERDIR /tensorflow-2.10.0 .sif mnist_example.py
229
+ apptainer run --nv $CONTAINERDIR /tensorflow-$VERSION .sif mnist_example.py
229
230
` ` `
230
231
231
232
Submit job:
232
233
233
234
` ` ` bash
234
- sbatch tensorflow-2.10 .0.slurm
235
+ sbatch tensorflow-2.13 .0.slurm
235
236
` ` `
236
237
237
238
# ### What does `--nv` do?
238
239
239
240
See [Apptainer GPU user guide](https://apptainer.org/user-docs/master/gpu.html#nvidia-gpus-cuda-standard)
240
241
241
242
` ` ` bash
242
- $ apptainer shell $CONTAINERDIR /tensorflow-2.10 .0.sif
243
+ $ apptainer shell $CONTAINERDIR /tensorflow-2.13 .0.sif
243
244
Apptainer> ls /.singularity.d/libs
244
245
245
- $ apptainer shell --nv $CONTAINERDIR /tensorflow-2.10 .0.sif
246
+ $ apptainer shell --nv $CONTAINERDIR /tensorflow-2.13 .0.sif
246
247
Apptainer> ls /.singularity.d/libs
247
248
libEGL.so libGLX.so.0 libnvidia-cfg.so libnvidia-ifr.so
248
249
libEGL.so.1 libGLX_nvidia.so.0 libnvidia-cfg.so.1 libnvidia-ifr.so.1
@@ -255,21 +256,21 @@ libEGL.so.1 libGLX_nvidia.so.0 libnvidia-cfg.so.1 libnvidia-ifr.so.
255
256
256
257
# ## "Can I use my own container on JupyterLab?"
257
258
258
- Suppose you need to use TensorFlow 2.11 .0 on JupyterLab. First, note we do not have ` tensorflow/2.11 .0` as a module:
259
+ Suppose you need to use TensorFlow 2.17 .0 on JupyterLab. First, note we do not have ` tensorflow/2.17 .0` as a module:
259
260
260
261
` ` ` bash
261
262
module spider tensorflow
262
263
` ` `
263
264
264
- Go to [TensorFlow' s Docker Hub page](https://hub.docker.com/r/tensorflow/tensorflow/tags?page=1&name=2.11.0 ) and search for the tag (i.e. version). You' ll want to use one that has the ` -gpu-jupyter` suffix. Pull the container in your account.
265
+ Go to [TensorFlow' s Docker Hub page](https://hub.docker.com/r/tensorflow/tensorflow) and search for the tag (i.e. version). You' ll want to use one that has the ` -gpu-jupyter` suffix. Pull the container in your account.
265
266
266
267
# ## Installation
267
268
268
269
# ### Manual
269
270
1. Create kernel directory
270
271
271
272
` ` ` bash
272
- DIR=~ /.local/share/jupyter/kernels/tensorflow-2.11 .0
273
+ DIR=~ /.local/share/jupyter/kernels/tensorflow-2.17 .0
273
274
mkdir -p $DIR
274
275
cd $DIR
275
276
` ` `
@@ -279,11 +280,11 @@ cd $DIR
279
280
` ` `
280
281
{
281
282
" argv" : [
282
- " /home/<user>/.local/share/jupyter/kernels/tensorflow-2.11 .0/init.sh" ,
283
+ " /home/<user>/.local/share/jupyter/kernels/tensorflow-2.17 .0/init.sh" ,
283
284
" -f" ,
284
285
" {connection_file}"
285
286
],
286
- " display_name" : " Tensorflow 2.11 " ,
287
+ " display_name" : " Tensorflow 2.17 " ,
287
288
" language" : " python"
288
289
}
289
290
` ` `
@@ -315,7 +316,7 @@ Usage: jkrollout sif display_name [gpu]
315
316
` ` `
316
317
317
318
` ` ` bash
318
- jkrollout /path/to/sif " Tensorflow 2.11 " gpu
319
+ jkrollout /path/to/sif " Tensorflow 2.17 " gpu
319
320
` ` `
320
321
321
322
# ## Test your new kernel
@@ -325,13 +326,13 @@ jkrollout /path/to/sif "Tensorflow 2.11" gpu
325
326
- Partition: GPU
326
327
- Work Directory: (location of your ` mnist_example.ipynb` )
327
328
- Allocation: ` hpc_training`
328
- - Select the new " TensorFlow 2.11 " kernel
329
+ - Select the new " TensorFlow 2.17 " kernel
329
330
- Run ` mnist_example.ipynb`
330
331
331
332
# ## Remove a custom kernel
332
333
333
334
` ` ` bash
334
- rm -rf ~ /.local/share/jupyter/kernels/tensorflow-2.11 .0
335
+ rm -rf ~ /.local/share/jupyter/kernels/tensorflow-2.17 .0
335
336
` ` `
336
337
337
338
---
0 commit comments