Skip to content

Commit

Permalink
small changes to python scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKlx committed Sep 6, 2024
1 parent 99edeb5 commit 42eb7a9
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
22 changes: 22 additions & 0 deletions plugins/machine_learning/scripts/installation/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Stop on the first sign of trouble
set -e

echo "Removing all NVIDIA drivers and CUDA packages..."

# Remove the NVIDIA driver
sudo apt-get purge -y '*nvidia*'

# Remove CUDA Toolkit and associated packages
sudo apt-get purge -y '*cuda*'
sudo apt-get purge -y '*cublas*' '*cufft*' '*curand*' '*cusolver*' '*cusparse*' '*npp*' '*nvjpeg*'

# Autoremove remaining dependencies
sudo apt-get autoremove -y

# Remove any remaining NVIDIA and CUDA directories
sudo rm -rf /usr/local/cuda*

echo "Uninstallation complete. Please reboot the system."

9 changes: 9 additions & 0 deletions plugins/machine_learning/scripts/testing/minimal_cuda_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import torch

print(torch.__version__)
print(torch.version.cuda)
print(torch.cuda.is_available())


x = torch.rand(5, 3).cuda()
print(x)
13 changes: 12 additions & 1 deletion plugins/machine_learning/scripts/testing/minimal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
import pathlib

#some necessary configuration:
base_path = "/home/simon/projects/hal/"
user_name = os.getlogin()

# some necessary configuration:
if user_name == "simon":
base_path = "/home/simon/projects/hal/"
benchmarks_base_path = pathlib.Path("/home/simon/projects/benchmarks")
if user_name == "klix":
base_path = "/home/klix/projects/hal/"
benchmarks_base_path = pathlib.Path("/home/klix/projects/benchmarks")
else:
print("add base paths foe user {}before executing...".format(user_name))
exit()

sys.path.append(base_path + "build/lib/") #this is where your hal python lib is located
os.environ["HAL_BASE_PATH"] = base_path + "build" # hal base path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
import sys, os
import pathlib

#some necessary configuration:
base_path = "/home/simon/projects/hal/"
user_name = os.getlogin()

# some necessary configuration:
if user_name == "simon":
base_path = "/home/simon/projects/hal/"
benchmarks_base_path = pathlib.Path("/home/simon/projects/benchmarks")
if user_name == "klix":
base_path = "/home/klix/projects/hal"
benchmarks_base_path = pathlib.Path("/home/klix/projects/benchmarks")
else:
print("add base paths for user {}before executing...".format(user_name))
exit()

sys.path.append(base_path + "build/lib/") #this is where your hal python lib is located
os.environ["HAL_BASE_PATH"] = base_path + "build" # hal base path
Expand All @@ -15,7 +25,7 @@
#initialize HAL
hal_py.plugin_manager.load_all_plugins()

benchmarks_base_path = pathlib.Path("/home/simon/projects/benchmarks")

netlist_base_paths = benchmarks_base_path / "netlists_preprocessed/yosys/NangateOpenCellLibrary_functional"

netlist_paths = list()
Expand Down

0 comments on commit 42eb7a9

Please sign in to comment.