Skip to content

Pytorch3D can build and run on AMD GPUs#2022

Open
ZJLi2013 wants to merge 2 commits into
facebookresearch:mainfrom
PhysicalAI-AIM:amd_support
Open

Pytorch3D can build and run on AMD GPUs#2022
ZJLi2013 wants to merge 2 commits into
facebookresearch:mainfrom
PhysicalAI-AIM:amd_support

Conversation

@ZJLi2013
Copy link
Copy Markdown

@ZJLi2013 ZJLi2013 commented Mar 4, 2026

built and run verified on MI300, gfx942,

test logs:

test.log

root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_knn -v
test_invalid_norm (tests.test_knn.TestKNN.test_invalid_norm) ... ok
test_knn_check_version (tests.test_knn.TestKNN.test_knn_check_version) ... ok
test_knn_gather (tests.test_knn.TestKNN.test_knn_gather) ... ok
test_knn_vs_python_ragged_cpu (tests.test_knn.TestKNN.test_knn_vs_python_ragged_cpu) ... ok
test_knn_vs_python_ragged_cuda (tests.test_knn.TestKNN.test_knn_vs_python_ragged_cuda) ... ok
test_knn_vs_python_square_cpu (tests.test_knn.TestKNN.test_knn_vs_python_square_cpu) ... ok
test_knn_vs_python_square_cuda (tests.test_knn.TestKNN.test_knn_vs_python_square_cuda) ... ok

----------------------------------------------------------------------
Ran 7 tests in 51.435s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_chamfer -v
test_chamfer_joint_reduction (tests.test_chamfer.TestChamfer.test_chamfer_joint_reduction)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_chamfer_point_batch_reduction_mean (tests.test_chamfer.TestChamfer.test_chamfer_point_batch_reduction_mean)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_chamfer_point_reduction_max (tests.test_chamfer.TestChamfer.test_chamfer_point_reduction_max)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_chamfer_point_reduction_mean (tests.test_chamfer.TestChamfer.test_chamfer_point_reduction_mean)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_chamfer_point_reduction_none (tests.test_chamfer.TestChamfer.test_chamfer_point_reduction_none)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_chamfer_point_reduction_sum (tests.test_chamfer.TestChamfer.test_chamfer_point_reduction_sum)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_chamfer_pointcloud_object_nonormals (tests.test_chamfer.TestChamfer.test_chamfer_pointcloud_object_nonormals) ... ok
test_chamfer_pointcloud_object_withnormals (tests.test_chamfer.TestChamfer.test_chamfer_pointcloud_object_withnormals) ... ok
test_chamfer_vs_naive_pointcloud (tests.test_chamfer.TestChamfer.test_chamfer_vs_naive_pointcloud)
Test the default settings for chamfer_distance ... ok
test_empty_clouds (tests.test_chamfer.TestChamfer.test_empty_clouds) ... ok
test_incorrect_inputs (tests.test_chamfer.TestChamfer.test_incorrect_inputs) ... ok
test_incorrect_weights (tests.test_chamfer.TestChamfer.test_incorrect_weights) ... ok
test_invalid_norm (tests.test_chamfer.TestChamfer.test_invalid_norm) ... ok
test_single_direction_chamfer_point_reduction_mean (tests.test_chamfer.TestChamfer.test_single_direction_chamfer_point_reduction_mean)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_single_direction_chamfer_point_reduction_none (tests.test_chamfer.TestChamfer.test_single_direction_chamfer_point_reduction_none)
Compare output of vectorized chamfer loss with naive implementation ... ok
test_single_directional_chamfer_point_reduction_max (tests.test_chamfer.TestChamfer.test_single_directional_chamfer_point_reduction_max)
Compare output of vectorized single directional chamfer loss with naive implementation ... ok
test_single_directional_chamfer_point_reduction_sum (tests.test_chamfer.TestChamfer.test_single_directional_chamfer_point_reduction_sum)
Compare output of vectorized single directional chamfer loss with naive implementation ... ok
test_single_directional_chamfer_vs_naive_pointcloud (tests.test_chamfer.TestChamfer.test_single_directional_chamfer_vs_naive_pointcloud)
Test the single directional settings for chamfer_distance ... ok

----------------------------------------------------------------------
Ran 18 tests in 34.909s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_transforms -v
test_get_item (tests.test_transforms.TestRotate.test_get_item) ... ok
test_invalid_dimensions (tests.test_transforms.TestRotate.test_invalid_dimensions) ... ok
test_inverse (tests.test_transforms.TestRotate.test_inverse) ... ok
test_single_matrix (tests.test_transforms.TestRotate.test_single_matrix) ... ok
test_axis_fail (tests.test_transforms.TestRotateAxisAngle.test_axis_fail) ... ok
test_lower_case_axis (tests.test_transforms.TestRotateAxisAngle.test_lower_case_axis) ... ok
test_rotate_angle_fail (tests.test_transforms.TestRotateAxisAngle.test_rotate_angle_fail) ... ok
test_rotate_angle_radians (tests.test_transforms.TestRotateAxisAngle.test_rotate_angle_radians) ... ok
test_rotate_compose_x_y_z (tests.test_transforms.TestRotateAxisAngle.test_rotate_compose_x_y_z) ... ok
test_rotate_x_python_scalar (tests.test_transforms.TestRotateAxisAngle.test_rotate_x_python_scalar) ... ok
test_rotate_x_torch_scalar (tests.test_transforms.TestRotateAxisAngle.test_rotate_x_torch_scalar) ... ok
test_rotate_x_torch_tensor (tests.test_transforms.TestRotateAxisAngle.test_rotate_x_torch_tensor) ... ok
test_rotate_y_python_scalar (tests.test_transforms.TestRotateAxisAngle.test_rotate_y_python_scalar) ... ok
test_rotate_y_torch_scalar (tests.test_transforms.TestRotateAxisAngle.test_rotate_y_torch_scalar)
Test rotation about Y axis. With a right hand coordinate system this ... ok
test_rotate_y_torch_tensor (tests.test_transforms.TestRotateAxisAngle.test_rotate_y_torch_tensor) ... ok
test_rotate_z_python_scalar (tests.test_transforms.TestRotateAxisAngle.test_rotate_z_python_scalar) ... ok
test_rotate_z_torch_scalar (tests.test_transforms.TestRotateAxisAngle.test_rotate_z_torch_scalar) ... ok
test_rotate_z_torch_tensor (tests.test_transforms.TestRotateAxisAngle.test_rotate_z_torch_tensor) ... ok
test_get_item (tests.test_transforms.TestScale.test_get_item) ... ok
test_inverse (tests.test_transforms.TestScale.test_inverse) ... ok
test_single_matrix (tests.test_transforms.TestScale.test_single_matrix) ... ok
test_single_python_scalar (tests.test_transforms.TestScale.test_single_python_scalar) ... ok
test_single_torch_scalar (tests.test_transforms.TestScale.test_single_torch_scalar) ... ok
test_single_vector (tests.test_transforms.TestScale.test_single_vector) ... ok
test_three_mixed_broadcast_grad (tests.test_transforms.TestScale.test_three_mixed_broadcast_grad) ... ok
test_three_mixed_scalar (tests.test_transforms.TestScale.test_three_mixed_scalar) ... ok
test_three_python_scalar (tests.test_transforms.TestScale.test_three_python_scalar) ... ok
test_three_torch_scalar (tests.test_transforms.TestScale.test_three_torch_scalar) ... ok
test_three_vector_broadcast (tests.test_transforms.TestScale.test_three_vector_broadcast) ... ok
test_clone (tests.test_transforms.TestTransform.test_clone)
Check that cloned transformations contain different _matrix objects. ... ok
test_compose_fail (tests.test_transforms.TestTransform.test_compose_fail) ... ok
test_dtype_propagation (tests.test_transforms.TestTransform.test_dtype_propagation)
Check that a given dtype is correctly passed along to child ... ok
test_get_item (tests.test_transforms.TestTransform.test_get_item) ... ok
test_get_se3 (tests.test_transforms.TestTransform.test_get_se3) ... ok
test_init_with_custom_matrix (tests.test_transforms.TestTransform.test_init_with_custom_matrix) ... ok
test_init_with_custom_matrix_errors (tests.test_transforms.TestTransform.test_init_with_custom_matrix_errors) ... ok
test_inverse (tests.test_transforms.TestTransform.test_inverse) ... ok
test_rotate_axis_angle (tests.test_transforms.TestTransform.test_rotate_axis_angle) ... ok
test_rotate_check_rot_valid_off (tests.test_transforms.TestTransform.test_rotate_check_rot_valid_off) ... ok
test_rotate_check_rot_valid_on (tests.test_transforms.TestTransform.test_rotate_check_rot_valid_on) ... ok
test_scale (tests.test_transforms.TestTransform.test_scale) ... ok
test_scale_translate (tests.test_transforms.TestTransform.test_scale_translate) ... ok
test_stack (tests.test_transforms.TestTransform.test_stack) ... ok
test_to (tests.test_transforms.TestTransform.test_to) ... ok
test_transform_points_eps (tests.test_transforms.TestTransform.test_transform_points_eps) ... ok
test_transform_points_fail (tests.test_transforms.TestTransform.test_transform_points_fail) ... ok
test_translate (tests.test_transforms.TestTransform.test_translate) ... ok
test_broadcast_compose (tests.test_transforms.TestTransformBroadcast.test_broadcast_compose) ... ok
test_broadcast_compose_fail (tests.test_transforms.TestTransformBroadcast.test_broadcast_compose_fail) ... ok
test_broadcast_transform_normals (tests.test_transforms.TestTransformBroadcast.test_broadcast_transform_normals) ... ok
test_broadcast_transform_points (tests.test_transforms.TestTransformBroadcast.test_broadcast_transform_points) ... ok
test_multiple_broadcast_compose (tests.test_transforms.TestTransformBroadcast.test_multiple_broadcast_compose) ... ok
test_bad_broadcast (tests.test_transforms.TestTranslate.test_bad_broadcast) ... ok
test_get_item (tests.test_transforms.TestTranslate.test_get_item) ... ok
test_inverse (tests.test_transforms.TestTranslate.test_inverse) ... ok
test_matrix (tests.test_transforms.TestTranslate.test_matrix) ... ok
test_matrix_extra_args (tests.test_transforms.TestTranslate.test_matrix_extra_args) ... ok
test_mixed_broadcast (tests.test_transforms.TestTranslate.test_mixed_broadcast) ... ok
test_mixed_broadcast_grad (tests.test_transforms.TestTranslate.test_mixed_broadcast_grad) ... ok
test_mixed_scalars (tests.test_transforms.TestTranslate.test_mixed_scalars) ... ok
test_python_scalar (tests.test_transforms.TestTranslate.test_python_scalar) ... ok
test_torch_scalar (tests.test_transforms.TestTranslate.test_torch_scalar) ... ok
test_torch_scalar_grads (tests.test_transforms.TestTranslate.test_torch_scalar_grads) ... ok
test_torch_vectors (tests.test_transforms.TestTranslate.test_torch_vectors) ... ok
test_vector_broadcast (tests.test_transforms.TestTranslate.test_vector_broadcast) ... ok

----------------------------------------------------------------------
Ran 65 tests in 23.167s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_so3 -v
test_bad_so3_input_value_err (tests.test_so3.TestSO3.test_bad_so3_input_value_err)
Tests whether `so3_exp_map` and `so3_log_map` correctly return ... ok
test_cross (tests.test_so3.TestSO3.test_cross)
For a pair of randomly generated 3-dimensional vectors `a` and `b`, ... ok
test_determinant (tests.test_so3.TestSO3.test_determinant)
Tests whether the determinants of 3x3 rotation matrices produced ... ok
test_scriptable (tests.test_so3.TestSO3.test_scriptable) ... ok
test_so3_cos_angle (tests.test_so3.TestSO3.test_so3_cos_angle)
Check that `so3_rotation_angle(R, cos_angle=False).cos()` ... ok
test_so3_cos_bound (tests.test_so3.TestSO3.test_so3_cos_bound)
Checks that for an identity rotation `R=I`, the so3_rotation_angle returns ... ok
test_so3_cos_relative_angle (tests.test_so3.TestSO3.test_so3_cos_relative_angle)
Check that `so3_relative_angle(R1, R2, cos_angle=False).cos()` ... ok
test_so3_exp_singularity (tests.test_so3.TestSO3.test_so3_exp_singularity)
Tests whether the `so3_exp_map` is robust to the input vectors ... ok
test_so3_exp_to_log_to_exp (tests.test_so3.TestSO3.test_so3_exp_to_log_to_exp)
Check that `so3_exp_map(so3_log_map(R))==R` for ... ok
test_so3_log_singularity (tests.test_so3.TestSO3.test_so3_log_singularity)
Tests whether the `so3_log_map` is robust to the input matrices ... ok
test_so3_log_to_exp_to_log (tests.test_so3.TestSO3.test_so3_log_to_exp_to_log)
Check that `so3_log_map(so3_exp_map(log_rot))==log_rot` for ... ok
test_so3_log_to_exp_to_log_to_exp (tests.test_so3.TestSO3.test_so3_log_to_exp_to_log_to_exp)
Check that ... ok

----------------------------------------------------------------------
Ran 12 tests in 23.400s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_rotation_conversions -v
test_random_rotation_invariant (tests.test_rotation_conversions.TestRandomRotation.test_random_rotation_invariant)
The image of the x-axis isn't biased among quadrants. ... ok
test_6d (tests.test_rotation_conversions.TestRotationConversion.test_6d)
Converting to 6d and back ... ok
test_conventions (tests.test_rotation_conversions.TestRotationConversion.test_conventions)
The conventions listings have the right length. ... ok
test_euler_grad_exists (tests.test_rotation_conversions.TestRotationConversion.test_euler_grad_exists)
Euler angle calculations are differentiable. ... ok
test_from_axis_angle (tests.test_rotation_conversions.TestRotationConversion.test_from_axis_angle)
axis_angle -> mtx -> axis_angle ... ok
test_from_axis_angle_has_grad (tests.test_rotation_conversions.TestRotationConversion.test_from_axis_angle_has_grad) ... ok
test_from_euler (tests.test_rotation_conversions.TestRotationConversion.test_from_euler)
euler -> mtx -> euler ... ok
test_from_quat (tests.test_rotation_conversions.TestRotationConversion.test_from_quat)
quat -> mtx -> quat ... ok
test_matrix_to_quaternion_by_pi (tests.test_rotation_conversions.TestRotationConversion.test_matrix_to_quaternion_by_pi) ... ok
test_matrix_to_quaternion_corner_case (tests.test_rotation_conversions.TestRotationConversion.test_matrix_to_quaternion_corner_case)
Check no bad gradients from sqrt(0). ... ok
test_quat_grad_exists (tests.test_rotation_conversions.TestRotationConversion.test_quat_grad_exists)
Quaternion calculations are differentiable. ... ok
test_quaternion_application (tests.test_rotation_conversions.TestRotationConversion.test_quaternion_application)
Applying a quaternion is the same as applying the matrix. ... ok
test_quaternion_multiplication (tests.test_rotation_conversions.TestRotationConversion.test_quaternion_multiplication)
Quaternion and matrix multiplication are equivalent. ... ok
test_scriptable (tests.test_rotation_conversions.TestRotationConversion.test_scriptable) ... ok
test_to_axis_angle (tests.test_rotation_conversions.TestRotationConversion.test_to_axis_angle)
mtx -> axis_angle -> mtx ... ok
test_to_euler (tests.test_rotation_conversions.TestRotationConversion.test_to_euler)
mtx -> euler -> mtx ... ok
test_to_quat (tests.test_rotation_conversions.TestRotationConversion.test_to_quat)
mtx -> quat -> mtx ... ok

----------------------------------------------------------------------
Ran 17 tests in 20.690s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_so3 -v
test_bad_so3_input_value_err (tests.test_so3.TestSO3.test_bad_so3_input_value_err)
Tests whether `so3_exp_map` and `so3_log_map` correctly return ... ok
test_cross (tests.test_so3.TestSO3.test_cross)
For a pair of randomly generated 3-dimensional vectors `a` and `b`, ... ok
test_determinant (tests.test_so3.TestSO3.test_determinant)
Tests whether the determinants of 3x3 rotation matrices produced ... ok
test_scriptable (tests.test_so3.TestSO3.test_scriptable) ... ok
test_so3_cos_angle (tests.test_so3.TestSO3.test_so3_cos_angle)
Check that `so3_rotation_angle(R, cos_angle=False).cos()` ... ok
test_so3_cos_bound (tests.test_so3.TestSO3.test_so3_cos_bound)
Checks that for an identity rotation `R=I`, the so3_rotation_angle returns ... ok
test_so3_cos_relative_angle (tests.test_so3.TestSO3.test_so3_cos_relative_angle)
Check that `so3_relative_angle(R1, R2, cos_angle=False).cos()` ... ok
test_so3_exp_singularity (tests.test_so3.TestSO3.test_so3_exp_singularity)
Tests whether the `so3_exp_map` is robust to the input vectors ... ok
test_so3_exp_to_log_to_exp (tests.test_so3.TestSO3.test_so3_exp_to_log_to_exp)
Check that `so3_exp_map(so3_log_map(R))==R` for ... ok
test_so3_log_singularity (tests.test_so3.TestSO3.test_so3_log_singularity)
Tests whether the `so3_log_map` is robust to the input matrices ... ok
test_so3_log_to_exp_to_log (tests.test_so3.TestSO3.test_so3_log_to_exp_to_log)
Check that `so3_log_map(so3_exp_map(log_rot))==log_rot` for ... ok
test_so3_log_to_exp_to_log_to_exp (tests.test_so3.TestSO3.test_so3_log_to_exp_to_log_to_exp)
Check that ... ok

----------------------------------------------------------------------
Ran 12 tests in 22.765s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_face_areas_normals -v 
test_face_areas_normals_cpu (tests.test_face_areas_normals.TestFaceAreasNormals.test_face_areas_normals_cpu) ... ok
test_face_areas_normals_cuda (tests.test_face_areas_normals.TestFaceAreasNormals.test_face_areas_normals_cuda) ... ok
test_nonfloats_cpu (tests.test_face_areas_normals.TestFaceAreasNormals.test_nonfloats_cpu) ... ok
test_nonfloats_cuda (tests.test_face_areas_normals.TestFaceAreasNormals.test_nonfloats_cuda) ... ok

----------------------------------------------------------------------
Ran 4 tests in 24.035s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_points_normals -v
test_pcl_normals (tests.test_points_normals.TestPCLNormals.test_pcl_normals)
Tests the normal estimation on a spherical point cloud, where ... ok

----------------------------------------------------------------------
Ran 1 test in 22.710s

OK
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.test_sample_points_from_meshes -v 
/opt/conda/envs/py_3.12/lib/python3.12/site-packages/redis/connection.py:77: UserWarning: redis-py works best with hiredis. Please consider installing
  warnings.warn(msg)
test_all_empty_meshes (tests.test_sample_points_from_meshes.TestSamplePoints.test_all_empty_meshes)
Check sample_points_from_meshes raises an exception if all meshes are ... ok
test_multinomial (tests.test_sample_points_from_meshes.TestSamplePoints.test_multinomial)
Confirm that torch.multinomial does not sample elements which have ... /workspace/pytorch3d/tests/test_sample_points_from_meshes.py:199: UserWarning: The torch.cuda.*DtypeTensor constructors are no longer recommended. It's best to use methods such as torch.tensor(data, dtype=*, device='cuda') to create tensors. (Triggered internally at /pytorch/torch/csrc/tensor/python_tensor.cpp:78.)
  freqs = torch.cuda.FloatTensor(
/opt/conda/envs/py_3.12/lib/python3.12/unittest/case.py:690: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method TestSamplePoints.test_multinomial of <tests.test_sample_points_from_meshes.TestSamplePoints testMethod=test_multinomial>>)
  return self.run(*args, **kwds)
ok
test_multinomial_weights (tests.test_sample_points_from_meshes.TestSamplePoints.test_multinomial_weights)
Confirm that torch.multinomial does not sample elements which have ... /opt/conda/envs/py_3.12/lib/python3.12/unittest/case.py:690: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method TestSamplePoints.test_multinomial_weights of <tests.test_sample_points_from_meshes.TestSamplePoints testMethod=test_multinomial_weights>>)
  return self.run(*args, **kwds)
ok
test_outputs (tests.test_sample_points_from_meshes.TestSamplePoints.test_outputs) ... ok
test_sampling_output (tests.test_sample_points_from_meshes.TestSamplePoints.test_sampling_output)
Check outputs of sampling are correct for different meshes. ... ok
test_texture_sampling (tests.test_sample_points_from_meshes.TestSamplePoints.test_texture_sampling) ... ok
test_texture_sampling_cow (tests.test_sample_points_from_meshes.TestSamplePoints.test_texture_sampling_cow) ... ok
test_verts_nan (tests.test_sample_points_from_meshes.TestSamplePoints.test_verts_nan) ... ok

----------------------------------------------------------------------
Ran 8 tests in 25.277s

OK

root@51e401f40977:/workspace/pytorch3d# mkdir -p tests/pulsar/test_out 
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.pulsar.test_forward -v
test_basic_1chan (tests.pulsar.test_forward.TestForward.test_basic_1chan)
Test rendering one image with one sphere, 1 channel. ... ok
test_basic_3chan (tests.pulsar.test_forward.TestForward.test_basic_3chan)
Test rendering one image with one sphere, 3 channels. ... ok
test_basic_8chan (tests.pulsar.test_forward.TestForward.test_basic_8chan)
Test rendering one image with one sphere, 8 channels. ... ok
test_bg_weight (tests.pulsar.test_forward.TestForward.test_bg_weight)
Test background reweighting. ... ok
test_principal_point (tests.pulsar.test_forward.TestForward.test_principal_point)
Test shifting the principal point. ... ERROR

======================================================================
ERROR: test_principal_point (tests.pulsar.test_forward.TestForward.test_principal_point)
Test shifting the principal point.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspace/pytorch3d/tests/pulsar/test_forward.py", line 314, in test_principal_point
    imageio.imsave(
  File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/imageio/v2.py", line 397, in imwrite
    return file.write(im, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/imageio/plugins/pillow.py", line 433, in write
    raise ValueError("Can't write images with one color channel.")
ValueError: Can't write images with one color channel.

----------------------------------------------------------------------
Ran 5 tests in 22.969s

FAILED (errors=1)
root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.pulsar.test_depth -v 
test_basic (tests.pulsar.test_depth.TestDepth.test_basic) ... ok

----------------------------------------------------------------------
Ran 1 test in 21.175s

OK

root@51e401f40977:/workspace/pytorch3d# python3 -m unittest tests.pulsar.test_small_spheres -v 
test_basic (tests.pulsar.test_small_spheres.TestSmallSpheres.test_basic) ... ok

----------------------------------------------------------------------
Ran 1 test in 77.222s

OK

test_bin_size_error (tests.test_rasterize_meshes.TestRasterizeMeshes.test_bin_size_error) ... ok
test_coarse_cpu (tests.test_rasterize_meshes.TestRasterizeMeshes.test_coarse_cpu) ... ok
test_coarse_cuda (tests.test_rasterize_meshes.TestRasterizeMeshes.test_coarse_cuda) ... ok
test_compare_coarse_cpu_vs_cuda (tests.test_rasterize_meshes.TestRasterizeMeshes.test_compare_coarse_cpu_vs_cuda) ... ok
test_cpp_vs_cuda_bary_clip (tests.test_rasterize_meshes.TestRasterizeMeshes.test_cpp_vs_cuda_bary_clip) ... ok
test_cpp_vs_cuda_naive_vs_cuda_binned (tests.test_rasterize_meshes.TestRasterizeMeshes.test_cpp_vs_cuda_naive_vs_cuda_binned) ... ok
test_cpp_vs_cuda_perspective_correct (tests.test_rasterize_meshes.TestRasterizeMeshes.test_cpp_vs_cuda_perspective_correct) ... ok
test_cpu_vs_cuda_naive (tests.test_rasterize_meshes.TestRasterizeMeshes.test_cpu_vs_cuda_naive)
Compare naive versions of cuda and cpp ... ok
test_cuda_naive_vs_binned_perspective_correct (tests.test_rasterize_meshes.TestRasterizeMeshes.test_cuda_naive_vs_binned_perspective_correct) ... ok
test_order_of_ties (tests.test_rasterize_meshes.TestRasterizeMeshes.test_order_of_ties) ... ok
test_python_vs_cpp_bary_clip (tests.test_rasterize_meshes.TestRasterizeMeshes.test_python_vs_cpp_bary_clip) ... ok
test_python_vs_cpp_perspective_correct (tests.test_rasterize_meshes.TestRasterizeMeshes.test_python_vs_cpp_perspective_correct) ... ok
test_python_vs_cpu_vs_cuda (tests.test_rasterize_meshes.TestRasterizeMeshes.test_python_vs_cpu_vs_cuda) ... ok
test_simple_cpu_naive (tests.test_rasterize_meshes.TestRasterizeMeshes.test_simple_cpu_naive) ... ok
test_simple_cuda_binned (tests.test_rasterize_meshes.TestRasterizeMeshes.test_simple_cuda_binned) ... ok
test_simple_cuda_naive (tests.test_rasterize_meshes.TestRasterizeMeshes.test_simple_cuda_naive) ... ok
test_simple_python (tests.test_rasterize_meshes.TestRasterizeMeshes.test_simple_python) ... ok

----------------------------------------------------------------------
Ran 17 tests in 58.872s

OK
test_bin_size_error (tests.test_rasterize_points.TestRasterizePoints.test_bin_size_error) ... ok
test_coarse_cpu (tests.test_rasterize_points.TestRasterizePoints.test_coarse_cpu) ... ok
test_coarse_cuda (tests.test_rasterize_points.TestRasterizePoints.test_coarse_cuda) ... ok
test_compare_coarse_cpu_vs_cuda (tests.test_rasterize_points.TestRasterizePoints.test_compare_coarse_cpu_vs_cuda) ... ok
test_cpp_vs_naive_vs_binned (tests.test_rasterize_points.TestRasterizePoints.test_cpp_vs_naive_vs_binned) ... ok
test_cpu_behind_camera (tests.test_rasterize_points.TestRasterizePoints.test_cpu_behind_camera) ... ok
test_cpu_variable_radius (tests.test_rasterize_points.TestRasterizePoints.test_cpu_variable_radius) ... ok
test_cpu_vs_cuda_naive (tests.test_rasterize_points.TestRasterizePoints.test_cpu_vs_cuda_naive) ... ok
test_cuda_behind_camera (tests.test_rasterize_points.TestRasterizePoints.test_cuda_behind_camera) ... ok
test_cuda_variable_radius (tests.test_rasterize_points.TestRasterizePoints.test_cuda_variable_radius) ... ok
test_naive_simple_cpu (tests.test_rasterize_points.TestRasterizePoints.test_naive_simple_cpu) ... ok
test_naive_simple_cuda (tests.test_rasterize_points.TestRasterizePoints.test_naive_simple_cuda) ... ok
test_python_behind_camera (tests.test_rasterize_points.TestRasterizePoints.test_python_behind_camera) ... ok
test_python_simple_cpu (tests.test_rasterize_points.TestRasterizePoints.test_python_simple_cpu) ... ok
test_python_variable_radius (tests.test_rasterize_points.TestRasterizePoints.test_python_variable_radius) ... ok
test_python_vs_cpu_naive (tests.test_rasterize_points.TestRasterizePoints.test_python_vs_cpu_naive) ... ok
test_radius_format_failure (tests.test_rasterize_points.TestRasterizePoints.test_radius_format_failure) ... ok

----------------------------------------------------------------------
Ran 17 tests in 26.591s

OK
/opt/conda/envs/py_3.12/lib/python3.12/site-packages/redis/connection.py:77: UserWarning: redis-py works best with hiredis. Please consider installing
  warnings.warn(msg)
/workspace/pytorch3d/pytorch3d/renderer/opengl/__init__.py:19: UserWarning: Can't import EGL, not importing MeshRasterizerOpenGL. This might happen if your Python application imported OpenGL with a non-EGL backend before importing PyTorch3D, or if you don't have pyopengl installed as part of your Python distribution.
  warnings.warn(
test_render_meshes (unittest.loader._FailedTest.test_render_meshes) ... ERROR

======================================================================
ERROR: test_render_meshes (unittest.loader._FailedTest.test_render_meshes)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_render_meshes
Traceback (most recent call last):
  File "/opt/conda/envs/py_3.12/lib/python3.12/unittest/loader.py", line 137, in loadTestsFromName
    module = __import__(module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/pytorch3d/tests/test_render_meshes.py", line 49, in <module>
    from pytorch3d.renderer.opengl import MeshRasterizerOpenGL
ImportError: cannot import name 'MeshRasterizerOpenGL' from 'pytorch3d.renderer.opengl' (/workspace/pytorch3d/pytorch3d/renderer/opengl/__init__.py)


----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)
test_compositor_background_color_rgb (tests.test_render_points.TestRenderPoints.test_compositor_background_color_rgb) ... ok
test_compositor_background_color_rgba (tests.test_render_points.TestRenderPoints.test_compositor_background_color_rgba) ... ok
test_pointcloud_with_features (tests.test_render_points.TestRenderPoints.test_pointcloud_with_features) ... /workspace/pytorch3d/tests/test_render_points.py:292: UserWarning: pointcloud.npz not found, download from https://dl.fbaipublicfiles.com/pytorch3d/data/PittsburghBridge/pointcloud.npz, save it at the path /workspace/pytorch3d/docs/tutorials/data/PittsburghBridge/pointcloud.npz, and rerun
  warnings.warn(msg)
/opt/conda/envs/py_3.12/lib/python3.12/unittest/case.py:690: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method TestRenderPoints.test_pointcloud_with_features of <tests.test_render_points.TestRenderPoints testMethod=test_pointcloud_with_features>>)
  return self.run(*args, **kwds)
ok
test_simple_sphere (tests.test_render_points.TestRenderPoints.test_simple_sphere) ... ok
test_simple_sphere_batched (tests.test_render_points.TestRenderPoints.test_simple_sphere_batched) ... ok
test_simple_sphere_fisheye (tests.test_render_points.TestRenderPoints.test_simple_sphere_fisheye) ... ok
test_simple_sphere_pulsar (tests.test_render_points.TestRenderPoints.test_simple_sphere_pulsar) ... ok
test_unified_inputs_pulsar (tests.test_render_points.TestRenderPoints.test_unified_inputs_pulsar) ... /workspace/pytorch3d/pytorch3d/renderer/points/pulsar/unified.py:69: UserWarning: Creating a `PulsarPointsRenderer` with a compositor object! This object is ignored and just allowed as an argument for interface compatibility.
  warnings.warn(
ok

----------------------------------------------------------------------
Ran 8 tests in 42.633s

OK

ZJLi2013 added 2 commits March 4, 2026 11:00
Remove USE_ROCM preprocessor guards around float3 operators in pulsar math.h so they are available when building with ROCm/HIP on AMD GPUs.

Made-with: Cursor
Restore #if !defined(USE_ROCM) guard covering ALL float3 operators (binary
and compound-assignment). On ROCm, float3 is HIP_vector_type<float, 3>
which already provides these operators as member functions; defining them
as free functions too causes ambiguous overload errors at compile time.
The guard also now covers +=, -=, *=, /= which were previously unguarded.

Made-with: Cursor
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Mar 4, 2026

Hi @ZJLi2013!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

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

Successfully merging this pull request may close these issues.

1 participant