### Run BFS and SSSP Benchmarks on SNMG Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/standalone/README.md Example command to benchmark BFS and SSSP algorithms on a 2-GPU setup with a generated graph of scale 23. Ensure CUDA_VISIBLE_DEVICES is set appropriately. ```bash (rapids) user@machine:/cugraph/benchmarks/python_e2e> export CUDA_VISIBLE_DEVICES=0,1 (rapids) user@machine:/cugraph/benchmarks/python_e2e> python main.py --scale=23 --algo=bfs --algo=sssp ``` -------------------------------- ### Build cugraph C++ Examples Source: https://github.com/rapidsai/cugraph/blob/main/cpp/examples/README.md Builds all C++ examples for libcugraph. Ensure cugraph is built first. ```shell build-cugraph-cpp ``` ```shell cd cpp/examples ./build.sh all ``` -------------------------------- ### Install NetworkX Library Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/HITS.ipynb Installs the NetworkX library, which is needed for comparison with cuGraph's HITS implementation. ```python # The notebook compares cuGraph to NetworkX, # therefore there some additional non-RAPIDS python libraries need to be installed. # Please run this cell if you need the additional libraries %pip install networkx ``` -------------------------------- ### Run Single-GPU cugraph Example Source: https://github.com/rapidsai/cugraph/blob/main/cpp/examples/README.md Executes a single-GPU libcugraph example. Requires a CSV graph file as input. ```shell ./path_to_executable path_to_a_csv_graph_file ``` -------------------------------- ### Install and import pybind11 Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/random_walk_perf.ipynb Installs pybind11 if not found and imports it. This is likely a dependency for other modules. ```python try: import pybind11 except ModuleNotFoundError: os.system("pip install pybind11") import pybind11 ``` -------------------------------- ### Import system and utility modules Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/random_walk_perf.ipynb Imports system, utility, and file reading modules for benchmark setup. ```python # system and other import gc import os import time import random # MTX file reader from scipy.io import mmread import networkx as nx ``` -------------------------------- ### Setup and Run Benchmarks Source: https://github.com/rapidsai/cugraph/blob/main/python/utils/README-benchmark.md Commands to set up datasets and run benchmarks from the `devel` container. Assumes a bash shell. ```bash # get datasets cd /rapids/cugraph/datasets ./get_test_data.sh # run benchmarks cd /rapids/cugraph/python/utils ./run_benchmarks.sh ``` -------------------------------- ### Run Multi-GPU cugraph Example Source: https://github.com/rapidsai/cugraph/blob/main/cpp/examples/README.md Executes a multi-GPU libcugraph example using MPI. Requires a CSV graph file as input. ```shell mpirun -np 2 path_to_executable path_to_a_csv_graph_file ``` -------------------------------- ### Install and import Matplotlib Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/random_walk_perf.ipynb Installs Matplotlib if not found and imports it for plotting. Sets Matplotlib's default behavior. ```python try: import matplotlib except ModuleNotFoundError: os.system("pip install matplotlib") import matplotlib.pyplot as plt plt.rcdefaults() ``` -------------------------------- ### Install and import graph-walker Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/random_walk_perf.ipynb Installs the 'graph-walker' library if not found and imports the 'walker' module. This is used for random walk functionality. ```python try: import walker except ModuleNotFoundError: os.system("pip install graph-walker") import walker ``` -------------------------------- ### Install NetworkX and SciPy Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/Pagerank.ipynb Installs necessary non-RAPIDS Python libraries for comparing cuGraph with NetworkX. ```python %pip install networkx %pip install scipy ``` -------------------------------- ### VSCode Debug Launch Configuration Example Source: https://github.com/rapidsai/cugraph/blob/main/readme_pages/CONTRIBUTING.md Example configuration for enabling a debug launch in VSCode. This can be used for debugging cuGraph code. ```json { "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "justMyCode": false } ] } ``` -------------------------------- ### Install and Import Community Detection Library Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/louvain_benchmark.ipynb Installs the 'python-louvain' package if not found and then imports the community detection module. This is needed for NetworkX's Louvain implementation. ```python # NetworkX libraries try: import community except ModuleNotFoundError: os.system("pip install python-louvain") import community ``` -------------------------------- ### Install python-louvain if missing Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/synth_release_single_gpu.ipynb Checks if the 'community' library (python-louvain) is installed and installs it via pip if it's not found. This is required for the Louvain community detection algorithm comparison. ```python try: import community except ModuleNotFoundError: os.system("pip install python-louvain") import community ``` -------------------------------- ### VSCode Remote Development Configuration Example Source: https://github.com/rapidsai/cugraph/blob/main/readme_pages/CONTRIBUTING.md An example configuration for setting up remote development in VSCode for cuGraph. This allows development on remote hardware. ```json { "name": "Python: Remote Attach", "type": "python", "request": "attach", "port": 5678, "host": "localhost" } ``` -------------------------------- ### Setup Visualization Environment Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/layout/Force-Atlas2.ipynb Configures HoloViews and Datashader for interactive graph visualization, including setting colormaps and plot dimensions. ```python # Setup Viz client = Client() hv.notebook_extension("bokeh", "matplotlib") decimate.max_samples = 20000 dynspread.threshold = 0.01 datashade.cmap = fire[40:] sz = dict(width=150, height=150) %opts RGB [xaxis=None yaxis=None show_grid=False bgcolor="black"] ``` -------------------------------- ### Import system and utility modules Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/random_walk_benchmark.ipynb Imports system, utility, and file reading modules for benchmark setup and data handling. ```python # system and other import gc import os import time import random # MTX file reader from scipy.io import mmread ``` -------------------------------- ### Install Relocatable Tests Source: https://github.com/rapidsai/cugraph/blob/main/cpp/tests/CMakeLists.txt Installs the C API tests as relocatable components, placing them in the bin/gtests/libcugraph_c directory. ```cmake rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing_c DESTINATION bin/gtests/libcugraph_c) ``` -------------------------------- ### Download cuGraph Benchmark Data Source: https://github.com/rapidsai/cugraph/blob/main/datasets/README.md To install datasets specifically for benchmarking, run the get_test_data.sh script with the --benchmark option from the datasets directory. These datasets are larger and not installed by default. ```bash cd /datasets ./get_test_data.sh --benchmark ``` -------------------------------- ### cuGraph Simple SSSP Example Source: https://github.com/rapidsai/cugraph/blob/main/cpp/src/traversal/README.md Demonstrates how to call the SSSP function. Requires a pre-existing graph and device memory vectors for distances and predecessors. The caller must initialize the source vertex. ```cpp #include ... using vertex_t = int32_t; // or int64_t, whichever is appropriate using weight_t = float; // or double, whichever is appropriate using result_t = weight_t; // could specify float or double also raft::handle_t handle; // Must be configured if MG auto graph_view = graph.view(); // assumes you have created a graph somehow vertex_t source; // Initialized by user rmm::device_uvector distances_v(graph_view.number_of_vertices(), handle.get_stream()); rmm::device_uvector predecessors_v(graph_view.number_of_vertices(), handle.get_stream()); cugraph::sssp(handle, graph_view, distances_v.begin(), predecessors_v.begin(), source, std::numeric_limits::max(), false); ``` -------------------------------- ### Initialize UCX Cluster with InfiniBand+NVLink Source: https://github.com/rapidsai/cugraph/blob/main/scripts/dask/README.md Starts a Dask cluster using UCX with both InfiniBand and NVLink for high-performance inter-node and intra-node GPU communication. ```bash bash$ run-dask-process.sh scheduler workers --ucxib ``` -------------------------------- ### Benchmark Setup and Iteration Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Sets up arrays for performance metrics and iterates through datasets to benchmark various graph algorithms (Katz, BC, Louvain, TC, WCC) comparing NetworkX and cuGraph implementations. ```python # arrays to capture performance gains names = [] algos = [] # Two dimension data [file, perf] time_algo_nx = [] # NetworkX time_algo_cu = [] # cuGraph time_algo_cx = [] # cuGraph perf = [] perf_cu_nx = [] algos.append(" ") i = 0 for k, v in data.items(): time_algo_nx.append([]) time_algo_cu.append([]) time_algo_cx.append([]) perf.append([]) perf_cu_nx.append([]) # Saved the file Name names.append(k) # read data gdf = read_data(v) pdf = gdf.to_pandas() print(f"\tdata in gdf {len(gdf)} and data in pandas {len(pdf)}") # prep tmp_g = create_cu_ugraph(gdf) deg = tmp_g.degree() deg_max = deg["degree"].max() alpha = 1 / deg_max num_nodes = tmp_g.number_of_vertices() del tmp_g del deg # ----- Algorithm order is same as defined at top ---- # -- Katz print("\tKatz ", end="") if i == 0: algos.append("Katz") print("n.", end="") tx = nx_katz(pdf, alpha) print("c.", end="") tc = cu_katz(gdf, alpha) print("cx.", end="") tcx = cu_katz_nx(pdf, alpha) print("") time_algo_nx[i].append(tx) time_algo_cu[i].append(tc) time_algo_cx[i].append(tcx) perf[i].append(tx / tc) perf_cu_nx[i].append(tx / tcx) gc.collect() # -- BC print("\tBC k=100 ", end="") if i == 0: algos.append("BC Estimate fixed") k = 100 if k > num_nodes: k = int(num_nodes) print("n.", end="") tx = nx_bc(pdf, k) print("c.", end="") tc = cu_bc(gdf, k) print("cx.", end="") tcx = cu_bc_nx(pdf, k) print(" ") time_algo_nx[i].append(tx) time_algo_cu[i].append(tc) time_algo_cx[i].append(tcx) perf[i].append(tx / tc) perf_cu_nx[i].append(tx / tcx) gc.collect() # -- Louvain print("\tLouvain ", end="") if i == 0: algos.append("Louvain") print("n.", end="") tx = nx_louvain(pdf) print("c.", end="") tc = cu_louvain(gdf) print("cx.", end="") tcx = cu_louvain_nx(pdf) print(" ") time_algo_nx[i].append(tx) time_algo_cu[i].append(tc) time_algo_cx[i].append(tcx) perf[i].append(tx / tc) perf_cu_nx[i].append(tx / tcx) gc.collect() # -- TC print("\tTC ", end="") if i == 0: algos.append("TC") print("n.", end="") tx = nx_tc(pdf) print("c.", end="") tc = cu_tc(gdf) print("cx.", end="") tcx = cu_tc_nx(pdf) print(" ") time_algo_nx[i].append(tx) time_algo_cu[i].append(tc) time_algo_cx[i].append(tcx) perf[i].append(tx / tc) perf_cu_nx[i].append(tx / tcx) gc.collect() # -- WCC print("\tWCC ", end="") if i == 0: algos.append("WCC") print("n.", end="") tx = nx_wcc(pdf) print("c.", end="") tc = cu_wcc(gdf) print("cx.", end="") tcx = cu_wcc_nx(pdf) print(" ") ``` -------------------------------- ### Configure Install Relocatable Component Test Source: https://github.com/rapidsai/cugraph/blob/main/cpp/tests/CMakeLists.txt Sets up a test for installing a relocatable component to a specific destination. ```cmake rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcugraph) ``` -------------------------------- ### Initialize UCX Cluster with NVLink Source: https://github.com/rapidsai/cugraph/blob/main/scripts/dask/README.md Starts a Dask cluster using UCX for communication, optimized with NVLink for GPU-to-GPU transfers. ```bash bash$ run-dask-process.sh scheduler workers --ucx ``` -------------------------------- ### Install MPI for Multi-GPU Tests Source: https://github.com/rapidsai/cugraph/blob/main/cpp/tests/README.md Install OpenMPI using conda, which is required for running multi-GPU tests. ```bash conda install -c conda-forge openmpi ``` -------------------------------- ### Install Matplotlib if Not Found Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/pagerank_benchmark.ipynb Conditionally installs Matplotlib if it is not already available in the environment. This is useful for plotting results. ```python try: import matplotlib except ModuleNotFoundError: os.system("pip install matplotlib") ``` -------------------------------- ### cuGraph Simple BFS Example Source: https://github.com/rapidsai/cugraph/blob/main/cpp/src/traversal/README.md Demonstrates how to call the BFS function. Requires a pre-existing graph and device memory vectors for distances and predecessors. The caller must initialize the source vertex. ```cpp #include ... using vertex_t = int32_t; // or int64_t, whichever is appropriate using weight_t = float; // or double, whichever is appropriate using result_t = weight_t; // could specify float or double also raft::handle_t handle; // Must be configured if MG auto graph_view = graph.view(); // assumes you have created a graph somehow vertex_t source; // Initialized by user rmm::device_uvector distances_v(graph_view.number_of_vertices(), handle.get_stream()); rmm::device_uvector predecessors_v(graph_view.number_of_vertices(), handle.get_stream()); cugraph::bfs(handle, graph_view, d_distances.begin(), d_predecessors.begin(), source, false, std::numeric_limits::max(), false); ``` -------------------------------- ### Initialize CUDA Architectures for libcugraph-python Source: https://github.com/rapidsai/cugraph/blob/main/python/libcugraph/CMakeLists.txt Initializes CUDA architectures for the libcugraph-python build. This is a standard setup step for CUDA projects. ```cmake include(rapids-cuda) rapids_cuda_init_architectures(libcugraph-python) ``` -------------------------------- ### Initialize TCP Cluster Source: https://github.com/rapidsai/cugraph/blob/main/scripts/dask/README.md Starts a Dask cluster using TCP communication. This is the default communication mechanism. ```bash bash$ run-dask-process.sh scheduler workers --tcp ``` -------------------------------- ### Client Bandwidth Test Output Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/shared/build_cugraph_ucx/README.md Example output from the client bandwidth test, showing data transfer speeds. ```text (base) root@exp02:/home# python3 test_client_bandwidth.py 2022-12-19 13:31:30,867 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:31:30,867 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:31:30,891 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:31:30,891 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:31:30,918 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:31:30,918 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize Getting 1,000,000 rows of size 0.01 took = 20.995140075683594 ms Bandwidth = 0.4763 gb/s Getting 2,000,000 rows of size 0.02 took = 18.51017475128174 ms Bandwidth = 1.0805 gb/s Getting 4,000,000 rows of size 0.04 took = 25.659966468811035 ms Bandwidth = 1.5588 gb/s Getting 25,000,000 rows of size 0.28 took = 53.80809307098389 ms Bandwidth = 5.2037 gb/s ----------------------------------------Completed Test---------------------------------------- ``` -------------------------------- ### Import Libraries for cuGraph Benchmarks Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/synth_release_single_gpu.ipynb Imports necessary system, pandas, cugraph, and NetworkX libraries for benchmarking. Includes a check and installation for the 'community' library if not found. ```python import gc import os from time import perf_counter import pandas as pd from collections import defaultdict # rapids import cugraph # NetworkX libraries import networkx as nx # RMAT data generator from cugraph.generators import rmat from cugraph.structure import NumberMap ``` -------------------------------- ### Import Libraries for cuGraph Benchmarking Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Imports necessary system, RAPIDS cuGraph, cuDF, and NetworkX libraries for benchmarking. Includes a check and installation for the 'community' library if not found. ```python # system and other import gc import os from time import perf_counter import numpy as np import math # rapids import cugraph import cudf # NetworkX libraries import networkx as nx # MTX file reader from scipy.io import mmread ``` ```python try: import community except ModuleNotFoundError: os.system("pip install python-louvain") import community ``` -------------------------------- ### Start Dask Scheduler and Workers Source: https://github.com/rapidsai/cugraph/blob/main/scripts/dask/README.md Use this script to initiate a Dask scheduler and its associated workers on a node. Ensure the SCHEDULER_FILE environment variable is set. ```bash bash$ run-dask-process.sh scheduler workers ``` -------------------------------- ### Initialize Cugraph Testing Source: https://github.com/rapidsai/cugraph/blob/main/cpp/tests/CMakeLists.txt Initializes the testing framework for Cugraph. This is a standard setup step for enabling tests within the project. ```cmake enable_testing() include(rapids-test) rapids_test_init() ``` -------------------------------- ### Conditional Import and Setup for Visualization Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/layout/Force-Atlas2.ipynb Imports visualization libraries and sets up the environment only if the 'cuxfilter' package is available. This block re-initializes visualization parameters. ```python import importlib.util cux_spec = importlib.util.find_spec("cuxfilter") if cux_spec is None: print("Visualization package is not available.") else: from cuxfilter.charts.datashader.custom_extensions.graph_assets import ( calc_connected_edges, ) # Viz libraries import holoviews as hv from colorcet import fire from datashader.bundling import directly_connect_edges, hammer_bundle from holoviews.operation.datashader import datashade, dynspread from holoviews.operation import decimate from dask.distributed import Client # Define the parameters ITERATIONS = 500 THETA = 1.0 OPTIMIZE = True # Import a built-in dataset from cugraph.datasets import netscience # Setup Viz hv.notebook_extension("bokeh", "matplotlib") decimate.max_samples = 20000 dynspread.threshold = 0.01 datashade.cmap = fire[40:] sz = dict(width=150, height=150) %opts RGB [xaxis=None yaxis=None show_grid=False bgcolor="black"] edges_gdf = netscience.get_edgelist() connected = calc_connected_edges( pos_gdf, edges_gdf, node_x="x", node_y="y", node_x_dtype="float32", node_y_dtype="float32", node_id="vertex", edge_source="src", edge_target="dst", edge_aggregate_col=None, edge_render_type="direct", ) ``` -------------------------------- ### Call Louvain Algorithm with pylibcugraph Source: https://github.com/rapidsai/cugraph/blob/main/readme_pages/pylibcugraph.md This example demonstrates how to call the Louvain algorithm directly using pylibcugraph. Ensure necessary libraries like pylibcugraph, cupy, and numpy are imported. The graph properties should be set appropriately before creating the graph object. ```python import pylibcugraph, cupy, numpy srcs = cupy.asarray([0, 1, 2], dtype=numpy.int32) dsts = cupy.asarray([1, 2, 0], dtype=numpy.int32) weights = cupy.asarray([1.0, 1.0, 1.0], dtype=numpy.float32) resource_handle = pylibcugraph.ResourceHandle() graph_props = pylibcugraph.GraphProperties(is_symmetric=True, is_multigraph=False) G = pylibcugraph.SGGraph( resource_handle, graph_props, srcs, dsts, weights, store_transposed=True, renumber=False, do_expensive_check=False) (vertices, clusters, modularity) = pylibcugraph.louvain(resource_handle, G, 100, 1., False) ``` -------------------------------- ### Import Libraries for cuGraph Benchmarks Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/synth_release_single_node_multi_gpu.ipynb Imports necessary system, pandas, Dask, and cuGraph libraries for benchmarking. Includes setup for Dask CUDA cluster and client, and NetworkX for comparison. ```python import gc import os from time import perf_counter import pandas as pd from collections import defaultdict import cugraph from dask.distributed import Client from dask_cuda import LocalCUDACluster from cugraph.dask.comms import comms as Comms import networkx as nx from cugraph.generators import rmat from cugraph.structure import NumberMap ``` -------------------------------- ### Prepare Benchmark Data Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/README.md This command prepares the benchmark data by creating a 'data' directory and downloading necessary MTX files into it. ```bash sh ./dataPrep.sh ``` -------------------------------- ### Create and Write Transaction Data CSV Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/applications/gen_550M.ipynb Generates a transaction dataset with specified parameters, adds date and amount columns, and saves it to a CSV file. This example demonstrates a full data generation pipeline. ```python start_time = "1/1/2022 01:00:00 AM" end_time = "7/1/2022 01:00:00 AM" amount_range = 25000 d1 = datetime.strptime(start_time, "%m/%d/%Y %I:%M:%S %p") d2 = datetime.strptime(end_time, "%m/%d/%Y %I:%M:%S %p") scale = 15 df = generate_data(scale) dates = gen_times(len(df), d1, d2) amounts = gen_amounts(len(df), amount_range) df["amounts"] = amounts df["date"] = dates filename = "transaction_data_scale" + str(scale) + ".csv" df.to_csv("../data/" + filename) # append mode print(len(df)) df.head(5) ``` -------------------------------- ### Initialize CPM and Get Dependencies Source: https://github.com/rapidsai/cugraph/blob/main/cpp/libcugraph_etl/CMakeLists.txt Initializes the CPM (CPM.cmake) package manager and includes CMake scripts to fetch the cugraph and cudf libraries. Ensure CPM.cmake is available in the specified path. ```cmake rapids_cpm_init() include(cmake/thirdparty/get_cugraph.cmake) include(cmake/thirdparty/get_cudf.cmake) ``` -------------------------------- ### Initialize Libraries and Load Data Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Initializes libraries, reads graph data from a Matrix Market file, converts it to Pandas and cuGraph formats, and prints basic graph information. Includes cleanup of created objects. ```python # do a simple pass just to get all the libraries initialized # This cell might not be needed v = "./data/preferentialAttachment.mtx" gdf = read_data(v) pdf = gdf.to_pandas() print(f"\tGDF Size {len(gdf)}") g = create_cu_ugraph(gdf) print(f"\tcugraph Size {g.number_of_edges()}") print(f"\tcugraph Order {g.number_of_vertices()}") gnx = create_nx_ugraph(pdf) # clean up what we just created del gdf del pdf del g del gnx gc.collect() ``` -------------------------------- ### Renumber Graph from String Edgelist and Run Algorithms Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/structure/Renumber.ipynb Combine renumbering with graph creation and algorithm execution. This example demonstrates using string columns directly for the edgelist and automatically renumbering them when creating the graph. It then runs PageRank and Jaccard algorithms. ```python gdf = cudf.DataFrame(df[["source_list", "dest_list"]]) G = cugraph.Graph() G.from_cudf_edgelist(gdf, source="source_list", destination="dest_list", renumber=True) pr = cugraph.pagerank(G) print("pagerank output: ", pr) jac = cugraph.jaccard(G) print("jaccard output: ", jac) ``` -------------------------------- ### Initialize Dask Client Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/layout/Force-Atlas2.ipynb Sets up a Dask client, which is often used for distributed computing with RAPIDS libraries. ```python from dask.distributed import Client ``` -------------------------------- ### Execute Data Preparation Script Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Runs the 'dataPrep.sh' script to download necessary test files. This is a prerequisite for reading the data. ```bash !./dataPrep.sh ``` -------------------------------- ### Get Graph Degrees Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/Pagerank.ipynb This snippet retrieves the degree of each vertex in the graph. ```python d = G.degrees() ``` -------------------------------- ### Run Benchmarks with CSV Graph Input Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/standalone/README.md Create a graph from a CSV file and run all benchmarks. This is useful for testing with custom or real-world graph data. ```bash (rapids) user@machine:/cugraph/benchmarks/python_e2e> python main.py --csv='karate.csv' ``` -------------------------------- ### Get Graph Size Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb Returns the number of nodes and edges in the graph. ```python (G.number_of_nodes(), G.number_of_edges()) ``` -------------------------------- ### Get Number of Edges Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/demo/mg_jaccard.ipynb Retrieves the total number of edges in the Dask DataFrame. ```python len(ddf) ``` -------------------------------- ### Get Vertex Degrees of K-Truss Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/ktruss.ipynb Retrieves and sorts the degrees of vertices in the K-Truss subgraph. ```python d = kcg.degrees() d.sort_values(by="out_degree", ascending=False) ``` -------------------------------- ### Define Starting Number of Nodes Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/nx_cugraph_bc_benchmarking.ipynb Sets the initial number of nodes for graph generation. ```python # starting number of Nodes N = 100 ``` -------------------------------- ### Get Total Number of Edges Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/demo/centrality_patentsview.ipynb Calculates and returns the total number of edges in the `citation_df` DataFrame. ```python len(citation_df) ``` -------------------------------- ### Run Benchmarks with Symmetric Generated Dataset Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/standalone/README.md Generate a dataset, symmetrize it, and then run all benchmarks. Required for algorithms like Louvain and WCC that need symmetric graphs. ```bash (rapids) user@machine:/cugraph/benchmarks/python_e2e> python main.py --scale=23 --symmetric-graph ``` -------------------------------- ### Get Graph and Display Size Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/layout/Force-Atlas2.ipynb Retrieves the graph data and prints the number of nodes and edges. ```python G = netscience.get_graph(download=True) G.number_of_nodes(), G.number_of_edges() ``` -------------------------------- ### Call Get GPU Information Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/benchmarks_snmg.ipynb Executes the get_gpus function to display the detected GPU type and count. ```python get_gpus() ``` -------------------------------- ### Run Benchmarks on Small and Directed Datasets Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Executes all benchmarks targeting datasets marked as both 'small' and 'directed'. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest -v -m "small and directed" ``` -------------------------------- ### Download Benchmark Datasets Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Run this script from the /datasets directory to download necessary benchmark datasets. ```bash cd /datasets ./get_test_data.sh --benchmark ``` -------------------------------- ### Message GPU Architectures Source: https://github.com/rapidsai/cugraph/blob/main/cpp/CMakeLists.txt Prints the configured GPU architectures for the build to the console. ```cmake message("-- Building for GPU_ARCHS = ${CMAKE_CUDA_ARCHITECTURES}") ``` -------------------------------- ### Import cuGraph and supporting libraries Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/louvain_benchmark.ipynb Imports necessary libraries for cuGraph, cuDF, and timing. Ensure these libraries are installed. ```python # Import needed libraries import time import cugraph import cudf import os ``` -------------------------------- ### Run SSSP or BFS Benchmarks on Small and Directed Datasets Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Executes only the SSSP and BFS benchmarks against datasets marked as 'small' and 'directed'. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest -v -m "small and directed" -k "sssp or bfs" ``` -------------------------------- ### Get Maximum Node ID Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/applications/CostMatrix.ipynb Retrieves the maximum node ID present in the source and destination columns of the DataFrame. ```python # check the max ID max([gdf["src"].max(), gdf["dst"].max()]) ``` -------------------------------- ### Show Benchmarks to be Run (Dry Run) Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Lists the benchmarks that would be executed with the given options without actually running them. Useful for verifying selections. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest --collect-only ``` -------------------------------- ### cuGraph BFS Benchmark Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Measures the time taken to perform a BFS starting from node 1 using cuGraph. ```python def cu_bfs(_df): t1 = perf_counter() _G = create_cu_ugraph(_df) _ = cugraph.bfs(_G, 1) t2 = perf_counter() - t1 return t2 ``` -------------------------------- ### Inspect Initial Data Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/structure/Renumber-2.ipynb Trim the dataset and display the first few rows to understand its structure and content. ```python # trim gdf = gdf[1:] # take a peek at the data gdf.head() ``` -------------------------------- ### Build libcugraph Source: https://github.com/rapidsai/cugraph/blob/main/cpp/tests/README.md Build the core libcugraph library using the provided build script. ```bash /path/to/cuGraph> ./build.sh libcugraph ``` -------------------------------- ### Define a New Benchmark Function Source: https://github.com/rapidsai/cugraph/blob/main/python/utils/README-benchmark.md Example of a Python function that can be used as a new benchmark. It takes a graph object and an argument. ```python def my_new_benchmark(graphObj, arg1): graphObj.my_new_algo(arg1) ``` -------------------------------- ### Run Benchmarks, Save, and Compare Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Executes all benchmarks, saves results, and compares the current run against the last saved results. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest -v --benchmark-autosave --benchmark-compare ``` -------------------------------- ### Cugraph Sampling Test Output Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/shared/build_cugraph_ucx/README.md Example output from the Cugraph sampling test, including UCX warnings and sampling times. ```text test_client_bandwidth.py test_cugraph_sampling.py (base) root@exp02:/home# python3 test_cugraph_sampling.py [1671456769.722931] [exp02:93 :0] parser.c:1989 UCX WARN unused environment variable: UCX_MEMTYPE_CACHE (maybe: UCX_MEMTYPE_CACHE?) [1671456769.722931] [exp02:93 :0] parser.c:1989 UCX WARN (set UCX_WARN_UNUSED_ENV_VARS=n to suppress this warning) 2022-12-19 13:32:56,228 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:56,228 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:32:57,485 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:57,485 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:32:57,655 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:57,655 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:32:57,878 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:57,879 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:32:57,957 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:57,957 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:32:57,963 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:57,963 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:32:57,973 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:57,973 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:32:58,011 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:32:58,012 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize Sampling 1,000 took = 69.15879249572754 ms Sampling 10,000 took = 89.63620662689209 ms Sampling 100,000 took = 135.9888792037964 ms ----------------------------------------Completed Test---------------------------------------- ``` -------------------------------- ### Define Seed Patent Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/demo/centrality_patentsview.ipynb Defines a list containing a single patent ID to be used as the starting point for graph traversal. ```python poi = ["10810491"] ``` -------------------------------- ### Run Benchmarks with Unweighted Generated Dataset Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/standalone/README.md Execute all benchmarks using a generated unweighted dataset. Use this when the algorithm does not require edge weights. ```bash (rapids) user@machine:/cugraph/benchmarks/python_e2e> python main.py --scale=23 --unweighted ``` -------------------------------- ### NetworkX BFS Benchmark Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Measures the time taken to find all BFS edges starting from node 1 using NetworkX. ```python def nx_bfs(_df): t1 = perf_counter() _G = create_nx_ugraph(_df) nb = nx.bfs_edges(_G, 1) nb_list = list(nb) # gen -> list t2 = perf_counter() - t1 return t2 ``` -------------------------------- ### Initialize Data Structures for Benchmarking Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/synth_release_single_gpu.ipynb Initializes defaultdicts to store run times for graph creation and algorithm execution for both cuGraph and NetworkX, as well as performance metrics. ```python cugraph_algo_run_times = defaultdict(defaultdict) nx_algo_run_times = defaultdict(defaultdict) cugraph_graph_creation_times = defaultdict() nx_graph_creation_times = defaultdict() perf_algos = defaultdict(defaultdict) perf = defaultdict(defaultdict) ``` -------------------------------- ### Display Performance Metrics Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/louvain_benchmark.ipynb Prints the performance metrics of the Louvain algorithm benchmark. ```python perf ``` -------------------------------- ### Run Benchmarks with Generated Dataset Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/standalone/README.md Execute all benchmarks using a generated dataset with a specified scale. This is a basic run for performance testing. ```bash (rapids) user@machine:/cugraph/benchmarks/python_e2e> python main.py --scale=23 ``` -------------------------------- ### Import NetworkX Library Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Degree.ipynb Import the NetworkX library for graph analysis. ```python # NetworkX libraries import networkx as nx ``` -------------------------------- ### Set cugraph_common Include Directories Source: https://github.com/rapidsai/cugraph/blob/main/cpp/CMakeLists.txt Configures private and public include directories for the cugraph_common library, including build and install interfaces. ```cmake target_include_directories(cugraph_common PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty" "${CMAKE_CURRENT_SOURCE_DIR}/src" PUBLIC "$" "$" ) ``` -------------------------------- ### cuGraph Benchmark Class Definition Source: https://github.com/rapidsai/cugraph/blob/main/python/utils/README-benchmark.md Example of the `Benchmark` class definition in `benchmark.py`, showing the standard metrics applied via decorators. ```python class Benchmark(WrappedFunc): wrappers = [logExeTime, logGpuMetrics, printLastResult] ``` -------------------------------- ### Run SSSP Benchmarks on Small and Directed Datasets Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Executes only the SSSP benchmarks against datasets marked as 'small' and 'directed'. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest -v -m "small and directed" -k sssp ``` -------------------------------- ### Get GPU Information Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/benchmarks_snmg.ipynb Retrieves the GPU type and count from the system using nvidia-smi. This function is essential for determining multi-GPU availability. ```python import subprocess def get_gpus(): try: gpu_info = subprocess.check_output( ["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"], encoding="utf-8", ) gpus = [line.strip() for line in gpu_info.strip().split("\n") if line.strip()] gpu_count = len(gpus) return ".".join(set(gpus)), gpu_count except Exception: return "no_gpus", 0 ``` -------------------------------- ### Initialize Multi-GPU Dask Environment Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/demo/mg_jaccard.ipynb Sets up a local Dask cluster with multiple GPU workers and initializes a client to manage the cluster. It also configures communication for multi-GPU operations. ```python enable_spilling() cluster = LocalCUDACluster() client = Client(cluster) client.run(enable_spilling) Comms.initialize(p2p=True) ``` -------------------------------- ### Get Vertex Degrees Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb Retrieves the degree for each vertex in the graph. Vertex degree is often used as a feature in link prediction models. ```python # Also want to include the vertex degree degree = G.degree() ``` -------------------------------- ### Get Graph Statistics Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/sampling/RandomWalk.ipynb Retrieves and displays the number of nodes and edges in the created graph. Useful for understanding the graph's scale. ```python # some stats on the graph (G.number_of_nodes(), G.number_of_edges()) ``` -------------------------------- ### Print Benchmark Results Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Prints the list of algorithms and then iterates through datasets to print each dataset's name and performance metrics. Ensure 'algos', 'num_datasets', 'names', and 'perf' are defined prior to execution. ```python print(algos) for i in range(num_datasets): print(f"{names[i]}") print(f"{perf[i]}") ``` -------------------------------- ### Add Edge Weights Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/sampling/RandomWalk.ipynb Assigns a uniform weight of 1.0 to all edges in the graph. This is often a starting point for unweighted graph analysis. ```python gdf["weight"] = 1.0 ``` -------------------------------- ### Extract Specific Partition Vertices Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Induced-Subgraph.ipynb Filter the Louvain results to get the vertex IDs belonging to a specific partition (e.g., partition 1). ```python vids = df.query("partition == 1") ``` -------------------------------- ### Define Random Walk Seeds Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/sampling/RandomWalk.ipynb Initializes a list of seed vertices from which the random walks will start. These are the entry points for the random walk process. ```python # create a list with the seeds seeds = [17, 19] ``` -------------------------------- ### Benchmark Execution Loop Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/pagerank_benchmark.ipynb Initializes libraries and iterates through defined datasets to benchmark cuGraph and NetworkX PageRank. It collects execution times and calculates speedup. ```python # arrays to capture performance gains time_cu = [] time_nx = [] time_sp = [] perf_nx = [] perf_sp = [] names = [] # init libraries by doing a simple task v = "./data/preferentialAttachment.mtx" M = read_mtx_file(v) trapids = cugraph_call(M, 100, 0.00001, 0.85) del M for k, v in data.items(): gc.collect() # Saved the file Name names.append(k) # read the data M = read_mtx_file(v) # call cuGraph - this will be the baseline trapids = cugraph_call(M, 100, 0.00001, 0.85) time_cu.append(trapids) # Now call NetworkX tn = networkx_call(M, 100, 0.00001, 0.85) speedUp = tn / trapids perf_nx.append(speedUp) time_nx.append(tn) print("cuGraph (" + str(trapids) + ") Nx (" + str(tn) + ")") del M ``` -------------------------------- ### Run All Benchmarks Verbose Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Executes all benchmarks and prints their names on separate lines. Generates a report to standard output. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest -v ``` -------------------------------- ### Render Direct Graph Visualization Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/layout/Force-Atlas2.ipynb Renders the graph using HoloViews, displaying edges directly connected. This visualization is contingent on the 'cuxfilter' package being installed. ```python r_direct = None if cux_spec is not None: %opts RGB [tools=["hover"] width=800 height=800] r_direct = hv.Curve(connected, label="Direct") r_direct ``` -------------------------------- ### Build Multi-GPU Tests for libcugraph Source: https://github.com/rapidsai/cugraph/blob/main/cpp/tests/README.md Build the multi-GPU tests specifically for the libcugraph library. ```bash /path/to/cuGraph> ./build.sh libcugraph cpp-mgtests ``` -------------------------------- ### Run Benchmarks, Save Results Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Executes all benchmarks, generates a report to stdout, and saves the results for future comparisons. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest -v --benchmark-autosave ``` -------------------------------- ### Find CUDAToolkit Package Source: https://github.com/rapidsai/cugraph/blob/main/cpp/libcugraph_etl/CMakeLists.txt Finds and configures the CUDAToolkit package, specifying export sets for build and installation. This ensures the necessary CUDA components are available. ```cmake rapids_find_package(CUDAToolkit REQUIRED BUILD_EXPORT_SET cugraph_etl-exports INSTALL_EXPORT_SET cugraph_etl-exports ) ``` -------------------------------- ### Get GPU Memory Size Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/demo/mg_jaccard.ipynb Retrieves the total memory of each GPU in the system using nvidia-smi. This is used to determine the number of GPUs and their memory capacity. ```python import subprocess def get_gpu_memory_size(): result = subprocess.check_output( ["nvidia-smi", "--query-gpu=memory.total", "--format=csv,nounits,noheader"] ) return result.decode("utf-8").strip().split("\n") # ).strip().split('\n') gpu_info = get_gpu_memory_size() number_of_gpus = len(gpu_info) gpu_memory = int(gpu_info[0]) print( f"the cluster has {number_of_gpus} GPUs where each GPU has {gpu_memory} GB of memory" ) ``` -------------------------------- ### Set Random Walk Parameters Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/random_walk_benchmark.ipynb Initializes parameters for the random walk benchmark, including walk depth, maximum number of seeds, and an array to store sequential runtimes. ```python rw_depth = 4 max_seeds = 100 num_nodes = G.number_of_nodes() runtime_seq = [0] * max_seeds ``` -------------------------------- ### cuGraph BFS Benchmark (NetworkX Graph) Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Measures the time taken to perform a BFS starting from node 1 using cuGraph on a NetworkX graph. ```python def cu_bfs_nx(_df): t1 = perf_counter() _G = create_nx_ugraph(_df) _ = cugraph.bfs(_G, 1) t2 = perf_counter() - t1 return t2 ``` -------------------------------- ### cuGraph SSSP Implementation Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/sssp_benchmark.ipynb Converts an MTX graph to a cuDF DataFrame, builds a cuGraph, and computes SSSP starting from node 1. Includes timing. ```python # CuGraph SSSP def cugraph_call(M): gdf = cudf.DataFrame() gdf["src"] = M.row gdf["dst"] = M.col # added this since SSSP now requires a weight gdf["weight"] = 1 print("\tcuGraph Solving... ") t1 = time.time() # cugraph SSSP Call G = cugraph.Graph(directed=True) G.from_cudf_edgelist( gdf, source="src", destination="dst", weight="weight", renumber=False ) df = cugraph.sssp(G, 1) t2 = time.time() - t1 return t2 ``` -------------------------------- ### Define Test Data for Benchmarking Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/release.ipynb Sets up dictionaries to specify the MTX files for full and quick benchmarking runs. The 'data' variable is then assigned to 'data_full' for comprehensive testing. ```python # Test Files # set the data argument for full test or quick test data_full = { "preferentialAttachment": "./data/preferentialAttachment.mtx", "dblp": "./data/dblp-2010.mtx", "coPapersCiteseer": "./data/coPapersCiteseer.mtx", "as-Skitter": "./data/as-Skitter.mtx", } # for quick testing data_quick = { "preferentialAttachment": "./data/preferentialAttachment.mtx", #'karate' : './data/karate.mtx', } # TODO: Was set to quick for test data = data_full ``` -------------------------------- ### Run Benchmarks on Small Datasets Source: https://github.com/rapidsai/cugraph/blob/main/benchmarks/cugraph/pytest-based/README.md Executes all benchmarks specifically targeting datasets marked as 'small'. Must be run from the /benchmarks directory. ```bash (rapids) user@machine:/cugraph/benchmarks> pytest -v -m small ``` -------------------------------- ### Import Libraries for cuGraph BFS Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/traversal/BFS.ipynb Import necessary libraries: cugraph for graph algorithms and cudf for data manipulation. This is the initial setup for using cuGraph. ```python # First step is to import the needed libraries import cugraph import cudf from collections import OrderedDict ``` -------------------------------- ### Configure Benchmark Parameters Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/benchmarks_snmg.ipynb Sets parameters for running benchmarks, including multi-GPU enablement, data source selection, and the number of runs for averaging. ```python mg = True data_to_use = "Data Sets" number_of_runs = 1 ``` -------------------------------- ### Display GPU Information Source: https://github.com/rapidsai/cugraph/blob/main/notebooks/cugraph_benchmarks/sssp_benchmark.ipynb Use this command to display information about the available GPUs. This is useful for verifying GPU availability and selecting a specific GPU if multiple are present. ```python !nvidia-smi ```