Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Deep Mosaic in GPU Mode on $40 NVidia Tesla K80 & Tesla M60 - Success! #149

Open
seatv opened this issue Jan 15, 2025 · 1 comment

Comments

@seatv
Copy link

seatv commented Jan 15, 2025

NVidia Telsa K80 cards are dirt cheap on eBay now, as datacenters are shedding them now!

https://www.ebay.com/sch/i.html?_nkw=tesla+k80+24gb

So, I decided pick one up and stick it in a old ASUS TUF B350M-PLUS GAMING motherboard with Ryzen 5 Pro 2400GE processor.

These are the steps I followed to get this working:

K80 is a space heater and draws a lot of power, I am using a 650W PS>

Tesla K80 does not have any video output ports, so you need a motherboard with IGFX or another video card to connect your monitor.

Enable above 4G decoding in BIOS, usually in the PCI Subsystem Tab, this has to be done prior to putting the card in the motherboard. Otherwise the card/machine will not boot.

Install the card in the first (CPU) PCI slot.

Windows will recognize the card and install default drivers from 2015. Use device manager to check if the card has been recognized by your system.

Download & Install NVidia Datacenter Driver (Windows 10, this driver works on Windows 11)
Download & Install NVidia Cuda 11.0
Download & Install ffmpeg binaries - I used the latest version. Make sure your PATH points to the installation directory/bin or wherever you put ff*.exe-s

https://www.gyan.dev/ffmpeg/builds/

Download Python 3.7
Create a virtual environment

py -m venv D:\DMvEnv

Activate virtual environment

cd D:\DMvEnv
Scripts\Activate

Ensure that the correct and most recent version of pip is installed (command to invoke Python 3.7 seems to be py and python)

py -m pip install --upgrade pip

Dependencies for Requiremetns.TXT - I had to install them one by one

pip install numpy==1.19.3
pip install opencv_python==4.5.1.48
pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
pip install matplotlib==3.3.2
pip install tensorboardX==2.2
pip install scikit-image==0.17.2

Now download the source code from github

git clone https://github.com/HypoX64/DeepMosaics.git

Testing the installation

(1) Copy the pretrained models to ./pretrained_models

Make sure you are in the root folder of the DeepMosaic source tree

cd D:\DMvEnv\DeepMosaics

(2)Test Adding Mosaic

py deepmosaic.py --media_path ./imgs/ruoruo.jpg --model_path ./pretrained_models/add_face.pth --gpu_id 0

(3) Test Removing Mosaic

py deepmosaic.py --media_path ./result/ruoruo_add.jpg --model_path ./pretrained_models/clean_face_HD.pth --gpu_id 0

P.S. My biggest struggle was to figure out why the dependencies were not installing, once I figured out pip version was the issue, rest of the installation was a breeze. Hope this helps someone out there trying to run in GPU mode. The steps are valid for all NVidia cards (assuming CUDA 11 support is present).

You can pick the pip command for pytorch here:

https://pytorch.org/get-started/previous-versions/
@seatv
Copy link
Author

seatv commented Jan 21, 2025

I have two instances of DeepMosaic + one Python interpreted version going on an M60 at the same time:

D:\DeepMosaic\Program-GPU\core>nvidia-smi
Mon Jan 20 21:52:59 2025
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 475.14       Driver Version: 475.14       CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla M60           TCC  | 00000000:03:00.0 Off |                  Off |
| N/A   48C    P0   111W / 150W |   2044MiB /  8129MiB |     11%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  Tesla M60           TCC  | 00000000:04:00.0 Off |                  Off |
| N/A   33C    P0    36W / 150W |   1138MiB /  8129MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      9140      C   ...ython\Python38\python.exe     1128MiB |
|    0   N/A  N/A     12192      C   ...m-GPU\core\deepmosaic.exe      904MiB |
|    1   N/A  N/A      6108      C   ...m-GPU\core\deepmosaic.exe     1128MiB |
+-----------------------------------------------------------------------------+

@seatv seatv changed the title Running Deep Mosaic in GPU Mode on $40 NVidia Tesla K80 - Success! Running Deep Mosaic in GPU Mode on $40 NVidia Tesla K80 & Tesla M60 - Success! Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant