{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"gpu","dataSources":[],"dockerImageVersionId":30528,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import torch\n\n# 查看PyTorch版本\nprint(f\"PyTorch 版本: {torch.__version__}\")\n\n# 查看CUDA版本\nif torch.cuda.is_available():\n    print(f\"CUDA 版本: {torch.version.cuda}\")\nelse:\n    print(\"CUDA 不可用\")","metadata":{"execution":{"iopub.status.busy":"2024-09-16T06:23:55.245508Z","iopub.execute_input":"2024-09-16T06:23:55.245850Z","iopub.status.idle":"2024-09-16T06:23:58.925637Z","shell.execute_reply.started":"2024-09-16T06:23:55.245819Z","shell.execute_reply":"2024-09-16T06:23:58.924451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!nvcc --version","metadata":{"execution":{"iopub.status.busy":"2024-09-16T06:23:58.927193Z","iopub.execute_input":"2024-09-16T06:23:58.927726Z","iopub.status.idle":"2024-09-16T06:23:59.997158Z","shell.execute_reply.started":"2024-09-16T06:23:58.927697Z","shell.execute_reply":"2024-09-16T06:23:59.995760Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%env CUDA_HOME=/usr/local/cuda-11.8/","metadata":{"execution":{"iopub.status.busy":"2024-09-16T06:23:59.999871Z","iopub.execute_input":"2024-09-16T06:24:00.000207Z","iopub.status.idle":"2024-09-16T06:24:00.006739Z","shell.execute_reply.started":"2024-09-16T06:24:00.000174Z","shell.execute_reply":"2024-09-16T06:24:00.005534Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}