Skip to content

maruel/ml

Repository files navigation

Machine Learning toolkit

Includes:

Google Colab

  • Visit https://colab.research.google.com/ or directly load one of the notebooks:
  • Select Runtime / Select Runtime type
    • Choose TPU or GPU. One may be out of stock while the other is still available, depending on the time of the day. TODO: Test with TPU.
  • Run the first cell to install everything (shift-enter)
    • It will ask for confirmation that you trust the code. Do as you wish. :)
  • Run the second cell to generate stuff.

Local

Ubuntu 22.04

  1. Install CUDA from https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network
    • You don't have to register.
  2. You can install then confirm it runs:
    sudo apt install cuda-11-8 libcudnn8 tensorrt-libs
    python3 -c "import tensorflow as tf;print(tf.config.list_physical_devices('GPU'))"
    
  3. Run ./setup.sh to create the virtual environment and install pip packages
  4. To start the server, run ./run.sh
  5. Tested on Ubuntu 22.04 with a Nvidia RTX 2060. Works great remotely via a Chromebook!

Perf

List memory usage: nvidia-smi

Summary:

nvidia-smi --query-gpu=utilization.gpu,utilization.memory,memory.total,memory.free,memory.used --format=csv

On exceptions, Jupyter tends to leave zombie python processes that will keep GPU VRAM allocations. Kill with:

nvidia-smi | grep 'python' | awk '{ print $5 }' | xargs -n1 kill

Windows 11

  1. Get python3.11 from the Microsoft Store until pytorch/pytorch#110436 is fixed and it becomes compatible with 3.12.
  2. Get CUDA from https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_network
    • You don't have to register.

Random notes

About

Playing with jupyterlab + with various ML libraries

Resources

License

Stars

Watchers

Forks

Contributors