Skip to content

Commit

Permalink
gpu info
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophSchranz committed Jan 22, 2024
1 parent 7ac4707 commit a21f6aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions custom/gpulibs.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ LABEL maintainer="Christoph Schranz <[email protected]>, Mat
# https://www.tensorflow.org/install/source#gpu
# installation via conda leads to errors in version 4.8.2
# Install CUDA-specific nvidia libraries and update libcudnn8 before that
# using device_lib.list_local_devices() the cudNN version is shown, adapt version to tested compat
USER ${NB_UID}
RUN pip install --upgrade pip && \
pip install --no-cache-dir tensorflow==2.15.0 keras==2.15.0 && \
Expand Down
9 changes: 5 additions & 4 deletions extra/Getting_Started/GPU-processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@
],
"source": [
"import tensorflow as tf\n",
"print(tf.test.is_built_with_cuda(), tf.config.list_physical_devices('GPU'))\n",
"\n",
"from tensorflow.python.client import device_lib\n",
"print(tf.config.list_physical_devices('XLA_GPU'))\n",
"device_lib.list_local_devices()"
"print(device_lib.list_local_devices())"
]
},
{
Expand Down Expand Up @@ -390,7 +391,7 @@
"outputs": [],
"source": [
"if torch.cuda.is_available():\n",
" # Here is the memory of the GPU a border. \n",
" # Here is the memory of the GPU a border.\n",
" # A matrix with 100000 lines requires 37 GB, but only 8 GB are available.\n",
" H = x.mm( (x.t().mm(x)).inverse() ).mm(x.t())"
]
Expand Down Expand Up @@ -438,7 +439,7 @@
],
"source": [
"if torch.cuda.is_available():\n",
" # This operation is difficult, as an symmetric matrix is transferred \n",
" # This operation is difficult, as an symmetric matrix is transferred\n",
" # back to the CPU. Is possible up to 30000 rows.\n",
" print(H.to(\"cpu\", torch.double)[0:5, 0:5])"
]
Expand Down

0 comments on commit a21f6aa

Please sign in to comment.